Reference

ps_color(7)

color support for ps and top The showtask module, which is used by ps and top has support for colorization of tasks. The color markup is controlled by markup hints in $PS_COLORS resp. $TOP_COLORS. There is a program called pscol, (similar to dircolors) in a separate package that can be used to set these environment variables. The environment variables should contain a list of entries of the form markup_type,markup_value,markup_string separated by %, where markup_type is the id of the markup_type from the following table, markup value is a value of the type corresponding to the markup_type and markup_string is an ANSI markupstring consisting of a forground color, a background color or an attribute all separated by a semicolon. Note that next to no check is made whether an output device supports ANSI colors The order of the markup entries is important, as the first recognized will be used. Currently the following markup_types are recognised by showtask: Attributes can only be defined for a color_pair, i.e. it is impossible to have a attribute operate on background color only. These are the ANSI names for the attributes. Not always do the names correspond to the actual realisation, e.g. bold usually means bold and bright. Some attributes may have no effect at all. This is allowed by ANSI.

." This file describes color support for showtask, i.e. for ps or top.

NAME

ps_color - color support for ps and top

The showtask module, which is used by ps and top has support for colorization of tasks. The color markup is controlled by markup hints in $PS_COLORS resp. $TOP_COLORS. There is a program called pscol, (similar to dircolors) in a separate package that can be used to set these environment variables.

The environment variables should contain a list of entries of the form markup_type,markup_value,markup_string separated by %, where markup_type is the id of the markup_type from the following table, markup value is a value of the type corresponding to the markup_type and markup_string is an ANSI markupstring consisting of a forground color, a background color or an attribute all separated by a semicolon.

Note that next to no check is made whether an output device supports ANSI colors The order of the markup entries is important, as the first recognized will be used.

Currently the following markup_types are recognised by showtask:

markup_typeidc-typedescription of the markup margin
g_mem1 not yet implemented
p_uid2intany process belonging to user with uid s
p_stat3charany process with state s
p_mem4intany process using more than s% phys. memory
p_cpu5intsame as above, but cpu usage
p_size6intany process alrger than s k
p_tty7char[4]any process having controlling terminal s
ANSI Color Definitions
colorblackredgreenyellowbluemagentacyanwhite
fg3031323334353637
bg4041424344454647

Attributes can only be defined for a color_pair, i.e. it is impossible to have a attribute operate on background color only. These are the ANSI names for the attributes. Not always do the names correspond to the actual realisation, e.g. bold usually means bold and bright. Some attributes may have no effect at all. This is allowed by ANSI.

ANSI Attributes
attributeboldunderscoreblinkreverseconcealed
value0104050708

EXAMPLES

Markup by CPU Usage (from bold blue on white (very little) to bold red on yellow):

PS_COLORS="5,0,01;34;40%5,25,01;34%5,50,32%5,75,31%5,90,01;32;43"

Mark root's processes bold red on black:

TOP_COLORS="2,0,01;32;40"

History