summaryrefslogtreecommitdiffstats
path: root/.local/bin/status
diff options
context:
space:
mode:
authorJoe <rrbo@proton.me>2023-11-24 12:41:41 +0100
committerJoe <rrbo@proton.me>2023-11-24 12:41:41 +0100
commitfba57bb7e7cbc9d750b05f2d6292b742b7d3deb6 (patch)
tree8ec0f7f32548ff01aa51f57df452f211c56aedd6 /.local/bin/status
parentup (diff)
downloaddotfiles-bsd-fba57bb7e7cbc9d750b05f2d6292b742b7d3deb6.tar.gz
dotfiles-bsd-fba57bb7e7cbc9d750b05f2d6292b742b7d3deb6.tar.bz2
dotfiles-bsd-fba57bb7e7cbc9d750b05f2d6292b742b7d3deb6.tar.xz
dotfiles-bsd-fba57bb7e7cbc9d750b05f2d6292b742b7d3deb6.tar.zst
dotfiles-bsd-fba57bb7e7cbc9d750b05f2d6292b742b7d3deb6.zip
up
Diffstat (limited to '.local/bin/status')
-rwxr-xr-x.local/bin/status/sb-battery30
-rwxr-xr-x.local/bin/status/sb-cpu18
2 files changed, 26 insertions, 22 deletions
diff --git a/.local/bin/status/sb-battery b/.local/bin/status/sb-battery
index 8787bff..e2a23ef 100755
--- a/.local/bin/status/sb-battery
+++ b/.local/bin/status/sb-battery
@@ -2,20 +2,24 @@
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
-
-case $(hostname -s) in
- po-rbo) charge=$(cat /sys/class/power_supply/BAT0/capacity) ;;
- mars) charge=$(apm -l) ;;
+ po-rbo)
+ charge=$(cat /sys/class/power_supply/BAT0/capacity)
+ [ "$(cat /sys/class/power_supply/BAT0/status)" = "Charging" ] && printf "󱐋 "
+ [ "$(cat /sys/class/power_supply/BAT0/status)" = "Not charging" ] && printf "󱐋 "
+ ;;
+ mars)
+ charge=$(apm -l)
+ [ "$(apm -b)" -eq 3 ] && printf "󱐋 "
+ ;;
esac
case $(echo "$charge" / 20 | bc) in
- "0") printf " ";;
- "1") printf " ";;
- "2") printf " ";;
- "3") printf " ";;
- "4") printf " ";;
- "5") printf "ﮣ ";;
+ "0") printf " " ;;
+ "1") printf " " ;;
+ "2") printf " " ;;
+ "3") printf " " ;;
+ "4")
+ [ "$charge" -gt 94 ] && return
+ printf " "
+ ;;
esac
diff --git a/.local/bin/status/sb-cpu b/.local/bin/status/sb-cpu
index 169b24d..e85f422 100755
--- a/.local/bin/status/sb-cpu
+++ b/.local/bin/status/sb-cpu
@@ -22,14 +22,14 @@ case $(hostname -s) in
esac
case $(echo "$stats" | sed '{1,3d;s/% idle$//;s/.*[[:blank:]]//;s/\..*//;s/^/(100 - /;s/$/) \/ 12\.5/;}' | bc) in
- "0") printf "[ ]\n";;
- "1") printf "[= ]\n";;
- "2") printf "[== ]\n";;
- "3") printf "[=== ]\n";;
- "4") printf "[==== ]\n";;
- "5") printf "[===== ]\n";;
- "6") printf "[====== ]\n";;
- "7") printf "[======= ]\n";;
- "8") printf "[========]\n";;
+ "0") printf "[ ]\n" ;;
+ "1") printf "[= ]\n" ;;
+ "2") printf "[== ]\n" ;;
+ "3") printf "[=== ]\n" ;;
+ "4") printf "[==== ]\n" ;;
+ "5") printf "[===== ]\n" ;;
+ "6") printf "[====== ]\n" ;;
+ "7") printf "[======= ]\n" ;;
+ "8") printf "[========]\n" ;;
esac