Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal
  • 0
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? 

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

 

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

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

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