dotfiles/sketchybar/plugins/cpu.sh

8 lines
153 B
Bash
Raw Normal View History

2023-11-18 19:56:03 +00:00
#!/bin/bash
cpu_percent=$(top -l 2 | grep -E "^CPU" | tail -1 | awk '{ print $3 + $5"%" }')
sketchybar --set $NAME icon=󰍛 label="${cpu_percent}"