Customizing colors

The colors aptitude uses to display various things on the screen can be customized to your liking. To change the color of the user interface element elt, you set the configuration key Aptitude::UI::Colors::elt to a group of two elements: the foreground color and the background color. In other words, to make broken packages red-on-black instead of black-on-red, put this in the configuration file:

Aptitude::UI::Colors::PkgBroken {red; black;};

The available colors are black, blue, cyan, green, magenta, red, white, and yellow [13] . You can cause the element to appear in bold text by placing “bold” in front of the foreground color; for instance, boldwhite. Finally, you can enter integers, which will be directly used as text attributes.

Putting it all together, a simple, if extremely ugly, redefinition of some colors would look like this:

Aptitude::UI::Colors {
DefaultWidgetBackground {boldwhite; magenta;};
ScreenStatusColor {green; cyan;};
ScreenHeaderColor {red; yellow;};
Progress {cyan; white;};
};

This would result in the following display:


		Too eye-watering for plain text.

The colors that can be customized are shown in Figure 2.10, “Customizable colors in aptitude”. The default for each color is given as a pair foreground,background.

Figure 2.10. Customizable colors in aptitude

ColorDefaultDescription
Bulletyellow,black The color used to display the bullets in bulleted lists.
DefaultWidgetBackgroundwhite,black The color used to draw blank areas of the screen, and the default color used to display text.
DepBrokenblack,red The color used to display unfulfilled dependencies.
DownloadHitblack,green The color used to indicate that a file was “hit”: ie, it was checked but is unchanged, so it won't be donloaded.
DownloadProgressblack,yellow The color used to display the progress indicator for a download.
Errorboldwhite,redThe color used to display error messages.
HighlightedMenuBarboldwhite,blue The color used to display the currently selected menu in the menu bar.
HighlightedMenuEntryboldblue,white The color used to display the currently selected choice in a menu.
MediaChangeboldyellow,red The color used when asking the user to change CDs.
MenuBarboldblue,white The color used to display the menu bar.
MenuBorderboldwhite,blue The color used to draw borders around menus.
MenuEntrywhite,blue The color used to display the choices in a menu. This will be changed to boldface when drawing hotkeys.
MineBombColorboldred,black The color used to display bombs in Minesweeper.
MineFlagColorboldred,black The color used to display flags in Minesweeper.
PkgBrokenblack,red The color used to display packages which have unfulfilled dependencies.
PkgToHoldblack,white The color used to display packages which are on hold.
PkgToInstallblack,green The color used to display packages which are being installed (not upgraded) or reinstalled.
PkgToRemoveblack,magenta The color used to display a package which will be removed or purged.
PkgToUpgradeblack,cyan The color used to display a package which will be upgraded.
Progressblue,yellow The color used to display progress indicators such as the one that appears while the package cache is being loaded.
ScreenHeaderColorboldwhite,blue The color used to display a screen header (information at the top of the screen).
ScreenStatusColorboldwhite,blue The color used to display a status line at the bottom of the screen.


[13] Which becomes brown on some terminals when it is the background color.