summaryrefslogtreecommitdiff
path: root/emacs/site-lisp/exwm-pref.el
diff options
context:
space:
mode:
authorThomas Ulmer <thomasmulmer02@gmail.com>2025-04-13 14:41:15 -0700
committerThomas Ulmer <thomasmulmer02@gmail.com>2025-04-13 14:41:15 -0700
commitae2bf0a9162084af6e32df20258ed689a24048bc (patch)
tree242a37ef087ce37f5d80abd88e04febfe8bb8f93 /emacs/site-lisp/exwm-pref.el
parentafc8816016987374b40ecd527d0c95d9923ce54f (diff)
various bits to make it more plug-n-play
Diffstat (limited to 'emacs/site-lisp/exwm-pref.el')
-rw-r--r--emacs/site-lisp/exwm-pref.el29
1 files changed, 27 insertions, 2 deletions
diff --git a/emacs/site-lisp/exwm-pref.el b/emacs/site-lisp/exwm-pref.el
index c6d51d1..816ebb7 100644
--- a/emacs/site-lisp/exwm-pref.el
+++ b/emacs/site-lisp/exwm-pref.el
@@ -8,8 +8,33 @@
(require 'exwm-systemtray)
(require 'exwm-manage)
-(setq exwm-workspace-number 2)
-(setq exwm-randr-workspace-monitor-plist '(0 "DP-0" 1 "HDMI-0"))
+(let ((buf (generate-new-buffer "*xrandr-output*"))
+ (out-plist nil))
+ (call-process-shell-command "xrandr --listmonitors -q" nil buf nil)
+ (with-current-buffer buf
+ (keep-lines "[^[:word:]]connected" (point-min) (point-max) nil)
+ (message (buffer-substring (point-min) (point-max)))
+ (let ((num-monitors (count-lines (point-min) (point-max)))
+ (i 0))
+ (setq exwm-workspace-number num-monitors)
+ (goto-char (point-min))
+ (while (< i num-monitors)
+ (message "iter")
+ (move-beginning-of-line 1)
+ (push-mark)
+ (search-forward-regexp " ")
+ (backward-char)
+ (message (buffer-substring (mark) (point)))
+ (push (buffer-substring (mark) (point)) out-plist)
+ (push i out-plist)
+ (setq i (+ i 1))
+ (pop-mark)
+ (next-line))))
+ (kill-buffer buf)
+ (setq exwm-randr-workspace-monitor-plist out-plist))
+
+;; (setq exwm-workspace-number 2)
+;; (setq exwm-randr-workspace-monitor-plist '(0 "DP-0" 1 "HDMI-0"))
(setq exwm-workspace-show-all-buffers t)
(setq exwm-layout-show-all-buffers t)