Skip to content

Instantly share code, notes, and snippets.

@sjs7007
Created August 27, 2016 13:52
Show Gist options
  • Save sjs7007/82e30b4564e8d15ee86979987bc77132 to your computer and use it in GitHub Desktop.
Save sjs7007/82e30b4564e8d15ee86979987bc77132 to your computer and use it in GitHub Desktop.
Get battery info.
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