From 912be61900e0dbf9da19eba48d81893a151bdd2d Mon Sep 17 00:00:00 2001 From: Kenneth Lyons Date: Sat, 21 Feb 2015 16:53:41 -0800 Subject: [PATCH] Output should not be urgent if available space is greater than the critical limit. --- i3pystatus/disk.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/i3pystatus/disk.py b/i3pystatus/disk.py index 90a6000..b67d176 100644 --- a/i3pystatus/disk.py +++ b/i3pystatus/disk.py @@ -38,6 +38,8 @@ class Disk(IntervalModule): self.output = {} return + critical = available < self.critical_limit + cdict = { "total": (stat.f_bsize * stat.f_blocks) / self.divisor, "free": (stat.f_bsize * stat.f_bfree) / self.divisor, @@ -51,6 +53,6 @@ class Disk(IntervalModule): self.output = { "full_text": self.format.format(**cdict), - "color": self.color if available > self.critical_limit else self.critical_color, - "urgent": available > self.critical_limit + "color": self.critical_color if critical else self.color, + "urgent": critical }