fix #1260, more principled volume format
This commit is contained in:
parent
070c613050
commit
98ea4e0080
1 changed files with 3 additions and 2 deletions
|
@ -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…
Reference in a new issue