mirror of
https://github.com/LukeSmithxyz/voidrice.git
synced 2025-10-07 07:22:36 +02:00
fix #1260, more principled volume format
This commit is contained in:
parent
070c613050
commit
98ea4e0080
@ -19,14 +19,15 @@ vol="$(wpctl get-volume @DEFAULT_AUDIO_SINK@)"
|
||||
[ "$vol" != "${vol%\[MUTED\]}" ] && echo 🔇 && exit
|
||||
|
||||
vol="${vol#Volume: }"
|
||||
|
||||
split() {
|
||||
# For ommiting the . without calling and external program.
|
||||
IFS=$2
|
||||
set -- $1
|
||||
printf '%s' "$@"
|
||||
}
|
||||
vol="$(split "$vol" ".")"
|
||||
vol="${vol##0}"
|
||||
|
||||
vol="$(printf "%.0f" "$(split "$vol" ".")")"
|
||||
|
||||
case 1 in
|
||||
$((vol >= 70)) ) icon="🔊" ;;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user