Created
August 27, 2016 13:52
-
-
Save sjs7007/82e30b4564e8d15ee86979987bc77132 to your computer and use it in GitHub Desktop.
Get battery info.
This file contains 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
b0="$(upower -i /org/freedesktop/UPower/devices/battery_BAT0| grep -E "percentage" | awk '{print $2}' | sed 's/.$//')" | |
b1="$(upower -i /org/freedesktop/UPower/devices/battery_BAT1| grep -E "percentage" | awk '{print $2}' | sed 's/.$//')" | |
d1="$(date)" | |
d0="$(date | awk '{print $4}')" | |
echo "$b0, $b1, $d0, $d1" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment