made widget compatible with qtile v 0.17

This commit is contained in:
paul-loedige
2021-03-01 15:08:00 +01:00
parent 26353a4a81
commit ea3abd004c
3 changed files with 4 additions and 8 deletions
+2 -6
View File
@@ -5,7 +5,7 @@ import re
from libqtile import widget, bar
#region Custom_Memory
class MemoryC(widget.base.ThreadedPollText):
class MemoryC(widget.base.ThreadPoolText):
orientations = widget.base.ORIENTATION_HORIZONTAL
defaults = [
("format", "{MemUsed}GB/{MemTotal}GB", "Formatting for field names."),
@@ -13,13 +13,9 @@ class MemoryC(widget.base.ThreadedPollText):
]
def __init__(self, **config):
super().__init__(**config)
super().__init__("", **config)
self.add_defaults(MemoryC.defaults)
def tick(self):
self.update(self.poll())
return self.update_interval
def poll(self):
mem = psutil.virtual_memory()
swap = psutil.swap_memory()