dotfiles/scripts/battery.sh
2021-12-09 20:20:02 +01:00

6 lines
204 B
Bash
Executable file

#!/bin/bash
percent=$(cat /sys/class/power_supply/BAT0/capacity)
charging=$(cat /sys/class/power_supply/BAT0/status | grep "^C")
[ -z "$charging" ] && status=" " || status="*"
echo $percent"% [$status]"