diff options
author | Mountain Man <43313373+MountainMan1312@users.noreply.github.com> | 2023-07-25 21:23:45 -0400 |
---|---|---|
committer | Mountain Man <43313373+MountainMan1312@users.noreply.github.com> | 2023-07-25 21:23:45 -0400 |
commit | a805b380305593ac1cfa6ddcac96c904770be0e5 (patch) | |
tree | 234b7619d5c562232fcd00808dc73144334d21ef /init.el | |
parent | Add keybinds to insert date and time without org formatting (diff) | |
download | mmosmacs-a805b380305593ac1cfa6ddcac96c904770be0e5.tar.gz mmosmacs-a805b380305593ac1cfa6ddcac96c904770be0e5.tar.bz2 mmosmacs-a805b380305593ac1cfa6ddcac96c904770be0e5.zip |
Add functionality for named EXWM workspaces
Diffstat (limited to 'init.el')
-rw-r--r-- | init.el | 31 |
1 files changed, 27 insertions, 4 deletions
@@ -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 | ;; --------------- |