Mute toggle script.
This commit is contained in:
parent
0cfa89ded5
commit
ccf2a01944
@ -72,6 +72,8 @@ bindsym Shift+XF86MonBrightnessDown exec light -U 1
|
|||||||
bindsym Shift+XF86MonBrightnessUp exec light -A 1
|
bindsym Shift+XF86MonBrightnessUp exec light -A 1
|
||||||
])
|
])
|
||||||
|
|
||||||
|
bindsym Print exec ~/etc/toggle_mute.sh
|
||||||
|
|
||||||
# resize window (you can also use the mouse for that)
|
# resize window (you can also use the mouse for that)
|
||||||
mode "resize" {
|
mode "resize" {
|
||||||
# These bindings trigger as soon as you enter the resize mode
|
# These bindings trigger as soon as you enter the resize mode
|
||||||
|
15
toggle_mute.sh
Executable file
15
toggle_mute.sh
Executable file
@ -0,0 +1,15 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
if pacmd dump | grep -v monitor | grep -q '^set-source-mute .* no$'; then
|
||||||
|
mute=yes
|
||||||
|
else
|
||||||
|
mute=no
|
||||||
|
fi
|
||||||
|
|
||||||
|
pacmd dump | sed "/monitor/d;/^set-source-mute /!d;s/ \(no\|yes\)$/ $mute/" | pacmd
|
||||||
|
|
||||||
|
if [ "$mute" = "yes" ]; then
|
||||||
|
notify-send -u normal -t 1000 muted
|
||||||
|
else
|
||||||
|
notify-send -u critical -t 1000 UNMUTED
|
||||||
|
fi
|
Loading…
Reference in New Issue
Block a user