Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal
  • 0
Sign in to follow this  
kepler68

How to add more colors to ls

Question

Hi! I have been digging through the OS files trying to find where it determines what color a given file is on ls. i want to make .3dx files a unique color (file format from hologram editor) but i have not been able to find where that is handled. Is there an easier way to do this othe rthan digging through the OS? If not, where do i look? 

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0

if you set LS_COLORS (an environment variable in the shell) it'll use that as a rule for highlighting ls results

it is a colon separated list of rules.

{TAG}={COLOR}:{TAG}={COLOR}:{TAG}={COLOR} ... etc

TAG can be:

di for directory

fi for file

ln for symbolic link

TAG can also be a glob rule, like *.lua

 

COLOR  is a vt100 color code, "36" for example is the default blue dir color

 

see /etc/profile.lua where it sets the system default for LS_COLORS

you can change your current shell env var using `set` like `set LS_COLORS="....."`

or you can set it via os.setenv, like I do in the /etc/profile.lua

 

Share this post


Link to post
Share on other sites
  • 0
8 minutes ago, payonel said:

if you set LS_COLORS (an environment variable in the shell) it'll use that as a rule for highlighting ls results

it is a colon separated list of rules.

{TAG}={COLOR}:{TAG}={COLOR}:{TAG}={COLOR} ... etc

TAG can be:

di for directory

fi for file

ln for symbolic link

TAG can also be a glob rule, like *.lua

 

COLOR  is a vt100 color code, "36" for example is the default blue dir color

 

see /etc/profile.lua where it sets the system default for LS_COLORS

you can change your current shell env var using `set` like `set LS_COLORS="....."`

or you can set it via os.setenv, like I do in the /etc/profile.lua

 

Thanks! Got it working :D

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.