dotfiles/script/batinfo

12 lines
191 B
Plaintext
Raw Normal View History

2023-05-31 04:52:57 +00:00
#!/usr/bin/env bash
#
# Print battery percentage to stdout
set -e
if [ $(uname -s) = "Darwin" ]; then
echo "" # TODO
else # Linux
2023-06-08 21:19:01 +00:00
echo "$(cat /sys/class/power_supply/BAT0/capacity)"
2023-05-31 04:52:57 +00:00
fi