Add support for systems with German language (#111)

This commit is contained in:
Masoko
2024-05-08 18:53:03 +03:00
committed by GitHub
parent 0d1ae214e3
commit a64c63113d
2 changed files with 7 additions and 4 deletions

View File

@@ -81,6 +81,9 @@ def check_swap():
def check_memory():
full_cmd = "free | grep -i mem | awk 'NR == 1 {print $3/$2*100}'"
memory = subprocess.Popen(full_cmd, shell=True, stdout=subprocess.PIPE).communicate()[0]
if memory == '':
full_cmd = "free | grep -i speicher | awk 'NR == 1 {print $3/$2*100}'"
memory = subprocess.Popen(full_cmd, shell=True, stdout=subprocess.PIPE).communicate()[0]
memory = round(float(memory.decode("utf-8").replace(",", ".")))
return memory