i3cpu.sh 209 B

12345678
  1. #!/bin/sh
  2. case $BLOCK_BUTTON in
  3. 1) notify-send "$(ps axch -o cmd:15,%cpu --sort=-%cpu | sed 11q)";;
  4. 2) ;;
  5. esac
  6. grep 'cpu ' /proc/stat | awk '{usage=($2+$4)*100/($2+$4+$5)} END {print " " usage "%"}'