sound and microphone toggle notification optimized

master
tiyn 1 year ago
parent 8fbffbc7c6
commit 7756ef5d6d

@ -1,11 +1,9 @@
#!/bin/sh #!/bin/sh
if amixer get Capture | tail -2 | grep -q '\[on\]'; then if amixer get Capture | tail -2 | grep -q '\[on\]'; then
notify-send -u low 'Audio' 'Sound active\nMicrophone muted'
paplay ~/.local/bin/tools/audio/mic_muted.wav paplay ~/.local/bin/tools/audio/mic_muted.wav
amixer set Master unmute >/dev/null 2>&1 amixer set Master unmute >/dev/null 2>&1
amixer set Capture nocap >/dev/null 2>&1 amixer set Capture nocap >/dev/null 2>&1
else else
notify-send -u low 'Audio' 'Sound active\nMicrophone active'
amixer set Master unmute >/dev/null 2>&1 amixer set Master unmute >/dev/null 2>&1
amixer set Capture cap >/dev/null 2>&1 amixer set Capture cap >/dev/null 2>&1
paplay ~/.local/bin/tools/audio/mic_activated.wav paplay ~/.local/bin/tools/audio/mic_activated.wav

@ -1,11 +1,9 @@
#!/bin/sh #!/bin/sh
if amixer get Master | tail -2 | grep -q '\[on\]'; then if amixer get Master | tail -2 | grep -q '\[on\]'; then
notify-send -u low 'sxhkd' 'Sound muted\nMicrophone muted' notify-send -u low 'sxhkd' 'Sound muted\nMicrophone muted'
paplay ~/.local/bin/tools/audio/sound_muted.wav
amixer set Master mute >/dev/null 2>&1 amixer set Master mute >/dev/null 2>&1
amixer set Capture nocap >/dev/null 2>&1 amixer set Capture nocap >/dev/null 2>&1
else else
notify-send -u low 'sxhkd' 'Sound active\nMicrophone muted'
amixer set Capture nocap >/dev/null 2>&1 amixer set Capture nocap >/dev/null 2>&1
amixer set Master unmute >/dev/null 2>&1 amixer set Master unmute >/dev/null 2>&1
paplay ~/.local/bin/tools/audio/sound_resumed.wav paplay ~/.local/bin/tools/audio/sound_resumed.wav

Loading…
Cancel
Save