24 lines
376 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-13 15:07:01 +02:00
echo " mut" && exit 1
2020-05-09 21:26:23 +02:00
}
2020-05-13 15:07:01 +02:00
2020-05-09 21:26:23 +02:00
level=$(amixer sget Master | awk -F"[][]" '/dB/ { print $2 }')
revel="${level%?}"
v1=""
v2=""
v3=""
if [ "$revel" -lt 20 ]; then
2020-05-13 15:07:01 +02:00
echo "$v1"
2020-05-09 21:26:23 +02:00
elif [ "$revel" -lt 50 ]; then
2020-05-13 15:07:01 +02:00
echo "$v2"
2020-05-09 21:26:23 +02:00
elif [ "$revel" -lt 75 ]; then
2020-05-13 15:07:01 +02:00
echo "$v3"
2020-05-09 21:26:23 +02:00
fi
echo "$level"