Difference between revisions of "Configure virtual console colors"

From ArchWiki
Jump to: navigation, search
(recat)
Line 1: Line 1:
 
[[Category:Eye candy (English)]]
 
[[Category:Eye candy (English)]]
The colors in the Linux virtual console running on the framebuffer can be changed. This is done by writing the escape code {{Codeline|\\e]PXRRGGBB}} where {{Codeline|X}} is the hexadecimal index of the color from 0-F, and {{Codeline|RRGGBB}} is a traditional hexadecimal RGB code.
+
The colors in the Linux virtual console running on the framebuffer can be changed. This is done by writing the escape code {{ic|\\e]PXRRGGBB}} where {{ic|X}} is the hexadecimal index of the color from 0-F, and {{ic|RRGGBB}} is a traditional hexadecimal RGB code.
  
 
==Reusing ~/.Xdefaults settings==
 
==Reusing ~/.Xdefaults settings==

Revision as of 16:56, 12 February 2012

The colors in the Linux virtual console running on the framebuffer can be changed. This is done by writing the escape code \\e]PXRRGGBB where X is the hexadecimal index of the color from 0-F, and RRGGBB is a traditional hexadecimal RGB code.

Reusing ~/.Xdefaults settings

To reuse the color configuration from ~/.Xdefaults, add the following snippet to the shell init script (Template:Filename/Template:Filename/...).

if [ "$TERM" = "linux" ]; then
    _SEDCMD='s/.*\*color\([0-9]\{1,\}\).*#\([0-9a-fA-F]\{6\}\).*/\1 \2/p'
    for i in $(sed -n "$_SEDCMD" $HOME/.Xdefaults | \
               awk '$1 < 16 {printf "\\e]P%X%s", $1, $2}'); do
        echo -en "$i"
    done
    clear
fi