2025-04-25 13:46:59 +02:00

16 lines
268 B
Bash
Executable File
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env bash
print_status() {
echo $(upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep percentage | sed 's/percentage://g') " "
}
print_status
if [ -z "$1" ] || [ "$1" -ne "once" ]; then
while sleep 1; do
print_status
done
fi