Setting the default colours on linux virtual terminals (ttys)
-- 2025-04-12 --
I like to keep my environment as consistent as possible so I want the colours in the tty at start up to be the same as in my virtual terminals when I run a graphical interface.
There is a simple way to change the colours when you are working in a tty:
So, first install setvtrgb. On Void Linux this is contained in the kbd package.
setvtrgb will change the tty colours as indicated in FILENAME. FILENAME has to be in one of two formats. It could be a three line file with sixteen comma-seperated values (0-255):
The first line contains the red components of each colour, the second the green components and the third the red ones. I don't find this an easy format to deal with but if you're just making minor tweaks it's not too bad. You can create a file for editing from the current colour palette by running:
The other file format that setvtrgb can read is sixteen lines with one hexadecimal triplet on each line:
This is the format I use as it's easier to match with the colour palettes in my graphical applications which mostly use this format for their colors.
Running setvtrgb with one of the above file will immediately change the colour palette in all the ttys. However the changes won't survive a reboot.
To make the changes permanent and be there from start up you need to save a palette somewhere convenient. I save the file at
Then add the following line to /etc/rc.local:
That's it! Your new default colour palette will be used by all your ttys from boot.