dot_testing/simplestatus/power

12 lines
231 B
Plaintext
Raw Normal View History

2022-01-07 02:40:12 -06:00
#!/bin/sh
battery="sbs-20-000b"
perc=$(cat /sys/class/power_supply/$battery/capacity)
state=$(
cat /sys/class/power_supply/$battery/status | \
sed 's/Discharging/↓/g;s/Charging/↑/g'
)
printf "%s %s" "$perc" "$state"
exit