A simple replacement for i3status that is both extensible and customizable.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
596 B

import psutil
import plugins
MEM_DEFAULTS = {'title': 'RAM', 'problem': 85}
class PluginThread(plugins.PluginThreadCommon):
def __init__(self, config):
super(PluginThread, self).__init__(config, MEM_DEFAULTS)
def main(self):
mem_stat = psutil.virtual_memory()
if mem_stat.percent > self.conf['problem']:
self.hide = False
urgent = True
else:
self.hide = True
urgent = False
mem_available = round(mem_stat.available / 2**30, 2)
self.format_status('{:.2f}G'.format(mem_available), urgent)