Extend named-workspace struct to include display information
I want to couple my EXWM workspaces with monitors. E.g. - I'd like my "Chatter" workspace to prefer my `4k-vertical`. This change supports that. I also did a small amount of formatting, which I don't think belongs in a separate commit.
This commit is contained in:
parent
1a5b2ab3b0
commit
ce61987959
1 changed files with 14 additions and 15 deletions
|
@ -57,7 +57,7 @@
|
||||||
;; TODO: Support MRU cache of workspaces for easily switching back-and-forth
|
;; TODO: Support MRU cache of workspaces for easily switching back-and-forth
|
||||||
;; between workspaces.
|
;; between workspaces.
|
||||||
|
|
||||||
(cl-defstruct window-manager--named-workspace label kbd)
|
(cl-defstruct window-manager--named-workspace label kbd display)
|
||||||
|
|
||||||
(defconst window-manager--install-kbds? t
|
(defconst window-manager--install-kbds? t
|
||||||
"When t, install the keybindings to switch between named-workspaces.")
|
"When t, install the keybindings to switch between named-workspaces.")
|
||||||
|
@ -68,16 +68,20 @@
|
||||||
(defconst window-manager--named-workspaces
|
(defconst window-manager--named-workspaces
|
||||||
(list (make-window-manager--named-workspace
|
(list (make-window-manager--named-workspace
|
||||||
:label "Web surfing"
|
:label "Web surfing"
|
||||||
:kbd "c")
|
:kbd "c"
|
||||||
|
:display display-4k-horizontal)
|
||||||
(make-window-manager--named-workspace
|
(make-window-manager--named-workspace
|
||||||
:label "Briefcase"
|
:label "Briefcase"
|
||||||
:kbd "d")
|
:kbd "d"
|
||||||
|
:display display-4k-horizontal)
|
||||||
(make-window-manager--named-workspace
|
(make-window-manager--named-workspace
|
||||||
:label "Todos"
|
:label "Todos"
|
||||||
:kbd "o")
|
:kbd "o"
|
||||||
|
:display display-4k-horizontal)
|
||||||
(make-window-manager--named-workspace
|
(make-window-manager--named-workspace
|
||||||
:label "Chatter"
|
:label "Chatter"
|
||||||
:kbd "h"))
|
:kbd "h"
|
||||||
|
:display display-4k-vertical))
|
||||||
"List of `window-manager--named-workspace' structs.")
|
"List of `window-manager--named-workspace' structs.")
|
||||||
|
|
||||||
;; Assert that no two workspaces share KBDs.
|
;; Assert that no two workspaces share KBDs.
|
||||||
|
@ -102,10 +106,10 @@
|
||||||
(require 'exwm-randr)
|
(require 'exwm-randr)
|
||||||
(exwm-randr-enable)
|
(exwm-randr-enable)
|
||||||
(setq exwm-randr-workspace-monitor-plist
|
(setq exwm-randr-workspace-monitor-plist
|
||||||
(list 0 display-4k-horizontal
|
(->> window-manager--named-workspaces
|
||||||
1 display-laptop
|
(-map-indexed (lambda (i x)
|
||||||
2 display-4k-vertical))
|
(list i (window-manager--named-workspace-display x))))
|
||||||
|
-flatten))
|
||||||
(evil-set-initial-state 'exwm-mode 'emacs)
|
(evil-set-initial-state 'exwm-mode 'emacs)
|
||||||
(setq exwm-workspace-number
|
(setq exwm-workspace-number
|
||||||
(list-length window-manager--named-workspaces))
|
(list-length window-manager--named-workspaces))
|
||||||
|
@ -113,7 +117,6 @@
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;; Window sizing
|
;; Window sizing
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
(:key "C-M-=" :fn balance-windows)
|
(:key "C-M-=" :fn balance-windows)
|
||||||
;; TODO: Make sure these don't interfere with LISP KBDs.
|
;; TODO: Make sure these don't interfere with LISP KBDs.
|
||||||
(:key "C-M-j" :fn shrink-window)
|
(:key "C-M-j" :fn shrink-window)
|
||||||
|
@ -124,7 +127,6 @@
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;; Window traversing
|
;; Window traversing
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
(:key "M-h" :fn windmove-left)
|
(:key "M-h" :fn windmove-left)
|
||||||
(:key "M-j" :fn windmove-down)
|
(:key "M-j" :fn windmove-down)
|
||||||
(:key "M-k" :fn windmove-up)
|
(:key "M-k" :fn windmove-up)
|
||||||
|
@ -133,20 +135,17 @@
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;; Window splitting
|
;; Window splitting
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
(:key "M-\\" :fn evil-window-vsplit)
|
(:key "M-\\" :fn evil-window-vsplit)
|
||||||
(:key "M--" :fn evil-window-split)
|
(:key "M--" :fn evil-window-split)
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;; Window deletion
|
;; Window deletion
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
(:key "M-q" :fn delete-window)
|
(:key "M-q" :fn delete-window)
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;; Miscellaneous
|
;; Miscellaneous
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
(:key "M-:" :fn eval-expression)
|
(:key "M-:" :fn eval-expression)
|
||||||
(:key "M-SPC" :fn ivy-helpers-run-external-command)
|
(:key "M-SPC" :fn ivy-helpers-run-external-command)
|
||||||
(:key "M-x" :fn counsel-M-x)
|
(:key "M-x" :fn counsel-M-x)
|
||||||
|
@ -158,8 +157,8 @@
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;; Workspaces
|
;; Workspaces
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
(:key ,(kbd-raw 'workspace "l") :fn window-manager-logout))))
|
(:key ,(kbd-raw 'workspace "l") :fn window-manager-logout))))
|
||||||
|
|
||||||
(setq exwm-input-global-keys
|
(setq exwm-input-global-keys
|
||||||
(->> kbds
|
(->> kbds
|
||||||
(-map (lambda (plist)
|
(-map (lambda (plist)
|
||||||
|
|
Loading…
Reference in a new issue