The colors and visual styles used by aptitude to display text can be extensively customized. Each visual element has an associated “style”, which describes the particular colors and visual attributes that will be used to display that element. Styles take the form of a list of color and attribute settings. This list is not necessarily exhaustive; if some colors or attributes are not explicitly specified, their values will be taken from the surrounding visual context. In fact, most visual elements have an “empty” style by default.
You can change the contents of a style by creating a
configuration group of the same name in the apt
or
aptitude configuration file. For instance, the
“MenuBorder
” style is used
to draw the visual border around drop-down menus. By
default, this border is drawn bold and white-on-blue.
Placing the following text in the configuration file would
change it to white-on-cyan:
Aptitude::UI::Styles { MenuBorder {fg white; bg cyan; set bold;}; };
As you can see, a style's configuration group consists of a sequence of instructions. The general classes of instructions are:
fg
color
Sets the text foreground to the given
color
. See below for a
list of the colors known to aptitude.
bg
color
Sets the text background to the given
color
. See below for a
list of the colors known to aptitude.
set
attribute
Enables the given text
attribute
. See below for a
list of the text attributes known to aptitude.
clear
attribute
Disables the given text
attribute
. See below for a
list of the text attributes known to aptitude.
flip
attribute
Toggles the given text
attribute
: if it is enabled
in the surrounding element, it will be disabled, and
vice versa. See below for a list of the text
attributes known to aptitude.
The colors that aptitude recognizes are black
,
blue
, cyan
,
green
, magenta
,
red
, white
, and
yellow
[20]. In addition, you may specify
default
in place of a background color to
use the default terminal background (this could be the
default color, an image file, or even
“transparent”). The styles that aptitude
recognizes are:
blink
Enables blinking text.
bold
Makes the foreground color of the text (or the background if reverse video is enabled) brighter.
dim
May cause text to be extra-dim on some terminals. No effect has been observed on common Linux terminals.
reverse
Swaps the foreground and background colors. Many visual elements flip this attribute to perform common highlighting tasks.
standout
This enables “the best highlighting mode of the terminal”. In xterms it is similar, but not idential to, reverse video; behavior on other terminals may vary.
underline
Enables underlined text.
You can select several attributes at once by separating them
with commas; for instance, set
bold,standout;
.
Note | |
---|---|
As hinted at above, the interpretation of both styles and text attributes is highly terminal-dependent. You may need to experiment a bit to find out exactly what some settings do on your terminal. |
The following styles can be customized in aptitude:
Figure 2.14. Customizable styles in aptitude
Style | Default | Description |
---|---|---|
Bullet | fg yellow; set bold; | The style of the bullets in bulleted lists. |
ChangelogNewerVersion | set bold; | The style of newer versions of the package in the changelog view. Note that aptitude will only highlight newer versions of the package if you have the package libparse-debianchangelog-perl installed. |
Default | fg white; bg black; | The basic style of the screen. |
DepBroken | fg black; bg red; | The style of unfulfilled dependencies. |
DisabledMenuEntry | fg black; bg blue; set dim; | The style of menu entries that are disabled and cannot be used. |
DownloadHit | fg black; bg green; | The style used to indicate that a file was “hit”: i.e., it has not changed since the last time it was downloaded. |
DownloadProgress | fg blue; bg yellow; | The style of the progress indicator for a download. |
EditLine | fg white; bg black; clear reverse; | The style of line editors (for instance, the entry in the “Search” dialog). |
Error | fg white; bg red; set bold; | The style of error messages. |
Header | fg white; bg blue; set bold; | The style of screen headers. |
HighlightedMenuBar | fg white; bg blue; set bold,reverse; | The style of the currently selected menu name in the menu bar. |
HighlightedMenuEntry | fg white; bg blue; set bold,reverse; | The style of the currently selected choice in a menu. |
MediaChange | fg yellow; bg red; set bold; | The style of the dialog used to ask the user to insert a new CD. |
MenuBar | fg white; bg blue; set bold; | The style of the menu bar. |
MenuBorder | fg white; bg blue; set bold; | The style of the borders that surround a drop-down menu. |
MenuEntry | fg white; bg blue; | The style of each entry in a drop-down menu. |
MineBomb | fg red; set bold; | The style of bombs in Minesweeper. |
MineBorder | set bold; | The style of the border drawn around a Minesweeper board. |
MineFlag | fg red; set bold; | The style of flags in Minesweeper. |
MineNumber N | Various |
The style of the number
N in Minesweeper;
N may range from 0 to
8.
|
MultiplexTab | fg white; bg blue; | The color used to display “tabs” other than the currently selected one. |
MultiplexTabHighlighted | fg blue; bg white; | The color used to display the currently selected “tab”. |
PkgBroken | fg red; flip reverse; | The style of packages in the package list which have unfulfilled dependencies. |
PkgBrokenHighlighted | fg red; | The style of highlighted packages in the package list which have unfulfilled dependencies. |
PkgNotInstalled | The style of packages which are not currently installed and will not be installed. | |
PkgNotInstalledHighlighted | The style of highlighted packages which are not currently installed and will not be installed. | |
PkgIsInstalled | set bold; | The style of packages which are currently installed and for which no actions are scheduled. |
PkgIsInstalledHighlighted | set bold; flip reverse; | The style of highlighted packages which are currently installed and for which no actions are scheduled. |
PkgToDowngrade | set bold; | The style of packages in the package list which will be downgraded. |
PkgToDowngradeHighlighted | set bold; flip reverse | The style of highlighted packages in the package list which will be downgraded. |
PkgToHold | fg white; flip reverse; | The style of packages in the package list which are on hold. |
PkgToHoldHighlighted | fg white; | The style of highlighted packages in the package list which are on hold. |
PkgToInstall | fg green; flip reverse; | The style of packages in the package list which are being installed (not upgraded) or reinstalled. |
PkgToInstallHighlighted | fg green; | The style of highlighted packages in the package list which are being installed (not upgraded) or reinstalled. |
PkgToRemove | fg magenta; flip reverse; | The style of packages in the package list which will be removed or purged. |
PkgToRemoveHighlighted | fg magenta; | The style of highlighted packages in the package list which will be removed or purged. |
PkgToUpgrade | fg cyan; flip reverse; | The style of packages in the package list which will be upgraded. |
PkgToUpgradeHighlighted | fg cyan; | The style of highlighted packages in the package list which will be upgraded. |
Progress | fg blue; bg yellow; | The style of progress indicators such as the one that appears while the package cache is being loaded. |
SolutionActionApproved | bg green; | The style of approved actions in a solution. |
SolutionActionRejected | bg red; | The style of rejected actions in a solution. |
Status | fg white; bg blue; set bold; | The style of status lines at the bottom of the screen. |
TreeBackground | The basic color of all visual lists and trees. | |
TrustWarning | fg red; bg black; set bold; | The color used to display warnings about package trust. |