💾 Archived View for anjune.lol › gmi › vccolours.gmi captured on 2023-07-10 at 13:36:06. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2023-01-29)

➡️ Next capture (2023-07-22)

-=-=-=-=-=-=-

monolalia → M’kay Computer → Virtual console (tty) palette

Annoyed by the super-saturated, sometimes-too-dark colours of the Linux console?

With echo

Here you go: `echo -en "\e]PxRRGGBB"`, with `x` being a palette index from 0 to F and RRGGBB an RGB hex triplet.

If you want to automate it without affecting non-tty terminal emulators, check `$TERM`, like so:

if [ "$TERM" = "linux" ]; then
    echo -en "\e]P0000000" #black
    echo -en "\e]P82B2B2B" #darkgrey
    echo -en "\e]P1D75F5F" #darkred
    echo -en "\e]P9E33636" #red
    echo -en "\e]P287AF5F" #darkgreen
    echo -en "\e]PA98E34D" #green
    echo -en "\e]P3D7AF87" #brown
    echo -en "\e]PBFFD75F" #yellow
    echo -en "\e]P48787AF" #darkblue
    echo -en "\e]PC7373C9" #blue
    echo -en "\e]P5BD53A5" #darkmagenta
    echo -en "\e]PDD633B2" #magenta
    echo -en "\e]P65FAFAF" #darkcyan
    echo -en "\e]PE44C9C9" #cyan
    echo -en "\e]P7E5E5E5" #lightgrey
    echo -en "\e]PFFFFFFF" #white
#    clear # uncomment this when the background is non-black to clean up the screen
fi

(Naturally, those are just example colours that I stole from somewhere better than here.)

With setvtrgb

You can also use the setvtrgb command with a file containing three lines of 16 decimal values (0-255) each:

R, G, B, R, G, B, R, G, B, R, G, B, R, G, B, R
G, B, R, G, B, R, G, B, R, G, B, R, G, B, R, G
B, R, G, B, R, G, B, R, G, B, R, G, B, R, G, B

And yes, it line-breaks inside RGB triplets. Sigh!

Here’re the default values:

$ cat /sys/module/vt/parameters/default_{red,grn,blu}
0,170,0,170,0,170,0,170,85,255,85,255,85,255,85,255
0,0,170,85,0,0,170,170,85,85,255,255,85,85,255,255
0,0,0,0,170,170,170,170,85,85,85,85,255,255,255,255

You can stick that in your `/etc/profile.d` to have it run on startup.

With /etc/vtrgb

Or, if you save the colour values used for `setvtrgb` as `/etc/vtrgb`, they should be applied automatically before you even log in. That one’s probably the most straightforward.

Know what’s funny?

I don’t seem to be using any of those methods and still get the nicer, pastellier tty colours I want. If only I knew how I did that…