On Sat, Mar 17, 2007 at 10:28:27AM +0100, Tube wrote:
> hi there,
>
> for anyone who might be interested - here is some code for displaying
> the remaining capacity for notebook users in the statusbar:
>
> export CAPACITY=`awk '/last/ { sum += $4 } END { print sum }'
> /proc/acpi/battery/BAT*/info`
> while true
> do
> echo `awk '/remaining/ { sum += $3 } END { print int (sum * 100 /
> ENVIRON["CAPACITY"] + .5) "%" }' /proc/acpi/battery/BAT*/state` `/bin/date
> '+%x %H:%M:%S'` `uptime | sed 's/.*://; s/,//g'`
> sleep 1
> done | dwm
I use `acpi -b`
Regards,
--
Anselm R. Garbe >< http://www.suckless.org/ >< GPG key: 0D73F361