SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I want to change the ANSI colour pallette on the console (CLI not GUI).
I find certain colours are difficult to see against the black background, in my case blue. I know someone who cannot see dark red against black while red stands out nicely for me.
Modifying the DIRCOLORS entries is not a solution because the pallette is still limited to the same 16 colours and blue remains the same blue wherever I use it.
Attempts to use a 256 colour pallette can produce unexpected results elsewhere and can introduce dependencies I am not willing to propagate through the system.
As I understand it, RGB values for the ANSI pallette are assigned by the video display manufacturer, and I have seen these variations myself. (Matrox green may not be the same as ATI green for example)
Is there some fairly simple means by which I can access and modify the low level RGB values for the basic pallette?
-> but if you can change them would it still be considered a standard?
I was not refering to any ANSI colour standard, but rather to the ANSI escape sequences which provide eight basic colours, modified by perhaps as many as eight attributes. On a VGA display this results in 16 colours. On a Herculese display: bold, blinking, reversed, underlined, and perhaps strikethrough text might be available.
In this case the "standard" as I understand it only requires that an instruction to the video display which calls for one of these eight colours, yellow (for example), returns something the video display _manufacturer_ has defined as yellow.
PS1='\033[01:33m\w.\h \w/ \033[0m' should change the prompt to (bright) yellow.
PS1='\033[00:31m\w.\h \w/ \033[0m' should change the prompt to (dark) red
I percieve "01:31" as bleeding orange on some systems, bright red on others, and sometimes something decidedly pinkish.
-> the simplest thing to do would be to change the color saturation/contrast/brightness levels on the monitor
Not an option, distorting the colour balance for the console will make any AV signal unpleasant to watch, and the monitor would certainly require adjusting every time I switched in or out of GUI world. I also run four systems with wildly different display capabilities through one KVM. That is an awful lot of fiddling and fussing about.
-> as well as changing the foreground and/or background colors of the console
If not through DIRCOLORS and escape sequences, I am begging for suggestions.
That has been my solution to date. My current choice is bold white, very legible but can be washed out by ambient light. Bright yellow is fine only so long as I never enter the /dev directory.
If you're using a framebuffer, I think you should be able to do this. Check out the man page for console_codes. (The part about changing the color palette.)
The first 8 linux console colors go like this: 0=black (background), 1=red, 2=green, 3=brown, 4=blue, 5=magenta, 6=cyan, 7=white (foreground). On my console, the next 8 colors appear to be "brighter" colors; 8=grey, 9=red, A=green, B=yellow, C=blue, D=magenta, E=cyan, and F=white. To change the color for "bright blue" directories to a different blue, you could add this line to /etc/rc.d/rc.local:
Code:
echo -en "\e]PC0BB5FF"
The part you'll change is the last 7 characters after the "P". (nrrggbb, where n=the color number from 0-15 (in hex) and rrggbb=the hex color code.)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.