SketchyBar/plugins/cpu_sys.sh
2021-08-13 23:55:43 +02:00

8 lines
240 B
Bash
Executable file

#!/usr/bin/env bash
CORE_COUNT=$(sysctl -n machdep.cpu.thread_count)
CPU_SYS=$(ps -eo pcpu,user | grep -v $(whoami) | sed "s/[^ 0-9\.]//g" | awk "{sum+=\$1} END {print sum/(100.0 * $CORE_COUNT)}")
sketchybar -m push cpu_sys 0 $CPU_SYS