From 5d719984eb73daf3ddc55e1990ae2efff305cd14 Mon Sep 17 00:00:00 2001 From: Jeremiah Ticket Date: Thu, 24 Nov 2022 08:39:12 -0700 Subject: [PATCH] Added a mute-unmute script and binding to alt+mute key --- i38.sh | 1 + scripts/mute-unmute.sh | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 100755 scripts/mute-unmute.sh diff --git a/i38.sh b/i38.sh index 92b2c3b..02368b6 100755 --- a/i38.sh +++ b/i38.sh @@ -250,6 +250,7 @@ bindsym Mod1+Control+Delete exec --no-startup-id sgtk-bar # Use pactl to adjust volume in PulseAudio. bindsym Mod1+XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10% bindsym Mod1+XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10% +bindsym Mod1+XF86AudioMute exec --no-startup-id ${i3Path}/scripts/mute-unmute.sh # Music player controls # Requires playerctl. diff --git a/scripts/mute-unmute.sh b/scripts/mute-unmute.sh new file mode 100755 index 0000000..0aa6c26 --- /dev/null +++ b/scripts/mute-unmute.sh @@ -0,0 +1,8 @@ +#!/bin/bash +if [ $(pamixer --get-mute) = false ]; then +spd-say -Cw 'muting' +pamixer -t +else +pamixer -t +spd-say -Cw 'unmuted' +fi