about summary refs log tree commit diff stats
path: root/hm/soispha/pkgs/scripts/wrappers/battery.sh
diff options
context:
space:
mode:
authorSoispha <soispha@vhack.eu>2024-02-20 20:05:55 +0100
committerSoispha <soispha@vhack.eu>2024-02-20 20:05:55 +0100
commit954ff9af2d869189969cee92e750d601eaf8a930 (patch)
treed32cec0e9f807656d10133637b67f9b86fd0f81c /hm/soispha/pkgs/scripts/wrappers/battery.sh
parentchore(version): v1.29.0 (diff)
downloadnixos-config-954ff9af2d869189969cee92e750d601eaf8a930.zip
feat(hm/pkgs/battery): Init
Diffstat (limited to '')
-rwxr-xr-xhm/soispha/pkgs/scripts/wrappers/battery.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/hm/soispha/pkgs/scripts/wrappers/battery.sh b/hm/soispha/pkgs/scripts/wrappers/battery.sh
new file mode 100755
index 00000000..b2446ac3
--- /dev/null
+++ b/hm/soispha/pkgs/scripts/wrappers/battery.sh
@@ -0,0 +1,11 @@
+#!/usr/bin/env dash
+
+# shellcheck source=/dev/null
+SHELL_LIBRARY_VERSION="2.0.13" . %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