]> git.frustrated-labs.net Git - dotfiles.git/commitdiff
add cpu plugin for sketchybar
authorAlexander Goussas <[email protected]>
Wed, 15 Apr 2026 03:30:37 +0000 (22:30 -0500)
committerAlexander Goussas <[email protected]>
Wed, 15 Apr 2026 03:30:37 +0000 (22:30 -0500)
sketchybar/.config/sketchybar/plugins/cpu.sh [new file with mode: 0755]
sketchybar/.config/sketchybar/sketchybarrc

diff --git a/sketchybar/.config/sketchybar/plugins/cpu.sh b/sketchybar/.config/sketchybar/plugins/cpu.sh
new file mode 100755 (executable)
index 0000000..3e34ecd
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+sketchybar --set "$NAME" label="$(top -l  2 | grep -E '^CPU' | tail -1 | awk '{ print $3 + $5"%" }')"
index 96738d7c29fdc3cc8f3816abd1b277dde1fbe337..61b7d205582d1339147105c3adc2c4b783c0324f 100755 (executable)
@@ -59,6 +59,8 @@ sketchybar --add item clock right \
            --subscribe volume volume_change \
            --add item battery right \
            --set battery update_freq=120 script="$PLUGIN_DIR/battery.sh" \
-           --subscribe battery system_woke power_source_change
+           --subscribe battery system_woke power_source_change \
+           --add item cpu right \
+           --set cpu update_freq=10 icon='' script="$PLUGIN_DIR/cpu.sh"
 
 sketchybar --update