X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=baraction.sh;h=61be49f5eb33e136ef13b1b637eee7ceb56b2b40;hb=2d53c59cc3444ac0223127b6861742e85fa33ce4;hp=b146d5bd59ebad80ba08c97002beae70771a7647;hpb=87ba936ecf99af5fa7c09eefd451cd1c5dad4614;p=spectrwm.git diff --git a/baraction.sh b/baraction.sh index b146d5b..61be49f 100644 --- a/baraction.sh +++ b/baraction.sh @@ -1,4 +1,8 @@ #!/bin/sh +# $scrotwm$ +print_cpu() { + echo -n "CPU: ${7}% User ${8}% Nice ${9}% Sys ${10}% Int ${11}% Idle " +} print_apm() { BAT_STATUS=$1 @@ -7,7 +11,7 @@ print_apm() { if [ $AC_STATUS -ne 255 -o $BAT_STATUS -lt 4 ]; then if [ $AC_STATUS -eq 0 ]; then - echo "on battery (${BAT_LEVEL}%)" + echo -n "on battery (${BAT_LEVEL}%)" else case $AC_STATUS in 1) @@ -34,13 +38,16 @@ print_apm() { FULL="${AC_STRING}${BAT_STRING}" if [ "$FULL" != "" ]; then - echo $FULL + echo -n "$FULL" fi fi fi } while :; do + # you probably want to reduce the sleep below if you enable this + #print_cpu `/usr/sbin/iostat -C` print_apm `/usr/sbin/apm -alb` + echo "" sleep 59 done