LinuxCommandLibrary

setvtrgb

Set virtual terminal color palette

SYNOPSIS

setvtrgb [-e <escape_char>] [-u] [<r0> <g0> <b0> ... <r15> <g15> <b15>]
The RGB triplets <rN> <gN> <bN> are required unless the -u option is used.

PARAMETERS

-e <escape_char>
    Specifies an alternative escape character (default is '\033') to use for ioctl calls, which communicate with the kernel.

-u
    Undoes the previous color map change and restores the default 16-color palette of the virtual terminal. When this option is used, no RGB values should be provided.

<r0> <g0> <b0> ... <r15> <g15> <b15>
    A sequence of 16 triplets, where each triplet <rN> <gN> <bN> defines the Red, Green, and Blue components for console color N (from 0 to 15). Each component is an integer from 0 to 255. These values override the console's default color map.

DESCRIPTION

setvtrgb is a Linux command-line utility used to modify the color palette of the virtual console (TTY). It allows users to redefine the 16 standard VGA colors (colors 0 through 15) by specifying their Red, Green, and Blue (RGB) components. Each color is defined by a triplet of integers ranging from 0 to 255 for its red, green, and blue intensity, respectively. This enables customization of the text and background colors displayed on the console, providing a personalized visual experience or ensuring better readability. The changes apply directly to the kernel's console color map and affect all subsequent text output on that specific virtual terminal. It is primarily used by system administrators or users who spend a lot of time in a console environment.

CAVEATS

setvtrgb only affects the Linux virtual consoles (TTYs) and will not work in graphical terminal emulators such as xterm, gnome-terminal, or konsole.
Modifying the console color map typically requires root privileges or appropriate capabilities (e.g., CAP_SYS_TTY_CONFIG) to interact with the kernel's console device.
Changes made by setvtrgb are usually temporary and specific to the current virtual terminal session. They might be reset upon rebooting the system or switching to a different virtual terminal if its default map is loaded.
The kernel must support the TIOCL_SETRGB ioctl for this command to function. Most modern Linux kernels include this support.

HISTORY

The setvtrgb utility is part of the kbd package, which provides various console utilities for Linux. Its development is closely tied to the evolution of the Linux console itself, offering fine-grained control over its appearance. The ability to customize console colors has been a feature available since early Linux kernel versions supporting the TIOCL_SETRGB ioctl, allowing users and system administrators to personalize their command-line environments beyond the basic 16-color VGA palette. It continues to be relevant for systems where a graphical environment is not present or desired, such as embedded systems, servers, or rescue environments.

SEE ALSO

setfont(8), console_codes(4), ioctl_console(2), vconsole.conf(5)

Copied to clipboard