dotfiles/scripts/screen-bat.sh

13 lines
298 B
Bash
Raw Normal View History

2017-09-19 16:04:47 +02:00
#!/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"