From 25ce422abd8c7b2bd11a7906e3d155f83f53bacc Mon Sep 17 00:00:00 2001 From: William Carroll Date: Mon, 23 Dec 2019 10:56:38 +0000 Subject: [PATCH] Support microphone toggling Use pactl and exwm KBDs to support toggling my microphone setting from Emacs. --- configs/shared/.emacs.d/wpc/pulse-audio.el | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/configs/shared/.emacs.d/wpc/pulse-audio.el b/configs/shared/.emacs.d/wpc/pulse-audio.el index 7dff888e9..2a8418439 100644 --- a/configs/shared/.emacs.d/wpc/pulse-audio.el +++ b/configs/shared/.emacs.d/wpc/pulse-audio.el @@ -23,6 +23,12 @@ (shell-command "pactl set-sink-mute @DEFAULT_SINK@ toggle") (message (string/format "[pulse-audio.el] Mute toggled."))) +(defun pulse-audio/toggle-microphone () + "Mute the default sink." + (interactive) + (shell-command "pactl set-source-mute @DEFAULT_SOURCE@ toggle") + (message (string/format "[pulse-audio.el] Microphone toggled."))) + (defun pulse-audio/lower-volume () "Low the volume output of the default sink." (interactive) @@ -42,7 +48,9 @@ (exwm-input-set-key (kbd "") #'pulse-audio/lower-volume) (exwm-input-set-key - (kbd "") #'pulse-audio/raise-volume)) + (kbd "") #'pulse-audio/raise-volume) + (exwm-input-set-key + (kbd "") #'pulse-audio/toggle-microphone)) (provide 'pulse-audio) ;;; pulse-audio.el ends here