feat(nixos): Map brightness keys to light command

This commit is contained in:
Vincent Ambo 2017-11-17 16:12:40 +01:00
parent 78f65fbc18
commit 051c111646

View file

@ -10,6 +10,14 @@
(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 brightness-up ()
(interactive)
(shell-command "exec light -A 10"))
(defun brightness-down ()
(interactive)
(shell-command "exec light -U 10"))
(if is-nixos (if is-nixos
(progn (progn
(message "Running on NixOS, configuring ExWM.") (message "Running on NixOS, configuring ExWM.")
@ -42,6 +50,10 @@
;; 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)
;; Brightness keys
(exwm-input-set-key (kbd "<XF86MonBrightnessDown>") #'brightness-down)
(exwm-input-set-key (kbd "<XF86MonBrightnessUp>") #'brightness-up)
;; Line-editing shortcuts ;; Line-editing shortcuts
(exwm-input-set-simulation-keys (exwm-input-set-simulation-keys
'(([?\C-d] . delete) '(([?\C-d] . delete)