Skip to content

Instantly share code, notes, and snippets.

@ldenman
Created January 14, 2012 16:58
Show Gist options
  • Save ldenman/1612034 to your computer and use it in GitHub Desktop.
Save ldenman/1612034 to your computer and use it in GitHub Desktop.
Record battery life
#!/bin/sh
printf "time\t\tpercent\n"
while :
do
PERCENT=`acpitool -B | grep "Remaining" | sed 's/,//g' | awk '{ print $5 }'`
TIME=`date +%s`
printf "%s\t%s\n" $TIME $PERCENT
sleep 1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment