diff options
author | Joe <rrbo@proton.me> | 2023-06-14 16:52:20 +0200 |
---|---|---|
committer | Joe <rrbo@proton.me> | 2023-06-14 16:52:20 +0200 |
commit | 676f8cf998a387045f79607b4bbbc34a5397f55e (patch) | |
tree | 77067c1261a57b4374430690b7db92ed70b16489 /.local/bin/status/sb-battery | |
parent | up (diff) | |
download | dotfiles-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-battery | 13 |
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 " ";; |