Debug xrandr integration to support 4k monitor

Two things:
1. I'm unsure if what I previously committed ever worked because the arguments
to `string/format` were flipped.
2. I'm unsure why my screen devices are sometimes eDP-1 and eDP1.

Perhaps expect more commits as this becomes more clear to me.
This commit is contained in:
William Carroll 2020-01-11 20:01:57 +00:00
parent 5a1b869af3
commit fac128f00c
2 changed files with 13 additions and 9 deletions

View file

@ -24,10 +24,11 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; 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/primary "eDP-1" (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).")
(defconst display/4k "HDMI-1" ;; TODO: Why is HDMI-1, eDP-1 sometimes and HDMI1, eDP1 other times.
(defconst display/4k-monitor "HDMI1"
"The xrandr identifer for my 4K monitor.") "The xrandr identifer for my 4K monitor.")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@ -38,17 +39,19 @@
"Attempt to connect to my 4K monitor." "Attempt to connect to my 4K monitor."
(interactive) (interactive)
(prelude/start-process (prelude/start-process
:name "display" :name "display/enable-4k"
:command (string/format "xrandr --output %s --dpi 144 --auto --right-of %s" :command (string/format
display/4k "xrandr --output %s --above %s --primary --auto --dpi 144"
display/primary))) display/4k-monitor
display/laptop-monitor)))
(defun display/disable-4k () (defun display/disable-4k ()
"Disconnect from the 4K monitor." "Disconnect from the 4K monitor."
(interactive) (interactive)
(prelude/start-process (prelude/start-process
:name "display/disable-4k" :name "display/disable-4k"
:command (string/format "xrandr --output %s --off" display/4k))) :command (string/format "xrandr --output %s --off"
display/4k-monitor)))
(provide 'display) (provide 'display)
;;; display.el ends here ;;; display.el ends here

View file

@ -123,8 +123,9 @@
(exwm-randr-enable) (exwm-randr-enable)
;; TODO: Consider generating this plist. ;; TODO: Consider generating this plist.
;; TODO: Replace integer index values with their named workspace equivalents. ;; TODO: Replace integer index values with their named workspace equivalents.
(setq exwm-randr-workspace-monitor-plist (list 0 display/4k (setq exwm-randr-workspace-monitor-plist
1 display/primary)) (list 0 display/4k-monitor
1 display/laptop-monitor))
(evil-set-initial-state 'exwm-mode 'emacs) (evil-set-initial-state 'exwm-mode 'emacs)
(ido-mode 1) (ido-mode 1)