linux:ricing:virtual_terminal_color
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| linux:ricing:virtual_terminal_color [2020/07/17 15:44] – ↷ Page name changed from linux:ricing:virtual_terminal to linux:ricing:virtual_terminal_color chuck | linux:ricing:virtual_terminal_color [2025/01/20 12:33] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ======Virtual Terminal====== | + | ======Virtual Terminal |
| The following notes apply to __virtual terminals__ such as '' | The following notes apply to __virtual terminals__ such as '' | ||
| Line 13: | Line 13: | ||
| They //should// work on Ubuntu and other Debian based distributions as well.</ | They //should// work on Ubuntu and other Debian based distributions as well.</ | ||
| ====Setting Up==== | ====Setting Up==== | ||
| - | * If it's not already installed, install '' | + | * If it's not already installed, install '' |
| - | * '' | + | sudo apt install kbd |
| + | </ | ||
| - | < | + | ---- |
| - | <hr style=" | + | |
| - | </ | + | |
| ====Modify initramfs==== | ====Modify initramfs==== | ||
| Add the **setvtrgb** executable to the **initramfs** so that it's available during boot. | Add the **setvtrgb** executable to the **initramfs** so that it's available during boot. | ||
| - | * Create a shell script in the hooks directory: | + | * Create a shell script in the hooks directory:<code bash> |
| - | * '' | + | sudoedit / |
| + | </ | ||
| + | |||
| + | * And add the contents:<file sh setvtrgb_hook> | ||
| #!/bin/sh | #!/bin/sh | ||
| PREREQ="" | PREREQ="" | ||
| Line 43: | Line 45: | ||
| copy_exec / | copy_exec / | ||
| </ | </ | ||
| - | * Set the script to be executable: | + | * Set the script to be executable:<code bash> |
| - | * '' | + | sudo chmod +x / |
| + | </ | ||
| - | < | + | ---- |
| - | <hr style=" | + | |
| - | </ | + | |
| ====Choose a colorscheme==== | ====Choose a colorscheme==== | ||
| Line 58: | Line 59: | ||
| * I chose the **init-top** directory because it gets called as early as possible into the boot process. | * I chose the **init-top** directory because it gets called as early as possible into the boot process. | ||
| * Refer to **man initramfs-tools** BOOT SCRIPTS section and change it to suit your needs. | * Refer to **man initramfs-tools** BOOT SCRIPTS section and change it to suit your needs. | ||
| - | * Set the script to be executable: | + | * Set the script to be executable:<code bash> |
| - | * '' | + | sudo chmod +x / |
| + | </ | ||
| - | < | + | ---- |
| - | <hr style=" | + | |
| - | </ | + | |
| ====Update initramfs==== | ====Update initramfs==== | ||
| After completing the above steps, we will generate the new initramfs | After completing the above steps, we will generate the new initramfs | ||
| - | * Update the initramfs: | + | * Update the initramfs:<code bash> |
| - | * '' | + | sudo update-initramfs -u |
| - | * Verify that **setvtrgb** was added: | + | </ |
| - | * '' | + | * Verify that **setvtrgb** was added:<code bash> |
| + | lsinitramfs -l / | ||
| + | </ | ||
| * //make sure to modify the above command to point to your initrd// | * //make sure to modify the above command to point to your initrd// | ||
| * Reboot | * Reboot | ||
| - | < | + | ---- |
| - | <hr style=" | + | |
| - | </ | + | |
| =====Applying a VT Colorscheme after boot===== | =====Applying a VT Colorscheme after boot===== | ||
| Line 85: | Line 85: | ||
| * Copy or create a [[# | * Copy or create a [[# | ||
| - | * Create a systemd service: | + | * Create a systemd service:<code bash> |
| - | * '' | + | sudoedit / |
| + | </ | ||
| + | * Add the contents:<file sh custom-vt-colors.service> | ||
| [Unit] | [Unit] | ||
| Description=Load custom VT color palette | Description=Load custom VT color palette | ||
| Line 97: | Line 99: | ||
| WantedBy=multi-user.target | WantedBy=multi-user.target | ||
| </ | </ | ||
| - | * Start and enable the service: | + | * Start and enable the service:<code bash> |
| - | * '' | + | sudo systemctl enable --now custom-vt-colors.service |
| + | </ | ||
| \\ | \\ | ||
| - | < | + | ---- |
| - | <hr style=" | + | |
| - | </ | + | |
| =====VT Colorschemes===== | =====VT Colorschemes===== | ||
| For the colorschemes below (except default), I imported the Xresources of each colorscheme to https:// | For the colorschemes below (except default), I imported the Xresources of each colorscheme to https:// | ||
| Line 125: | Line 127: | ||
| * [[linux: | * [[linux: | ||
| - | < | + | ---- |
| - | <hr style=" | + | |
| - | </ | + | |
| ====VT Colorscheme Format==== | ====VT Colorscheme Format==== | ||
| Line 142: | Line 142: | ||
| For a working example and/or to make a backup of the current settings: | For a working example and/or to make a backup of the current settings: | ||
| - | * Save/view current vt colors in a **setvtrgb** usable format: | + | * Save/view current vt colors in a **setvtrgb** usable format:<code bash> |
| - | * '' | + | cat / |
| + | </ | ||
| - | < | + | ---- |
| - | <hr style=" | + | |
| - | </ | + | |
| ===Converting Hex Colors to RGB=== | ===Converting Hex Colors to RGB=== | ||
| - | * Convert hex values to rgb with each of r,g,b being on a newline:< | + | * Convert hex values to rgb with each of r,g,b being on a newline:< |
| # | # | ||
| - | # Take input hex number, convert to uppercase, strip # | + | hex_regex=' |
| - | hexinput=$(echo $1 | tr ' | + | |
| + | # Check if input is valid hex | ||
| + | if [[ " | ||
| + | | ||
| + | else | ||
| + | printf ' | ||
| + | fi | ||
| # Print RGB output with each on it's own line | # Print RGB output with each on it's own line | ||
| - | printf | + | printf |
| + | |||
| + | # vim: ft=sh ts=2 sts=2 sw=2 sr et | ||
| </ | </ | ||
| * Run it: | * Run it: | ||
| Line 163: | Line 170: | ||
| * Escaping or quoting the hex value starting with a # is necessary else bash will think it's a comment. | * Escaping or quoting the hex value starting with a # is necessary else bash will think it's a comment. | ||
| - | \\ | ||
| - | < | + | ---- |
| - | <hr style=" | + | |
| - | </ | + | |
| - | =====VT Fonts===== | ||
| - | Nothing too exciting yet.. | ||
| - | |||
| - | * Change the font & size interactively: | ||
| - | * '' | ||
| - | * Change the font & size manually: | ||
| - | * '' | ||
| - | * VT font directory is: | ||
| - | * '' | ||
| - | * Show current font. (Run in a tty): | ||
| - | * '' | ||
| - | |||
| - | < | ||
| - | <hr style=" | ||
| - | </ | ||
| =====References===== | =====References===== | ||
| Line 192: | Line 181: | ||
| * https:// | * https:// | ||
| * https:// | * https:// | ||
| - | |||
| - | ====Fonts==== | ||
| - | * '' | ||
| ====General==== | ====General==== | ||
| * http:// | * http:// | ||
| + | |||
linux/ricing/virtual_terminal_color.1595000662.txt.gz · Last modified: by chuck
