feat: switch sound management to amixer

This commit is contained in:
David 2020-09-12 19:12:32 +02:00
parent 9b2d31f244
commit 145b19d82d
4 changed files with 10 additions and 10 deletions

View File

@ -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}

View File

@ -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

View File

@ -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"

View File

@ -7,7 +7,7 @@
xss-lock -- slock &
redshift &
dunst -follow mouse &
pamixer --set-volume 50 &
amixer set Master 50%
sbacklight set 3 &
bat_notify &
AC_notify &