Re: [dwm] Proper way of monitoring battery level in DWM

From: Albert Cardona <cardona_AT_ucla.edu>
Date: Sun, 16 Sep 2007 09:55:58 -0700

MAX_BATTERY_CAPACITY=84240
while true
do
        echo `date '+%Y%m%d %H:%M'` `uptime | sed 's/.*:
\(.\...\),.*/\1/'` $(( (`cat /proc/acpi/battery/BAT0/state | grep
"remaining capacity" | sed 's/.*: \{5,\}\(.*\) mWh/\1/'` * 100) /
$MAX_BATTERY_CAPACITY))"%"
        sleep 20
done | /home/albert/Programming/suckless/bin/dwm

Beware of email's silly line breaks.

-- 
Albert Cardona
http://www.mcdb.ucla.edu/Research/Hartenstein/acardona
Received on Sun Sep 16 2007 - 18:56:09 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 14:53:20 UTC