mirror of https://github.com/nicolargo/glances
Process list: Highlight process niceness
Highlight the nice value of a process when is different from 0. Add 'NICE' decoration for managing color.pull/354/head
parent
29fdeec161
commit
6fa10b5a2b
|
@ -104,6 +104,7 @@ class glancesCurses:
|
|||
# Colors text styles
|
||||
self.no_color = curses.color_pair(1)
|
||||
self.default_color = curses.color_pair(3) | A_BOLD
|
||||
self.nice_color = curses.color_pair(9) | A_BOLD
|
||||
self.ifCAREFUL_color = curses.color_pair(4) | A_BOLD
|
||||
self.ifWARNING_color = curses.color_pair(5) | A_BOLD
|
||||
self.ifCRITICAL_color = curses.color_pair(2) | A_BOLD
|
||||
|
@ -115,6 +116,7 @@ class glancesCurses:
|
|||
# B&W text styles
|
||||
self.no_color = curses.A_NORMAL
|
||||
self.default_color = curses.A_NORMAL
|
||||
self.nice_color = A_BOLD
|
||||
self.ifCAREFUL_color = curses.A_UNDERLINE
|
||||
self.ifWARNING_color = A_BOLD
|
||||
self.ifCRITICAL_color = curses.A_REVERSE
|
||||
|
@ -133,6 +135,7 @@ class glancesCurses:
|
|||
'TITLE': self.title_color,
|
||||
'PROCESS': self.default_color2,
|
||||
'STATUS': self.default_color2,
|
||||
'NICE': self.nice_color,
|
||||
'CAREFUL': self.ifCAREFUL_color2,
|
||||
'WARNING': self.ifWARNING_color2,
|
||||
'CRITICAL': self.ifCRITICAL_color2,
|
||||
|
|
|
@ -221,6 +221,7 @@ class GlancesPlugin(object):
|
|||
TITLE: for stat title
|
||||
PROCESS: for process name
|
||||
STATUS: for process status
|
||||
NICE: for process niceness
|
||||
OK: Value is OK and non logged
|
||||
OK_LOG: Value is OK and logged
|
||||
CAREFUL: Value is CAREFUL and non logged
|
||||
|
|
|
@ -135,7 +135,11 @@ class Plugin(GlancesPlugin):
|
|||
msg = " {0:9}".format(p['username'][:9])
|
||||
ret.append(self.curse_add_line(msg, optional=True))
|
||||
# NICE
|
||||
msg = " {0:>3}".format(p['nice'])
|
||||
nice = p['nice']
|
||||
msg = " {0:>3}".format(nice)
|
||||
if nice != 0:
|
||||
ret.append(self.curse_add_line(msg, decoration='NICE', optional=True))
|
||||
else:
|
||||
ret.append(self.curse_add_line(msg, optional=True))
|
||||
# STATUS
|
||||
status = p['status']
|
||||
|
|
Loading…
Reference in New Issue