Difference between revisions of "Configure virtual console colors"

From ArchWiki
Jump to: navigation, search
(Virtual Console Login Screen)
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
[[Category:Other desktop user's resources (English)]]
+
[[Category:Eye candy]]
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==
To reuse the color configuration from ~/.Xdefaults,  add the following snippet to the shell init script ({{Filename|.bashrc}}/{{Filename|.zshrc}}/...).
+
To reuse the color configuration from ~/.Xdefaults,  add the following snippet to the shell init script ({{ic|.bashrc}}/{{ic|.zshrc}}/...).
  
 
  if [ "$TERM" = "linux" ]; then
 
  if [ "$TERM" = "linux" ]; then
Line 13: Line 13:
 
     clear
 
     clear
 
  fi
 
  fi
 +
 +
==Virtual Console Login Screen==
 +
Changing the default Virtual Console Login screen.
 +
Take a backup of your original {{ic|/etc/issue}} like {{ic|mv /etc/issue /etc/issue.bak}}.
 +
Make a new file called {{ic|issue}} in your {{ic|/etc/}} folder and input the following below.
 +
 +
echo -e '\e[H\e[2J' > issue
 +
echo -e '                                                            \e[1;30m| \e[34m\\s \\r' >> issue
 +
echo -e '      \e[36;1m/\\\\                      \e[37m||    \e[36m| |                  \e[30m|' >> issue
 +
echo -e '      \e[36m/  \\\\                    \e[37m||    \e[36m|    _              \e[30m| \e[32m\\t' >> issue
 +
echo -e '    \e[1;36m/ \e[0;36m.. \e[1m\\\\  \e[37m//==\\\\\\\\ ||/= /==\\\\ ||/=\\\\  \e[36m| | |/ \\\\ |  | \\\\ /    \e[30m| \e[32m\\d' >> issue
 +
echo -e '    \e[0;36m/ .  . \\\\  \e[37m||  || ||  |    ||  || \e[36m| | |  | |  |  X      \e[1;30m|' >> issue
 +
echo -e '  \e[0;36m/  .  .  \\\\ \e[37m\\\\\\\\==/| ||  \\\\==/ ||  || \e[36m| | |  | \\\\_/| / \\\\    \e[1;30m| \e[31m\\U' >> issue
 +
echo -e '  \e[0;36m/ ..    .. \\\\  \e[0;37mA simple, lightweight linux distribution.  \e[1;30m|' >> issue
 +
echo -e ' \e[0;36m/_\x27        `_\\\\                                            \e[1;30m| \e[35m\\l \e[0mon \e[1;33m\\n' >> issue
 +
echo -e ' \e[0m' >> issue
 +
echo -e '' >> issue
 +
 +
Save the file, then {{ic|chmod +x issue}} and your done.
 +
 +
To restore your original {{ic|issue}} just run the following: {{ic|mv /etc/issue /etc/issue.old && mv /etc/issue.bak /etc/issue}}.
 +
 +
Credits & Original thread can be found here: https://bbs.archlinux.org/viewtopic.php?pid=386429#p386429

Revision as of 13:27, 17 August 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 (.bashrc/.zshrc/...).

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

Virtual Console Login Screen

Changing the default Virtual Console Login screen. Take a backup of your original /etc/issue like mv /etc/issue /etc/issue.bak. Make a new file called issue in your /etc/ folder and input the following below.

echo -e '\e[H\e[2J' > issue
echo -e '                                                            \e[1;30m| \e[34m\\s \\r' >> issue
echo -e '       \e[36;1m/\\\\                      \e[37m||     \e[36m| |                   \e[30m|' >> issue
echo -e '      \e[36m/  \\\\                     \e[37m||     \e[36m|     _               \e[30m| \e[32m\\t' >> issue
echo -e '     \e[1;36m/ \e[0;36m.. \e[1m\\\\   \e[37m//==\\\\\\\\ ||/= /==\\\\ ||/=\\\\  \e[36m| | |/ \\\\ |  | \\\\ /     \e[30m| \e[32m\\d' >> issue
echo -e '    \e[0;36m/ .  . \\\\  \e[37m||  || ||   |    ||  || \e[36m| | |  | |  |  X      \e[1;30m|' >> issue
echo -e '   \e[0;36m/  .  .  \\\\ \e[37m\\\\\\\\==/| ||   \\\\==/ ||  || \e[36m| | |  | \\\\_/| / \\\\     \e[1;30m| \e[31m\\U' >> issue
echo -e '  \e[0;36m/ ..    .. \\\\   \e[0;37mA simple, lightweight linux distribution.  \e[1;30m|' >> issue
echo -e ' \e[0;36m/_\x27        `_\\\\                                             \e[1;30m| \e[35m\\l \e[0mon \e[1;33m\\n' >> issue
echo -e ' \e[0m' >> issue
echo -e  >> issue

Save the file, then chmod +x issue and your done.

To restore your original issue just run the following: mv /etc/issue /etc/issue.old && mv /etc/issue.bak /etc/issue.

Credits & Original thread can be found here: https://bbs.archlinux.org/viewtopic.php?pid=386429#p386429