Check out the final code here.
¶Customizing buffer name based on window title
(defun efs/exwm-update-title () (pcase exwm-class-name ("Firefox" (exwm-workspace-rename-buffer (format "Firefox: %s" exwm-title))))) ;; When window title updates, use it to set the buffer name (add-hook 'exwm-update-title-hook #'efs/exwm-update-title)
¶Configuring windows when they appear
Use the exwm-manage-finish-hook:
(defun efs/configure-window-by-class () (interactive) (message "Window '%s' appeared!" exwm-class)) ;; Configure windows as they're created (add-hook 'exwm-manage-finish-hook #'efs/configure-window-by-class)
¶Sending programs to specific workspaces
(pcase exwm-class-name ("Firefox" (exwm-workspace-move-window 2)) ("Sol" (exwm-workspace-move-window 3))))
¶Making windows float automatically
Use the exwm-floating-toggle-floating command (C-c C-t C-f)
("mpv" (exwm-floating-toggle-floating))
¶Hide the mode line
Use the exwm-layout-toggle-mode-line command (C-c C-t RET)
("mpv" (exwm-floating-toggle-floating)
(exwm-layout-toggle-mode-line))
¶Resizing a floating window
exwm-layout-enlarge-window[-horizontally]- Make a window larger by a number of pixelsexwm-layout-shrink-window[-horizontally]- Make a window smaller by a number of pixelsframe-pixel-width/frame-pixel-heightfunctions - get pixel width and height of the frame
¶Positioning a floating window
exwm-floating-move- Move a window based on a deltax-display-pixel-width/x-display-pixel-height- Get the width and height of the display
¶Automatically enter char-mode
- Use
exwm-resetto toggle back to line-mode (bound tos-rin our configuration) - Use
C-c C-k(exwm-input-release-keyboardto toggle back to char-mode)
¶Automatically move windows between workspaces
;; Automatically move EXWM buffer to current workspace when selected (setq exwm-layout-show-all-buffers t) ;; Display all EXWM buffers in every workspace buffer list (setq exwm-workspace-show-all-buffers t)
¶Automatically hiding the minibuffer
EXWM enables you to “detach” the minibuffer so that you can auto-hide it with exwm-workspace-toggle-minibuffer:
NOTE: You must restart EXWM for this to take effect!
;; Detach the minibuffer (show it with exwm-workspace-toggle-minibuffer) (setq exwm-workspace-minibuffer-position 'bottom)
¶Miscellaneous packages I mentioned:
- Dynamic tiling like xmonad or dwm using Edwina: https://github.com/ajgrf/edwina
- Hiding the mode line for all Emacs buffers: https://github.com/hlissner/emacs-hide-mode-line
- Showing mode line details in the mini buffer: https://github.com/kiennq/emacs-mini-modeline
- Showing Ivy commands in a centered frame: https://github.com/tumashu/ivy-posframe
