X-Git-Url: https://git.xandkar.net/?a=blobdiff_plain;f=bin%2Fkhatus_show;h=ad5b060e8c369e1c1e838f7fa937d46399a5751e;hb=bd61022dea50d93a4423cd6517092f656c709944;hp=19004beb823761e22a65332048f549437d565513;hpb=756b9d5a05cbd36f97b1cb817137148517e14abf;p=khatus.git diff --git a/bin/khatus_show b/bin/khatus_show index 19004be..ad5b060 100755 --- a/bin/khatus_show +++ b/bin/khatus_show @@ -22,10 +22,10 @@ memory=$( total=$2; used=$3; cache=$6; - file = "/home/siraaj/var/run/status/memory_used_percentage"; + prev_file = "/home/siraaj/var/run/status/memory_used_percentage"; curr = round(used / total * 100); - getline prev < file; - print curr > file; + getline prev < prev_file; + print curr > prev_file; if (curr > prev) { direction = ">"; } else if (curr < prev) { @@ -44,12 +44,11 @@ disk=$( function round(n) {return int(n + 0.5)} $1 == "/dev/mapper/kubuntu--vg-root" { - total = $2; - used = $3; - file = "/home/siraaj/var/run/status/disk_space_used_percentage"; - curr = round(used / total * 100); - getline prev < file; - print curr > file; + curr = $5; + sub("%$", "", curr); + prev_file = "/home/siraaj/var/run/status/disk_space_used_percentage"; + getline prev < prev_file; + print curr > prev_file; if (curr > prev) { direction = ">"; } else if (curr < prev) { @@ -256,15 +255,31 @@ signal_last_msg_age=$( echo \ "\ E$energy\ + \ + \ M$memory\ + \ + \ D$disk\ + \ + \ C=[$cpu ${temp}°C ${fan}rpm]\ - |\ + \ + \ S=$screen_brightness\ + \ + \ V=$volume\ + \ + \ B:$bluetooth_power\ + \ + \ W:$wifi\ - |\ + \ + \ + $signal_last_msg_age\ + \ $weather\ \ $datetime \