mirror of
https://github.com/pestctrl/emacs-config.git
synced 2026-02-16 16:24:18 +00:00
Unwind-protect setup-screens
doesn't interrupt exwm startup if aborted
This commit is contained in:
parent
957375d1ae
commit
d65364e162
1 changed files with 13 additions and 13 deletions
|
|
@ -51,8 +51,7 @@
|
|||
(cl-sort (lambda (a b)
|
||||
(cond ((string-match-p "^eDP" a) t)
|
||||
((string-match-p "^eDP" b) nil)
|
||||
(t nil))))
|
||||
))
|
||||
(t nil))))))
|
||||
|
||||
(defun position-screen (screen relative-to)
|
||||
(interactive (cl-destructuring-bind (primary . secondary) (my/get-screens)
|
||||
|
|
@ -64,17 +63,18 @@
|
|||
|
||||
(defun my/setup-screens ()
|
||||
(interactive)
|
||||
(setq exwm-workspace-number (length (my/get-screens)))
|
||||
(let ((count 1))
|
||||
(cl-destructuring-bind (primary . secondaries) (my/get-screens)
|
||||
(loop for secondary in secondaries
|
||||
do (when (y-or-n-p (format "Monitor %s detected. Setup? " secondary))
|
||||
(position-screen secondary primary)
|
||||
(incf count))))
|
||||
(setup-workspace-monitors)
|
||||
(setup-wallpaper)
|
||||
(setq exwm-workspace-number count)
|
||||
(exwm-workspace-after-monitor-change)))
|
||||
(unwind-protect
|
||||
(let ((count 1))
|
||||
(setq exwm-workspace-number (length (my/get-screens)))
|
||||
(cl-destructuring-bind (primary . secondaries) (my/get-screens)
|
||||
(loop for secondary in secondaries
|
||||
do (when (y-or-n-p (format "Monitor %s detected. Setup? " secondary))
|
||||
(position-screen secondary primary)
|
||||
(incf count))))
|
||||
(setup-workspace-monitors)
|
||||
(setup-wallpaper)
|
||||
(setq exwm-workspace-number count)
|
||||
(exwm-workspace-after-monitor-change))))
|
||||
|
||||
(defun my/minimal-setup-screens ()
|
||||
(interactive)
|
||||
|
|
|
|||
Loading…
Reference in a new issue