diff options
author | 2023-01-08 10:28:25 -0500 | |
---|---|---|
committer | 2023-01-08 19:45:48 -0500 | |
commit | 20b58f4d603c55b1aba42cc375a97b8708f725ba (patch) | |
tree | f21be83d70898f0677bd221672ceabfb24cc4a63 /.emacs.d/lisp | |
parent | f16d6161c36570d525b48bb558e25625aca35854 (diff) | |
download | configs-20b58f4d603c55b1aba42cc375a97b8708f725ba.tar.gz configs-20b58f4d603c55b1aba42cc375a97b8708f725ba.tar.xz configs-20b58f4d603c55b1aba42cc375a97b8708f725ba.zip |
* .emacs.d/init.el: Show system volumes in mode-line.
Uses pamixer to get or set the output (speakers or headphones) and
input (microphone) volumes.
Diffstat (limited to '.emacs.d/lisp')
-rw-r--r-- | .emacs.d/lisp/bandali-exwm.el | 47 |
1 files changed, 40 insertions, 7 deletions
diff --git a/.emacs.d/lisp/bandali-exwm.el b/.emacs.d/lisp/bandali-exwm.el index 3072765..4cd2d1c 100644 --- a/.emacs.d/lisp/bandali-exwm.el +++ b/.emacs.d/lisp/bandali-exwm.el @@ -181,30 +181,63 @@ around if needed." ([?\s-\;] . (lambda () (interactive) (start-process-shell-command - "dmneu-pamixer" nil "dmenu-pamixer"))) + "dmneu-pamixer" nil "dmenu-pamixer") + (b/set-volume-level (b/get-volume-level)) + (force-mode-line-update))) ([XF86AudioMute] . ; borken on my X200 :-( (lambda () (interactive) - (start-process "" nil "pamixer" "--toggle-mute"))) + (start-process "" nil "pamixer" "--toggle-mute") + (b/set-volume-mute (b/get-volume-mute)) + (force-mode-line-update))) + ([\s-XF86AudioMute] . ; toggle mic mute + (lambda () + (interactive) + (start-process + "" nil "pamixer" "--default-source" "--toggle-mute") + (b/set-volume-mute (b/get-volume-mute 'mic) 'mic) + (force-mode-line-update))) ([XF86Launch1] . (lambda () (interactive) - (start-process "" nil "pamixer" "--toggle-mute"))) + (start-process "" nil "pamixer" "--toggle-mute") + (b/set-volume-mute (b/get-volume-mute)) + (force-mode-line-update))) ([\s-XF86Launch1] . ; toggle mic mute (lambda () (interactive) (start-process - "" nil "pamixer" "--default-source" "--toggle-mute"))) + "" nil "pamixer" "--default-source" "--toggle-mute") + (b/set-volume-mute (b/get-volume-mute 'mic) 'mic) + (force-mode-line-update))) ([XF86AudioLowerVolume] . (lambda () (interactive) (start-process - "" nil "pamixer" "--allow-boost" "--decrease" "5"))) + "" nil "pamixer" "--allow-boost" "--decrease" "5") + (b/set-volume-level (b/get-volume-level)) + (force-mode-line-update))) ([XF86AudioRaiseVolume] . (lambda () (interactive) (start-process - "" nil "pamixer" "--allow-boost" "--increase" "5"))) + "" nil "pamixer" "--allow-boost" "--increase" "5") + (b/set-volume-level (b/get-volume-level)) + (force-mode-line-update))) + ([\s-XF86AudioLowerVolume] . + (lambda () + (interactive) + (start-process + "" nil "pamixer" "--default-source" "--decrease" "5") + (b/set-volume-level (b/get-volume-level 'mic) 'mic) + (force-mode-line-update))) + ([\s-XF86AudioRaiseVolume] . + (lambda () + (interactive) + (start-process + "" nil "pamixer" "--default-source" "--increase" "5") + (b/set-volume-level (b/get-volume-level 'mic) 'mic) + (force-mode-line-update))) ([XF86AudioPlay] . (lambda () (interactive) @@ -319,7 +352,7 @@ around if needed." '((:eval (format " [%s]" (number-to-string - exwm-workspace-current-index))))))) + exwm-workspace-current-index))))))) (with-eval-after-load 'exwm-layout (setq exwm-layout-show-all-buffers t)) |