6 # The date is printed to the status bar by default.
7 # To print the date through this script, set clock_enabled to 0
8 # in scrotwm.conf. Uncomment "print_date" below.
9 FORMAT="%a %b %d %R %Z %Y"
10 DATE=`date "+${FORMAT}"`
15 MEM=`/usr/bin/top | grep Free: | cut -d " " -f6`
16 echo -n "Free mem: $MEM "
20 typeset -R4 _1=${1} _2=${2} _3=${3} _4=${4} _5=${5}
21 echo -n "CPU:${_1}% User${_2}% Nice${_3}% Sys${_4}% Int${_5}% Idle "
26 # iostat prints each column justified to 3 chars, so if one counter
27 # is 100, it jams up agains the preceeding one. sort this out.
28 while [ "${1}x" != "x" ]; do
29 if [ ${1} -gt 99 ]; then
30 OUT="$OUT ${1%100} 100"
44 if [ $AC_STATUS -ne 255 -o $BAT_STATUS -lt 4 ]; then
45 if [ $AC_STATUS -eq 0 ]; then
46 echo -n "on battery (${BAT_LEVEL}%)"
53 AC_STRING="on backup AC: "
61 BAT_STRING="(no battery)"
64 BAT_STRING="(battery ${BAT_LEVEL}%)"
67 BAT_STRING="(battery unknown)"
71 FULL="${AC_STRING}${BAT_STRING}"
72 if [ "$FULL" != "" ]; then
80 CPU_SPEED=`/sbin/sysctl hw.cpuspeed | cut -d "=" -f2`
81 echo -n "CPU speed: $CPU_SPEED MHz "
85 # instead of sleeping, use iostat as the update timer.
86 # cache the output of apm(8), no need to call that every second.
87 /usr/sbin/iostat -C -c 3600 |& # wish infinity was an option
91 trap "kill $PID; exit" TERM
93 if [ $(( ${I} % 1 )) -eq 0 ]; then
94 APM_DATA=`/usr/sbin/apm -alb`