1
0
Fork 0

status bar cleanup

This commit is contained in:
Luca Bilke 2023-06-15 13:27:35 +02:00
parent 77685367ff
commit 2e67bb28b3
No known key found for this signature in database
GPG Key ID: 7B77C51E8C779E75
3 changed files with 3 additions and 3 deletions

View File

@ -8,7 +8,7 @@ green="\033[32m"
orange="\033[33m" orange="\033[33m"
cache=/tmp/cpubarscache cache=/tmp/cpubarscache
temp=$(sensors | awk '/CPU/ {print $2}' | tr -d "+") temp=$(sensors | awk '/CPU/ {printf ("%.f°C", $2)}' | tr -d "+")
stats=$(awk '/cpu[0-9]+/ {printf "%d %d %d\n", substr($1,4), ($2 + $3 + $4 + $5), $5 }' /proc/stat) stats=$(awk '/cpu[0-9]+/ {printf "%d %d %d\n", substr($1,4), ($2 + $3 + $4 + $5), $5 }' /proc/stat)
[ ! -f $cache ] && echo "$stats" >"$cache" [ ! -f $cache ] && echo "$stats" >"$cache"
old=$(cat "$cache") old=$(cat "$cache")

View File

@ -6,4 +6,4 @@ big="\033[11m"
location=${1:-/} location=${1:-/}
[ -d "$location" ] || exit [ -d "$location" ] || exit
printf "%b" "$big$reset $(df -h "$location" | awk ' /[0-9]/ {print $3 "/" $2}')\n" printf "%b" "$big$reset $(df -H "$location" | awk ' /[0-9]/ {print $3 "/" $2}')\n"

View File

@ -1,3 +1,3 @@
#!/bin/sh #!/bin/sh
printf "%b" "\033[11m\033[10m " printf "%b" "\033[11m\033[10m "
free --mebi | sed -n '2{p;q}' | awk '{printf ("%2.2fGiB/%2.2fGiB\n", ( $3 / 1024), ($2 / 1024))}' free --mega | sed -n '2{p;q}' | awk '{printf ("%2.2fG/%2.2fG\n", ($3 / 1000), ($2 / 1000))}'