summaryrefslogtreecommitdiffstats
path: root/.local/bin/status/sb-battery
diff options
context:
space:
mode:
authorJoe <rrbo@proton.me>2023-06-14 16:52:20 +0200
committerJoe <rrbo@proton.me>2023-06-14 16:52:20 +0200
commit676f8cf998a387045f79607b4bbbc34a5397f55e (patch)
tree77067c1261a57b4374430690b7db92ed70b16489 /.local/bin/status/sb-battery
parentup (diff)
downloaddotfiles-bsd-676f8cf998a387045f79607b4bbbc34a5397f55e.tar.gz
dotfiles-bsd-676f8cf998a387045f79607b4bbbc34a5397f55e.tar.bz2
dotfiles-bsd-676f8cf998a387045f79607b4bbbc34a5397f55e.tar.xz
dotfiles-bsd-676f8cf998a387045f79607b4bbbc34a5397f55e.tar.zst
dotfiles-bsd-676f8cf998a387045f79607b4bbbc34a5397f55e.zip
up
Diffstat (limited to '')
-rwxr-xr-x.local/bin/status/sb-battery13
1 files changed, 10 insertions, 3 deletions
diff --git a/.local/bin/status/sb-battery b/.local/bin/status/sb-battery
index 2110062..542fda7 100755
--- a/.local/bin/status/sb-battery
+++ b/.local/bin/status/sb-battery
@@ -1,10 +1,17 @@
#!/bin/sh
-status=$(apm -b)
+case $(hostname -s) in
+ mother) return ;;
+ po-rbo) [ $(cat /sys/class/power_supply/BAT0/status) = "Charging" ] && echo -n "ﮣ " ;;
+ mars) [ $(apm -b) -eq 3 ] && echo -n "ﮣ " ;;
+esac
-[ "$status" -eq 3 ] && echo "ﮣ "
+case $(hostname -s) in
+ po-rbo) charge=$(cat /sys/class/power_supply/BAT0/capacity) ;;
+ mars) charge=$(apm -l) ;;
+esac
-case $(echo $(apm -l) / 20 | bc) in
+case $(echo $charge / 20 | bc) in
"0") printf " ";;
"1") printf " ";;
"2") printf " ";;