disk check to auto hide as well
This commit is contained in:
parent
68f268d7c2
commit
cc402b0e23
2 changed files with 12 additions and 6 deletions
|
@ -13,10 +13,16 @@ class PluginThread(threading.Thread):
|
|||
self.status['color'] = config.get(section, 'color')
|
||||
self.freq = config.getint(section, 'freq', fallback=30)
|
||||
self.hide = False
|
||||
self.problem_value = config.getint(section, 'problem', fallback=70)
|
||||
|
||||
def main(self):
|
||||
du_stat = psutil.disk_usage(self.part)
|
||||
# du_perc = str(du_stat.percent)
|
||||
if du_stat.percent >= self.problem_value:
|
||||
self.hide = False
|
||||
self.status['urgent'] = True
|
||||
else:
|
||||
self.hide = True
|
||||
self.status['urgent'] = False
|
||||
du_free = str(round(du_stat.free / 2**30, 2))
|
||||
du = self.part + ': ' + du_free + 'G'
|
||||
self.status['full_text'] = du
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue