about summary refs log tree commit diff stats
path: root/sys/nixpkgs/pkgs/scripts/source/wrappers/battery.sh
blob: e650ba5dbe4d506c5ddd9aa19da16d92b3f24b77 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
#!/usr/bin/env dash

# shellcheck source=/dev/null
SHELL_LIBRARY_VERSION="2.1.2" . %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