bins

handy scripts
git clone git://popovic.xyz/bins.git
Log | Files | Refs | LICENSE

bar-cpu (353B)


      1 #!/bin/zsh
      2 
      3 usage=$(top -bn1 | grep "Cpu(s)" | sed "s/.*, *\([0-9.]*\)%* id.*/\1/" | awk '{printf "%1.0f%",100 - $1}')
      4 temp=$(cat /sys/devices/virtual/thermal/thermal_zone*/temp | awk '{s+=$1} END {printf "%0.f\n" , s/(3*1000)}')
      5 
      6 echo ":$usage $temp°"
      7 
      8 case $BLOCK_BUTTON in
      9 	1) "$TERMINAL" -e htop ;;
     10 	6) "$TERMINAL" -e "$EDITOR" "$0" ;;
     11 esac
     12 
     13 
     14 
     15