24 lines
381 B
Plaintext
Raw Normal View History

2020-05-09 21:26:23 +02:00
#!/bin/sh
[ "$(amixer sget Master | awk 'NR==5 { print $6 }')" = "[off]" ] && {
2020-05-25 13:08:43 +02:00
echo " mut" && exit 1
2020-05-09 21:26:23 +02:00
}
2020-05-25 13:08:43 +02:00
2020-05-09 21:26:23 +02:00
level=$(amixer sget Master | awk -F"[][]" '/dB/ { print $2 }')
revel="${level%?}"
v1=""
v2=""
v3=""
2020-05-25 13:08:43 +02:00
if [ "$revel" -lt 35 ]; then
2021-01-18 15:22:42 +01:00
printf "$v1 "
2020-05-25 13:08:43 +02:00
elif [ "$revel" -lt 60 ]; then
2021-01-18 15:22:42 +01:00
printf "$v2 "
2020-05-25 13:08:43 +02:00
elif [ "$revel" -lt 100 ]; then
2021-01-18 15:22:42 +01:00
printf "$v3 "
2020-05-09 21:26:23 +02:00
fi
echo "$level"