feat(nixos): Configure pulseaudio volume keys
This commit is contained in:
parent
f18e578c4b
commit
06cf685a88
1 changed files with 17 additions and 2 deletions
|
@ -10,13 +10,23 @@
|
||||||
(s-contains?
|
(s-contains?
|
||||||
"NixOS" (if (f-file? os-f) (f-read os-f)))))
|
"NixOS" (if (f-file? os-f) (f-read os-f)))))
|
||||||
|
|
||||||
|
(defun pulseaudio-ctl (cmd)
|
||||||
|
(shell-command (concat "pulseaudio-ctl " cmd))
|
||||||
|
(message "Volume command: %s" cmd))
|
||||||
|
|
||||||
|
(defun volume-mute () (interactive) (pulseaudio-ctl "mute"))
|
||||||
|
(defun volume-up () (interactive) (pulseaudio-ctl "up"))
|
||||||
|
(defun volume-down () (interactive) (pulseaudio-ctl "down"))
|
||||||
|
|
||||||
(defun brightness-up ()
|
(defun brightness-up ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(shell-command "exec light -A 10"))
|
(shell-command "exec light -A 10")
|
||||||
|
(message "Brightness increased"))
|
||||||
|
|
||||||
(defun brightness-down ()
|
(defun brightness-down ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(shell-command "exec light -U 10"))
|
(shell-command "exec light -U 10")
|
||||||
|
(message "Brightness decreased"))
|
||||||
|
|
||||||
(defun lock-screen ()
|
(defun lock-screen ()
|
||||||
(interactive)
|
(interactive)
|
||||||
|
@ -54,6 +64,11 @@
|
||||||
;; Toggle between line-mode / char-mode
|
;; Toggle between line-mode / char-mode
|
||||||
(exwm-input-set-key (kbd "C-c C-t C-t") #'exwm-input-toggle-keyboard)
|
(exwm-input-set-key (kbd "C-c C-t C-t") #'exwm-input-toggle-keyboard)
|
||||||
|
|
||||||
|
;; Volume keys
|
||||||
|
(exwm-input-set-key (kbd "<XF86AudioMute>") #'volume-mute)
|
||||||
|
(exwm-input-set-key (kbd "<XF86AudioRaiseVolume>") #'volume-up)
|
||||||
|
(exwm-input-set-key (kbd "<XF86AudioLowerVolume>") #'volume-down)
|
||||||
|
|
||||||
;; Brightness keys
|
;; Brightness keys
|
||||||
(exwm-input-set-key (kbd "<XF86MonBrightnessDown>") #'brightness-down)
|
(exwm-input-set-key (kbd "<XF86MonBrightnessDown>") #'brightness-down)
|
||||||
(exwm-input-set-key (kbd "<XF86MonBrightnessUp>") #'brightness-up)
|
(exwm-input-set-key (kbd "<XF86MonBrightnessUp>") #'brightness-up)
|
||||||
|
|
Loading…
Reference in a new issue