dotfiles/script/batinfo
2023-10-07 10:43:32 +02:00

12 lines
183 B
Bash
Executable File

#!/usr/bin/env bash
#
# Print battery percentage to stdout
set -e
if [ "$(uname -s)" = "Darwin" ]; then
echo "" # TODO
else # Linux
cat /sys/class/power_supply/BAT0/capacity
fi