about summary refs log tree commit diff
path: root/configs/shared
diff options
context:
space:
mode:
authorWilliam Carroll <wpcarro@gmail.com>2020-01-16T01·18+0000
committerWilliam Carroll <wpcarro@gmail.com>2020-01-17T10·56+0000
commitb20fe610a4c4f68ea008cb0631d30458a9f0c494 (patch)
treea01db0dc1cc14bc6e53fcc0c676723da77a6d8a3 /configs/shared
parent50f0bd3dadf253edb7a043589263f08b3a3b1f10 (diff)
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.
Diffstat (limited to 'configs/shared')
-rw-r--r--configs/shared/.emacs.d/wpc/display.el29
1 files changed, 29 insertions, 0 deletions
diff --git a/configs/shared/.emacs.d/wpc/display.el b/configs/shared/.emacs.d/wpc/display.el
index 4f2527b20cb6..8e5b89030325 100644
--- a/configs/shared/.emacs.d/wpc/display.el
+++ b/configs/shared/.emacs.d/wpc/display.el
@@ -58,10 +58,39 @@
    :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)
    "D0" #'display/disable-4k
    "D1" #'display/enable-4k))