Support keybindings for using 4k monitor

I'm not sure I'm sold on the "D{0,1}" keybindings. The thought was that 0 would
indicate off and 1 would indicate on. This seems sensible to me. I'm hesitant
because I don't think I have precedent for this idiom in any of my existing
keybindings.

I'm also not sure I like these being leader-prefixed keybindings.
This commit is contained in:
William Carroll 2020-01-13 10:27:26 +00:00
parent 2515304c77
commit 88a315eee1

View file

@ -23,6 +23,9 @@
;; Constants ;; Constants
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defconst display/install-kbds? t
"When t, install the keybindings defined in this module.")
;; TODO: Consider if this logic should be conditioned by `device/work-laptop?'. ;; TODO: Consider if this logic should be conditioned by `device/work-laptop?'.
(defconst display/laptop-monitor "eDP1" (defconst display/laptop-monitor "eDP1"
"The xrandr identifier for my primary screen (on work laptop).") "The xrandr identifier for my primary screen (on work laptop).")
@ -53,5 +56,12 @@
:command (string/format "xrandr --output %s --off" :command (string/format "xrandr --output %s --off"
display/4k-monitor))) display/4k-monitor)))
(when display/install-kbds?
(general-define-key
:prefix "<SPC>"
:states '(normal)
"D0" #'display/disable-4k
"D1" #'display/enable-4k))
(provide 'display) (provide 'display)
;;; display.el ends here ;;; display.el ends here