diff options
author | William Carroll <wpcarro@gmail.com> | 2019-12-23T10·56+0000 |
---|---|---|
committer | William Carroll <wpcarro@gmail.com> | 2020-01-06T15·25+0000 |
commit | 25ce422abd8c7b2bd11a7906e3d155f83f53bacc (patch) | |
tree | fe2586d4109dc4a162c52365a400bbdd2d4c5b74 /configs/shared/.emacs.d | |
parent | ba1034a9c85f395de2073c69ee3c1daec48ded47 (diff) |
Support microphone toggling
Use pactl and exwm KBDs to support toggling my microphone setting from Emacs.
Diffstat (limited to 'configs/shared/.emacs.d')
-rw-r--r-- | configs/shared/.emacs.d/wpc/pulse-audio.el | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/configs/shared/.emacs.d/wpc/pulse-audio.el b/configs/shared/.emacs.d/wpc/pulse-audio.el index 7dff888e98ea..2a8418439c5d 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 "<XF86AudioLowerVolume>") #'pulse-audio/lower-volume) (exwm-input-set-key - (kbd "<XF86AudioRaiseVolume>") #'pulse-audio/raise-volume)) + (kbd "<XF86AudioRaiseVolume>") #'pulse-audio/raise-volume) + (exwm-input-set-key + (kbd "<XF86AudioMicMute>") #'pulse-audio/toggle-microphone)) (provide 'pulse-audio) ;;; pulse-audio.el ends here |