From 2bc86f89299b5c6a2968d78453350a4020d3d722 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferit=20Yi=C4=9Fit=20BALABAN?= Date: Thu, 28 Apr 2022 02:56:22 +0300 Subject: [PATCH] Bring back the decimals :D --- fetchpy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fetchpy b/fetchpy index 0809a66..d241c4f 100755 --- a/fetchpy +++ b/fetchpy @@ -129,8 +129,8 @@ def main(): shell_name = _.removesuffix('\n').ljust(padding_count, ' ') package_count = str(len(installed_packages)).ljust(padding_count, ' ') - total_memory, used_memory, free_memory, d1, d2, d3 = map(int, os.popen('free -g --si').readlines()[1].split()[1:]) - memory_usage = f'{used_memory} GB / {total_memory} GB'.ljust(padding_count, ' ') + total_memory, used_memory, free_memory, d1, d2, d3 = map(int, os.popen('free -m').readlines()[1].split()[1:]) + memory_usage = f'{round((used_memory / 1024), 1)} GB / {round((total_memory / 1024), 1)} GB'.ljust(padding_count, ' ') with open('/proc/uptime', 'r') as f: uptime_seconds = float(f.readline().split()[0])