battery status for screen

This commit is contained in:
Marcel Kapfer 2017-09-19 16:04:47 +02:00
parent 6f57137730
commit e325faf37d

12
scripts/screen-bat.sh Executable file
View file

@ -0,0 +1,12 @@
#!/bin/bash
level="$(upower -d | grep "percentage" | cut -d' ' -f15- | head -n 1)"
state="$(upower -d | grep "state" | cut -d' ' -f20- | head -n 1)"
case "$state" in
charging) statesym="↑" ;;
discharging) statesym="↓" ;;
* ) statesym="$state" ;;
esac
echo "$level $statesym"