diff options
author | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2024-03-09 01:22:57 -0800 |
---|---|---|
committer | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2024-03-09 01:22:57 -0800 |
commit | 27412fa4eb869a020321913e34f53f3ea0148c0d (patch) | |
tree | da44a7c7ee10309847d7dce48610a7dce8c022a7 | |
parent | 67efb32979524fb5b5f3764ef058e40274bb5947 (diff) | |
download | panel-master.tar.gz panel-master.tar.xz |
-rwxr-xr-x | panel.py | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -457,12 +457,18 @@ class ModNetIf(ModInterval): class ModCPU(ModInterval): def refresh(self): percent = psutil.cpu_percent() - self.out = Fmt.labelled('CPU', f'{percent:.0f}%%') + buf = f'{percent:.0f}%%' + if percent > 75: + buf = Fmt.fg('#ff4000', buf) + self.out = Fmt.labelled('CPU', buf) class ModMem(ModInterval): def refresh(self): percent = psutil.virtual_memory().percent - self.out = Fmt.labelled('MEM', f'{percent:.0f}%%') + buf = f'{percent:.0f}%%' + if percent > 75: + buf = Fmt.fg('#ff4000', buf) + self.out = Fmt.labelled('MEM', buf) class ModPWVol(ModInterval): def __init__(self, sink='@DEFAULT_AUDIO_SINK@', step='0.05', limit=None, |