mirror of https://github.com/xzeldon/htop.git
parent
d73cc70566
commit
3d8fa0b926
59
Action.c
59
Action.c
|
@ -571,46 +571,57 @@ static Htop_Reaction actionHelp(State* st) {
|
|||
line++;
|
||||
mvaddstr(line++, 0, "CPU usage bar: ");
|
||||
|
||||
#define addbartext(attr, prefix, text) \
|
||||
do { \
|
||||
addattrstr(CRT_colors[DEFAULT_COLOR], prefix); \
|
||||
addattrstr(attr, text); \
|
||||
} while(0)
|
||||
|
||||
addattrstr(CRT_colors[BAR_BORDER], "[");
|
||||
addbartext(CRT_colors[CPU_NICE_TEXT], "", "low");
|
||||
addbartext(CRT_colors[CPU_NORMAL], "/", "normal");
|
||||
addbartext(CRT_colors[CPU_SYSTEM], "/", "kernel");
|
||||
if (st->settings->detailedCPUTime) {
|
||||
addattrstr(CRT_colors[CPU_NICE_TEXT], "low"); addstr("/");
|
||||
addattrstr(CRT_colors[CPU_NORMAL], "normal"); addstr("/");
|
||||
addattrstr(CRT_colors[CPU_SYSTEM], "kernel"); addstr("/");
|
||||
addattrstr(CRT_colors[CPU_IRQ], "irq"); addstr("/");
|
||||
addattrstr(CRT_colors[CPU_SOFTIRQ], "soft-irq"); addstr("/");
|
||||
addattrstr(CRT_colors[CPU_STEAL], "steal"); addstr("/");
|
||||
addattrstr(CRT_colors[CPU_GUEST], "guest"); addstr("/");
|
||||
addattrstr(CRT_colors[CPU_IOWAIT], "io-wait");
|
||||
addattrstr(CRT_colors[BAR_SHADOW], " used%");
|
||||
addbartext(CRT_colors[CPU_IRQ], "/", "irq");
|
||||
addbartext(CRT_colors[CPU_SOFTIRQ], "/", "soft-irq");
|
||||
addbartext(CRT_colors[CPU_STEAL], "/", "steal");
|
||||
addbartext(CRT_colors[CPU_GUEST], "/", "guest");
|
||||
addbartext(CRT_colors[CPU_IOWAIT], "/", "io-wait");
|
||||
addbartext(CRT_colors[BAR_SHADOW], " ", "used%");
|
||||
} else {
|
||||
addattrstr(CRT_colors[CPU_NICE_TEXT], "low-priority"); addstr("/");
|
||||
addattrstr(CRT_colors[CPU_NORMAL], "normal"); addstr("/");
|
||||
addattrstr(CRT_colors[CPU_SYSTEM], "kernel"); addstr("/");
|
||||
addattrstr(CRT_colors[CPU_GUEST], "virtualized");
|
||||
addattrstr(CRT_colors[BAR_SHADOW], " used%");
|
||||
addbartext(CRT_colors[CPU_GUEST], "/", "guest");
|
||||
addbartext(CRT_colors[BAR_SHADOW], " ", "used%");
|
||||
}
|
||||
addattrstr(CRT_colors[BAR_BORDER], "]");
|
||||
|
||||
attrset(CRT_colors[DEFAULT_COLOR]);
|
||||
mvaddstr(line++, 0, "Memory bar: ");
|
||||
addattrstr(CRT_colors[BAR_BORDER], "[");
|
||||
addattrstr(CRT_colors[MEMORY_USED], "used"); addstr("/");
|
||||
addattrstr(CRT_colors[MEMORY_BUFFERS_TEXT], "buffers"); addstr("/");
|
||||
addattrstr(CRT_colors[MEMORY_SHARED], "shared"); addstr("/");
|
||||
addattrstr(CRT_colors[MEMORY_CACHE], "cache");
|
||||
addattrstr(CRT_colors[BAR_SHADOW], " used/total");
|
||||
addbartext(CRT_colors[MEMORY_USED], "", "used");
|
||||
addbartext(CRT_colors[MEMORY_BUFFERS_TEXT], "/", "buffers");
|
||||
addbartext(CRT_colors[MEMORY_SHARED], "/", "shared");
|
||||
addbartext(CRT_colors[MEMORY_CACHE], "/", "cache");
|
||||
addbartext(CRT_colors[BAR_SHADOW], " ", "used");
|
||||
addbartext(CRT_colors[BAR_SHADOW], "/", "totel");
|
||||
addattrstr(CRT_colors[BAR_BORDER], "]");
|
||||
|
||||
attrset(CRT_colors[DEFAULT_COLOR]);
|
||||
mvaddstr(line++, 0, "Swap bar: ");
|
||||
addattrstr(CRT_colors[BAR_BORDER], "[");
|
||||
addattrstr(CRT_colors[SWAP], "used");
|
||||
addbartext(CRT_colors[SWAP], "", "used");
|
||||
#ifdef HTOP_LINUX
|
||||
addstr("/");
|
||||
addattrstr(CRT_colors[SWAP_CACHE], "cache");
|
||||
addattrstr(CRT_colors[BAR_SHADOW], " used/total");
|
||||
addbartext(CRT_colors[SWAP_CACHE], "/", "cache");
|
||||
#else
|
||||
addattrstr(CRT_colors[BAR_SHADOW], " used/total");
|
||||
addbartext(CRT_colors[SWAP_CACHE], " ", "");
|
||||
#endif
|
||||
addbartext(CRT_colors[BAR_SHADOW], " ", "used");
|
||||
addbartext(CRT_colors[BAR_SHADOW], "/", "total");
|
||||
addattrstr(CRT_colors[BAR_BORDER], "]");
|
||||
|
||||
line++;
|
||||
|
||||
#undef addbartext
|
||||
|
||||
attrset(CRT_colors[DEFAULT_COLOR]);
|
||||
mvaddstr(line++, 0, "Type and layout of header meters are configurable in the setup screen.");
|
||||
if (CRT_colorScheme == COLORSCHEME_MONOCHROME) {
|
||||
|
|
Loading…
Reference in New Issue