cleanup: simplify case statement in `audio-notify`

regroup "criticity" cases
This commit is contained in:
swytch 2020-06-14 16:41:18 +02:00
parent da4e53bd27
commit 953041c4f8
1 changed files with 3 additions and 7 deletions

View File

@ -17,13 +17,9 @@ if [ "$muted" = "true" ]; then
dunstify -r 100002 "Sound muted" "$level%" dunstify -r 100002 "Sound muted" "$level%"
else else
case "$level" in case "$level" in
[0-9]) criticity="low" ;; [0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9]) criticity="low" ;;
1[0-9]|2[0-9]) criticity="low" ;; 6[0-9]|7[0-9]) criticity="normal" ;;
3[0-9]|4[0-9]) criticity="low" ;; 8[0-9]|9[0-9]|10[0-9]) criticity="critical" ;;
5[0-9]|6[0-9]) criticity="normal" ;;
7[0-9]) criticity="normal" ;;
8[0-9]|9[0-9]) criticity="critical" ;;
10[0-9]) criticity="critical" ;;
esac esac
dunstify -r 100002 -u "$criticity" "Current pamixer value :" "$level%" dunstify -r 100002 -u "$criticity" "Current pamixer value :" "$level%"