dotfiles/script/batinfo

12 lines
183 B
Plaintext
Raw Normal View History

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