aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMountain Man <43313373+MountainMan1312@users.noreply.github.com>2023-07-25 21:23:45 -0400
committerMountain Man <43313373+MountainMan1312@users.noreply.github.com>2023-07-25 21:23:45 -0400
commita805b380305593ac1cfa6ddcac96c904770be0e5 (patch)
tree234b7619d5c562232fcd00808dc73144334d21ef
parentAdd keybinds to insert date and time without org formatting (diff)
downloadmmosmacs-a805b380305593ac1cfa6ddcac96c904770be0e5.tar.gz
mmosmacs-a805b380305593ac1cfa6ddcac96c904770be0e5.tar.bz2
mmosmacs-a805b380305593ac1cfa6ddcac96c904770be0e5.zip
Add functionality for named EXWM workspaces
-rw-r--r--init.el31
1 files changed, 27 insertions, 4 deletions
diff --git a/init.el b/init.el
index d8f8d9e..9d9ce1a 100644
--- a/init.el
+++ b/init.el
@@ -195,10 +195,33 @@
195 (start-process-shell-command 195 (start-process-shell-command
196 command nil command))) 196 command nil command)))
197 ;; Switch workspace with `s-w' 197 ;; Switch workspace with `s-w'
198 ([?\s-w] . exwm-workspace-switch))) 198 ([?\s-w] . exwm-workspace-switch))))
199 (exwm-enable)) 199
200 200;; Named workspaces
201 201(setq exwm-workspace-index-map (lambda (index)
202 (let ((named-workspaces ["0:Admin"
203 "1:Agenda"
204 "2:KB"
205 "3:IDE"]))
206 (if (< index (length named-workspaces))
207 (elt named-workspaces index)
208 (number-to-string index)))))
209
210(defun mm/exwm-workspace--update-ewmh-desktop-names ()
211 "Update the names of desktops in `exwm-workspace-index-map'."
212 (xcb:+request exwm--connection
213 (make-instance 'xcb:ewmh:set-_NET_DESKTOP_NAMES
214 :window exwm--root :data
215 (mapconcat (lambda (i) (funcall exwm-workspace-index-map i))
216 (number-sequence 0 (1- (exwm-workspace--count)))
217 "\0"))))
218
219(add-hook 'exwm-workspace-list-change-hook
220 #'mm/exwm-workspace--update-ewmh-desktop-names)
221
222;; Start EXWM
223(exwm-enable)
224(mm/exwm-workspace--update-ewmh-desktop-names)
202;; --------------------------------- 225;; ---------------------------------
203;; Temporary theme 226;; Temporary theme
204;; --------------- 227;; ---------------