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