Re: [dwm] displaying things in the statusbar

From: Anselm R. Garbe <arg_AT_suckless.org>
Date: Sat, 17 Mar 2007 13:04:36 +0100

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
Received on Sat Mar 17 2007 - 13:04:36 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 14:39:26 UTC