Support functions to toggling the display of the laptop

Since I already support toggling for the 4k monitor, I might as well support it
for my laptop too.
This commit is contained in:
William Carroll 2020-01-16 01:18:32 +00:00
parent 50f0bd3dad
commit b20fe610a4

View file

@ -58,7 +58,36 @@
:command (string/format "xrandr --output %s --off"
display/4k-monitor)))
(defun display/enable-laptop ()
"Turn the laptop monitor off.
Sometimes this is useful when I'm sharing my screen in a Google Hangout and I
only want to present one of my monitors."
(interactive)
(prelude/start-process
:name "display/disable-laptop"
:command (string/format "xrandr --output %s --auto"
display/laptop-monitor)))
(defun display/disable-laptop ()
"Turn the laptop monitor off.
Sometimes this is useful when I'm sharing my screen in a Google Hangout and I
only want to present one of my monitors."
(interactive)
(prelude/start-process
:name "display/disable-laptop"
:command (string/format "xrandr --output %s --off"
display/laptop-monitor)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Keybindings
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(when display/install-kbds?
(general-define-key
:prefix "<SPC>"
:states '(normal)
"d0" #'display/disable-laptop
"d1" #'display/enable-laptop)
(general-define-key
:prefix "<SPC>"
:states '(normal)