Skip to content

Instantly share code, notes, and snippets.

@cedriczirtacic
Created November 14, 2013 00:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cedriczirtacic/7459317 to your computer and use it in GitHub Desktop.
Save cedriczirtacic/7459317 to your computer and use it in GitHub Desktop.
Quick way to get current battery status (tested on Fedora 18).
( cd /sys/class/power_supply/BAT1/ && perl -e "printf(\"%%%d\n\",(( "`cat charge_now`" / "`cat charge_full`" ) * 100));" )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment