minor uplifts
This commit is contained in:
parent
5d74d499e1
commit
8aa99de402
@ -6,9 +6,9 @@ readarray -t batteries < <(upower -e | grep 'BAT')
|
|||||||
|
|
||||||
allstate=""
|
allstate=""
|
||||||
|
|
||||||
for battery in ${batteries[@]}
|
for battery in "${batteries[@]}"
|
||||||
do
|
do
|
||||||
current=$(($current + $(upower -i "$battery" | grep -E "percentage" | sed 's/.*://' | sed 's/ *//' | sed 's/\%//')))
|
current=$(("$current" + $(upower -i "$battery" | grep -E "percentage" | sed 's/.*://' | sed 's/ *//' | sed 's/\%//')))
|
||||||
state=$(upower -i "$battery" | grep -E "state" | sed 's/.*://' | sed 's/ *//')
|
state=$(upower -i "$battery" | grep -E "state" | sed 's/.*://' | sed 's/ *//')
|
||||||
|
|
||||||
allstate=$allstate$state
|
allstate=$allstate$state
|
||||||
@ -18,7 +18,7 @@ if [[ "$allstate" == *"discharging"* ]]; then
|
|||||||
state="discharging"
|
state="discharging"
|
||||||
elif [[ "$allstate" == *"charging"* ]]; then
|
elif [[ "$allstate" == *"charging"* ]]; then
|
||||||
state="charging"
|
state="charging"
|
||||||
elif [[ "$allstate" == "not-chargingnot-charging" || "$allstate" == "fully-chargedfully-charged" ]]; then
|
elif [[ "$allstate" == "not-chargingnot-charging" || "$allstate" == "fully-chargedfully-charged" || "$allstate" == "not-charging" || "$allstate" == "fully-charged" ]]; then
|
||||||
state="full"
|
state="full"
|
||||||
else
|
else
|
||||||
state="N/A"
|
state="N/A"
|
||||||
|
|||||||
@ -33,7 +33,7 @@ case $state in
|
|||||||
not-charging)
|
not-charging)
|
||||||
icon=" "
|
icon=" "
|
||||||
;;
|
;;
|
||||||
fully-charged)
|
fully-charged|full)
|
||||||
icon=" "
|
icon=" "
|
||||||
status="Full"
|
status="Full"
|
||||||
;;
|
;;
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
vol="$(wpctl get-volume @DEFAULT_AUDIO_SINK@)"
|
vol="$(wpctl get-volume @DEFAULT_AUDIO_SINK@)"
|
||||||
|
|
||||||
# If muted, print 🔇 and exit.
|
# If muted, print 🔇 and exit.
|
||||||
[ "$vol" != "${vol%\[MUTED\]}" ] && echo && exit
|
[ "$vol" != "${vol%\[MUTED\]}" ] && echo " " && exit
|
||||||
|
|
||||||
vol="${vol#Volume: }"
|
vol="${vol#Volume: }"
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user