nixos/home/hyprland/ironbar/reference/scripts/battery
Evie Litherland-Smith be1d5fa798 Switch to minimal ironbar implementation
Save reference for later
Enable upower daemon and add simple bar with the essentials for now,
TODO more later
2023-10-11 08:28:27 +01:00

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