summaryrefslogtreecommitdiff
path: root/plugins/disk.py
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/disk.py')
-rw-r--r--plugins/disk.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/plugins/disk.py b/plugins/disk.py
index e705f4e..6085795 100644
--- a/plugins/disk.py
+++ b/plugins/disk.py
@@ -8,6 +8,8 @@ DISK_DEFAULTS = {'partition': '/', 'problem': 80, 'freq': 15}
class PluginThread(plugins.PluginThreadCommon):
def __init__(self, config):
super(PluginThread, self).__init__(config, DISK_DEFAULTS)
+ if 'title' not in self.conf:
+ self.conf['title'] = self.conf['partition']
def main(self):
du_stat = psutil.disk_usage(self.conf['partition'])
@@ -17,6 +19,5 @@ class PluginThread(plugins.PluginThreadCommon):
else:
self.hide = True
self.status['urgent'] = False
- du_free = str(round(du_stat.free / 2**30, 2))
- disk_usage = self.conf['partition'] + ': ' + du_free + 'G'
- self.status['full_text'] = disk_usage
+ status = '{:.2f}G'.format(du_stat.free / 2**30)
+ self.format_status(status)