Evie Litherland-Smith
be1d5fa798
Save reference for later Enable upower daemon and add simple bar with the essentials for now, TODO more later
16 lines
265 B
Bash
Executable file
16 lines
265 B
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
BAT=$(ls /sys/class/power_supply | grep BAT | head -n 1)
|
|
|
|
battery() {
|
|
cat /sys/class/power_supply/${BAT}/capacity
|
|
}
|
|
battery_stat() {
|
|
cat /sys/class/power_supply/${BAT}/status
|
|
}
|
|
|
|
case "$1" in
|
|
--bat) battery ;;
|
|
--bat-st) battery_stat ;;
|
|
esac
|