battery status for screen

This commit is contained in:
Marcel Kapfer 2017-09-19 16:04:47 +02:00
parent 6f57137730
commit e325faf37d
1 changed files with 12 additions and 0 deletions

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"