[[!meta title="How to change the colour of ls to work with bright terminal backgrounds"]] ## Introduction I am using [rxvt-unicode](http://software.schmorp.de/pkg/rxvt-unicode.html) as my terminal and prefer to use a bright background due to better readability in the sun. I have tried various colour themes (including [solarized](http://ethanschoonover.com/solarized) and [solarized-light](https://github.com/yangzetian/xresources-color-solarized-light), but was never satisfied, because of changes they make to existing colour configurations for applications like mutt, alot or irssi. I am essentially using black as the foreground colour and LightYellow2 as the background colour at the moment (which I inherit from some very old xterm + [[!fvwm]]2 settings). ## Motivation The problem with my current setup is that symbolic links are show in **cyan** by ***ls*** on my system and thus are pretty much unreadable, as you can see: [[!img urxvt-before.png alt="urxvt with unreadable cyan colour"]] ## The solution As the problem mainly arises by the use of ls, I initially thought about modifying the **LS_COLORS** variable. However, as I frequently login to servers that are variable does not effect the colour output on the servers (and modifying AcceptEnv on all servers is also not realistic). As I do not want to have cyan output on my LightYellow2 background at all, I thought about changing the colour cyan to black. I found a nice colour table on [[!gentoowiki Rxvt-unicode#Color_theme]], with description of colour number to name: !black *color0: #251f1f *color8: #5e5e5e !red *color1: #eb4509 *color9: #eb4509 !green *color2: #94e76b *color10: #95e76b !yellow *color3: #ffac18 *color11: #ffac18 !blue *color4: #46aede *color12: #46aede !magenta *color5: #e32c57 *color13: #e32c57 !cyan *color6: #d6dbac *color14: #d6dbac !white *color7: #efefef *color15: #efefef ## The result So in the end, only the following entries in .Xresources are required to make cyan symbolic links readable by changing cyan to black: URxvt.background: LightYellow2 URxvt.foreground: black URxvt.color6: black URxvt.color14: black And this is how it finally looks like: [[!img urxvt-after.png alt="urxvt with cyan changed to black"]] ## SEE ALSO * [Terminal Colours](http://ciembor.github.io/4bit/) * [[!archwiki X_resources]] * [[!archwiki Rxvt-unicode]] [[!tag terminal unix urxvt]]