fix swap file display for RPi Zero

This commit is contained in:
Hristo
2022-11-20 21:33:39 +02:00
committed by Masoko
parent 0b70629cb0
commit 53e7e7277c

View File

@@ -64,7 +64,7 @@ def check_voltage():
def check_swap(): def check_swap():
full_cmd = "free -t | awk 'NR == 3 {print $3/$2*100}'" full_cmd = "free -t |grep -i swap | awk 'NR == 1 {print $3/$2*100}'"
swap = subprocess.Popen(full_cmd, shell=True, stdout=subprocess.PIPE).communicate()[0] swap = subprocess.Popen(full_cmd, shell=True, stdout=subprocess.PIPE).communicate()[0]
swap = round(float(swap.decode("utf-8").replace(",", ".")), 1) swap = round(float(swap.decode("utf-8").replace(",", ".")), 1)
return swap return swap