." 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_type | id | c-type | description of the markup margin |
| g_mem | 1 | not yet implemented | |
| p_uid | 2 | int | any process belonging to user with uid s |
| p_stat | 3 | char | any process with state s |
| p_mem | 4 | int | any process using more than s% phys. memory |
| p_cpu | 5 | int | same as above, but cpu usage |
| p_size | 6 | int | any process alrger than s k |
| p_tty | 7 | char[4] | any process having controlling terminal s |
| ANSI Color Definitions | ||||||||
| color | black | red | green | yellow | blue | magenta | cyan | white |
| fg | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 |
| bg | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 |
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 | |||||
| attribute | bold | underscore | blink | reverse | concealed |
| value | 01 | 04 | 05 | 07 | 08 |
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"