aboutsummaryrefslogtreecommitdiff
path: root/.local/bin/awesome-widgets/widget-cpu_usage
diff options
context:
space:
mode:
Diffstat (limited to '.local/bin/awesome-widgets/widget-cpu_usage')
-rwxr-xr-x.local/bin/awesome-widgets/widget-cpu_usage31
1 files changed, 0 insertions, 31 deletions
diff --git a/.local/bin/awesome-widgets/widget-cpu_usage b/.local/bin/awesome-widgets/widget-cpu_usage
deleted file mode 100755
index 4be33eb..0000000
--- a/.local/bin/awesome-widgets/widget-cpu_usage
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/bin/sh
-
-# Cache in tmpfs to improve speed and reduce SSD load
-cache=/tmp/cpubarscache
-
-stats=$(awk '/cpu[0-7]+/ {printf "%d %d %d\n", substr($1,4), ($2 + $3 + $4 + $5), $5 }' /proc/stat)
-[ ! -f $cache ] && echo "$stats" > "$cache"
-old=$(cat "$cache")
-printf " 🫀 "
-echo "$stats" | while read -r row; do
- id=${row%% *}
- rest=${row#* }
- total=${rest%% *}
- idle=${rest##* }
-
- case "$(echo "$old" | awk '{if ($1 == id)
- printf "%d\n", (1 - (idle - $3) / (total - $2))*100 /12.5}' \
- id="$id" total="$total" idle="$idle")" in
-
- "0") printf "▁";;
- "1") printf "▂";;
- "2") printf "▃";;
- "3") printf "▄";;
- "4") printf "▅";;
- "5") printf "▆";;
- "6") printf "▇";;
- "7") printf "█";;
- "8") printf "█";;
- esac
-done; printf "\\n"
-echo "$stats" > "$cache"