Re: [dwm] Stats script

From: Andrius <warshke_AT_gmail.com>
Date: Sun, 3 May 2009 11:07:54 +0300

Hi, i'm using this one for my eee901:

$ cat .dwm.sh
#!/bin/sh

TEMP=$(awk '{print $2}' /proc/acpi/thermal_zone/TZ00/temperature)
LOAD=$(awk '{print $1}' /proc/loadavg)
DATE=$(date "+%D %T")

STATE=$(grep '^charging state:' /proc/acpi/battery/BAT0/state | awk '{print $NF}')
REMAINS=$(grep '^remaining capacity:' /proc/acpi/battery/BAT0/state | awk '{print $(NF-1)}')
RATE=$(grep '^present rate:' /proc/acpi/battery/BAT0/state | awk '{print $(NF-1)}')

MAH_MAX=$(grep '^last full capacity:' /proc/acpi/battery/BAT0/info | awk '{print $(NF-1)}')
MAH_MIN=$(grep '^design capacity warning:' /proc/acpi/battery/BAT0/info | awk '{print $(NF-1)}')

PERC_LEFT=$((${REMAINS}*100/${MAH_MAX}))

case $STATE in
        charging)
                if [[ $RATE -eq 0 ]]; then
                TIME_LEFT="∞"
                else
                TIME_LEFT=$(($((${MAH_MAX}-${REMAINS}))*60/$RATE))min
                fi
                ;;
        discharging)
                TIME_LEFT=$(($((${REMAINS}-${MAH_MIN}))*60/$RATE))min
                ;;
        charged)
                TIME_LEFT="full"
                ;;
        *)
                TIME_LEFT=$STATE
                ;;
esac

echo ${TIME_LEFT} $PERC_LEFT% $LOAD ${TEMP}*C $DATE

On Sat, 2 May 2009 23:30:23 -0400
Jake Todd <jaketodd422_AT_gmail.com> wrote:

> I was wondering what some other dwm users were using for stats like
> memory, temperature, et cetera. Right now I'm using this for
> termperature, memory, wifi, date:
Received on Sun May 03 2009 - 08:07:54 UTC

This archive was generated by hypermail 2.2.0 : Sun May 03 2009 - 08:12:04 UTC