Created
April 14, 2015 16:30
-
-
Save ZimbiX/29a718613304013b8b6e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Returns the number of Watts at which the battery is charging or discharging, to one decimal place | |
rate=`upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep 'energy-rate:[ ]*[0-9\.]* W' | grep -o '[0-9\.]*'` | |
printf "%0.1f\n" $rate |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment