4 # The date is printed to the status bar by default.
5 # To print the date through this script, set clock_enabled to 0
6 # in scrotwm.conf. Uncomment "print_date" below.
7 FORMAT="%a %b %d %R %Z %Y"
8 DATE=`date "+${FORMAT}"`
13 typeset -R4 _1=${1} _2=${2} _3=${3} _4=${4} _5=${5}
14 echo -n "CPU:${_1}% User${_2}% Nice${_3}% Sys${_4}% Int${_5}% Idle "
19 # iostat prints each column justified to 3 chars, so if one counter
20 # is 100, it jams up agains the preceeding one. sort this out.
21 while [ "${1}x" != "x" ]; do
22 if [ ${1} -gt 99 ]; then
23 OUT="$OUT ${1%100} 100"
37 if [ $AC_STATUS -ne 255 -o $BAT_STATUS -lt 4 ]; then
38 if [ $AC_STATUS -eq 0 ]; then
39 echo -n "on battery (${BAT_LEVEL}%)"
46 AC_STRING="on backup AC: "
54 BAT_STRING="(no battery)"
57 BAT_STRING="(battery ${BAT_LEVEL}%)"
60 BAT_STRING="(battery unknown)"
64 FULL="${AC_STRING}${BAT_STRING}"
65 if [ "$FULL" != "" ]; then
73 # instead of sleeping, use iostat as the update timer.
74 # cache the output of apm(8), no need to call that every second.
75 /usr/sbin/iostat -C -c 3600 |& # wish infinity was an option
79 if [ $(( ${I} % 59 )) -eq 0 ]; then
80 APM_DATA=`/usr/sbin/apm -alb`