(setq vc-ignore-dir-regexp "")

(defun elmord-exwm-gen-workspace-output-plist (screeninfo)
  (let ((output (plist-get screeninfo :output))
        (workspaces (plist-get screeninfo :workspaces)))
    (cl-mapcan (lambda (ws) (list ws output)) workspaces)))

(defun elmord-exwm-set-workspace-font (screeninfo)
  (let ((frames (mapcar 'exwm-workspace--workspace-from-frame-or-index
                        (plist-get screeninfo :workspaces)))
        (font (plist-get screeninfo :font)))
    (set-frame-font font nil frames)))

(defvar elmord-exwm-monitor-setup
  '((:output "VGA-1" :workspaces (1 2 3 4 5) :font "Monospace-10.5")
    (:output "LVDS-1" :workspaces (6 7 8 9 0) :font "Monospace-11")))

(defun elmord-exwm-setup-monitors (&optional config)
  (when (not config)
    (setq config elmord-exwm-monitor-setup))
  (setq exwm-randr-workspace-output-plist
        (cl-mapcan #'elmord-exwm-gen-workspace-output-plist config))
  (mapc #'elmord-exwm-set-workspace-font config)
  (exwm-randr--refresh))

(add-hook 'exwm-randr-screen-change-hook 'elmord-exwm-setup-monitors)


;; (defun elmord-setup-vga-screen-font ()
;;   (interactive)
;;   (let ((frames
;;          (mapcar 'exwm-workspace--workspace-from-frame-or-index
;;                  '(1 2 3 4 5))))
;;     (set-frame-font "Monospace-10.5" nil frames)))

;; (add-hook 'exwm-manage-finish-hook 'elmord-setup-vga-screen-font)
