summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--py3status/modules/sysdata.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/py3status/modules/sysdata.py b/py3status/modules/sysdata.py
index f836bc1..9343722 100644
--- a/py3status/modules/sysdata.py
+++ b/py3status/modules/sysdata.py
@@ -24,6 +24,7 @@ class GetData:
- `arg`: argument.
"""
result = subprocess.check_output([cmd, arg])
+ result = result.decode('utf-8')
return result
def cpu(self):
@@ -60,8 +61,9 @@ class GetData:
"""
# Run 'free -m' command and make a list from output.
mem_data = self.execCMD('free', '-m').split()
- total_mem = int(mem_data[7]) / 1024.
- used_mem = int(mem_data[15]) / 1024.
+ mem_index = mem_data.index('Mem:')
+ total_mem = int(mem_data[mem_index + 1]) / 1024.
+ used_mem = int(mem_data[mem_index + 2]) / 1024.
# Caculate percentage
used_mem_percent = int(used_mem / (total_mem / 100))