feat: switch sound management to amixer
This commit is contained in:
parent
9b2d31f244
commit
145b19d82d
@ -3,7 +3,7 @@
|
||||
# System stuff
|
||||
|
||||
{F1, F2, F3}
|
||||
pamixer {--toggle-mute, --decrease 5, --increase 5}; refbar; audio_notify
|
||||
amixer --quiet set Master {toggle, 5%-, 5%+}; refbar; audio_notify
|
||||
|
||||
{F5, F6}
|
||||
sbacklight {dec,inc}
|
||||
|
@ -10,10 +10,10 @@
|
||||
######################################################################
|
||||
|
||||
|
||||
level=$(pamixer --get-volume)
|
||||
muted=$(pamixer --get-mute)
|
||||
level="$(amixer sget Master | awk -F "[][]" ' { printf "%s", $2 }' | awk -F "%" '{printf $1}')"
|
||||
muted="$(amixer sget Master | awk -F "[][]" '/%/ { printf "%4s", $4 }' | awk '{printf $1}')"
|
||||
|
||||
if [ "$muted" = "true" ]; then
|
||||
if [ "$muted" = "off" ]; then
|
||||
dunstify -r 100002 "Sound muted" "$level%"
|
||||
else
|
||||
case "$level" in
|
||||
|
@ -18,13 +18,13 @@ delim=" | " # Set the delimiter character.
|
||||
|
||||
status() { \
|
||||
# Get the volume of ALSA's master volume output.
|
||||
volume="$(pamixer --get-volume)"
|
||||
muted="$(pamixer --get-mute)"
|
||||
level="$(amixer sget Master | awk -F "[][]" ' { printf "%s", $2 }' | awk -F "%" '{printf $1}')"
|
||||
muted="$(amixer sget Master | awk -F "[][]" '/%/ { printf "%4s", $4 }' | awk '{printf $1}')"
|
||||
|
||||
if [ "$muted" = "true" ]; then
|
||||
printf " muted"
|
||||
if [ "$muted" = "off" ]; then
|
||||
printf " 婢 ---"
|
||||
else
|
||||
printf " 墳 %3d%%" $volume
|
||||
printf " 墳 %3d%%" $level
|
||||
fi
|
||||
|
||||
printf "$delim"
|
||||
|
Reference in New Issue
Block a user