1 2 3 4 5 6 7 8 9 10 11
#!/usr/bin/env dash # shellcheck source=/dev/null SHELL_LIBRARY_VERSION="2.1.1" . %SHELL_LIBRARY_PATH capacity="$(cat /sys/class/power_supply/BAT0/capacity)" status="$(cat /sys/class/power_supply/BAT0/status)" printf "%s%% (%s)\n" "$capacity" "$status" # vim: ft=sh