summaryrefslogtreecommitdiff
path: root/ar/.local/bin/statusbar/sb-cpubars
diff options
context:
space:
mode:
authorTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2026-03-24 11:08:18 +0900
committerTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2026-03-24 11:08:18 +0900
commit7ad735138ce0160e68c3cb0e8be013e778400cf8 (patch)
tree616ca99625b21185c7be3d4f0cab4a11764283f5 /ar/.local/bin/statusbar/sb-cpubars
parent5dd58abffb4ca07cc76face5175891328a9b55f4 (diff)
modified claude/settings.json, deleted statusbar/sb-cpu, deleted statusbar/sb-cpubars, deleted statusbar/sb-memory, created statusbar/sb-system
Diffstat (limited to 'ar/.local/bin/statusbar/sb-cpubars')
-rwxr-xr-xar/.local/bin/statusbar/sb-cpubars43
1 files changed, 0 insertions, 43 deletions
diff --git a/ar/.local/bin/statusbar/sb-cpubars b/ar/.local/bin/statusbar/sb-cpubars
deleted file mode 100755
index 4b03fa6..0000000
--- a/ar/.local/bin/statusbar/sb-cpubars
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/bin/sh
-
-# Module showing CPU load as a changing bars.
-# Just like in polybar.
-# Each bar represents amount of load on one core since
-# last run.
-
-# Cache in tmpfs to improve speed and reduce SSD load
-cache=/tmp/cpubarscache
-
-case $BLOCK_BUTTON in
-2) setsid -f "$TERMINAL" -e htop ;;
-3) notify-send "🪨 CPU load module" "Each bar represents one CPU core" ;;
-6) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;;
-esac
-
-# id total idle
-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"
-old=$(cat "$cache")
-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"