Notify when ram usage big

This commit is contained in:
Thomas Forgione 2026-01-09 09:38:41 +01:00
parent 9bd287ff1c
commit 4fa769471c

View File

@ -228,6 +228,10 @@ def monitor_stats():
mem_values[-1] = mem_percent
temp_values[-1] = temp_percent
# Notify when memory greater than 75%
if mem_percent >= 75 and not any(map(lambda x: x > 75, mem_values[:-1])):
subprocess.run(['notify-send', '-u', 'critical', 'High memory usage', "% 5.1f" % mem_percent + '% of RAM used'])
if battery is None:
battery_json = '{"text": "", "class": "hidden"}'
else: