Made it less annoying. xD
This commit is contained in:
parent
43d9a4c3ec
commit
35615caa70
1 changed files with 9 additions and 1 deletions
|
@ -58,6 +58,8 @@ def ram_full():
|
|||
|
||||
|
||||
def loop():
|
||||
warning_cooldown = 0
|
||||
|
||||
while True:
|
||||
ram_usage = ram_perc()
|
||||
swap_usage = swap_perc()
|
||||
|
@ -65,8 +67,14 @@ def loop():
|
|||
if ram_usage >= 98 and swap_usage >= 98:
|
||||
ram_full()
|
||||
|
||||
elif ram_usage >= 90:
|
||||
elif ram_usage >= 90 = warning_cooldown == 0:
|
||||
ram_almost_full()
|
||||
warning_cooldown = 30
|
||||
|
||||
else:
|
||||
warning_cooldown -= 1
|
||||
|
||||
sleep(1)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
Loading…
Reference in a new issue