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