~set_bar -> scripts/status/*

Decomposed the set_bar monolith script into seperate 'block' scripts
This commit is contained in:
dx
2020-06-06 19:31:36 +01:00
parent 852d280157
commit 45b80e8e67
7 changed files with 67 additions and 89 deletions

View File

@@ -0,0 +1,25 @@
#!/usr/bin/env bash
capacity=$(cat /sys/class/power_supply/BAT0/capacity) || break
status=$(cat /sys/class/power_supply/BAT0/status)
if [[ $status == "Charging" ]]
then
status=""
else
if [[ $capacity -ge 75 ]]
then
status=""
elif [[ $capacity -ge 50 ]]
then
status=""
elif [[ $capacity -ge 25 ]]
then
status=""
elif [[ $capacity -ge 10 ]]
then
status=""
else
status=""
fi
fi
echo "$status $capacity%"