mirror of
https://github.com/SqrtMinusOne/sqrtminusone.github.io.git
synced 2025-12-11 00:03:02 +03:00
feat(exwm): done
This commit is contained in:
parent
5058e36b42
commit
6c2deadadb
2 changed files with 48 additions and 2 deletions
|
|
@ -1,7 +1,7 @@
|
|||
+++
|
||||
title = "Using EXWM and perspective.el on multi-monitor setup"
|
||||
author = ["Pavel Korytov"]
|
||||
date = 2022-01-01
|
||||
date = 2022-01-03
|
||||
tags = ["emacs", "exwm"]
|
||||
draft = true
|
||||
+++
|
||||
|
|
@ -114,6 +114,31 @@ To pull this off for various Emacs apps, it is necessary to open the right EXWM
|
|||
`my-leader-def` is a [custom definer](https://github.com/noctuid/general.el#creating-new-key-definers). That way the defined keybinding opens [EMMS](https://www.gnu.org/software/emms/) in the workspace 0 in the perspective "EMMS". I have this for several other apps, like elfeed, notmuch, dired `$HOME` and so on.
|
||||
|
||||
|
||||
### Some workflow notes {#some-workflow-notes}
|
||||
|
||||
As I said above, using perspectives in EXWM makes a lot of sense. Because all the EXWM workspace share the same buffer list (sans X windows), and because Emacs becomes the central program (for instance, it can't be easily closed), it is only natural to split the buffer list.
|
||||
|
||||
Another aspect of using EXWM is that it becomes very easy to work with code on multiple monitors. While it may signify some issue with the code in question if such need arises, having that possibility is still handy and it's not something easily replicable on other tiling WMs. `perspective-exwm` also presents some features here, for instance, `M-x perspective-exwm-copy-to-workspace` can be used to copy the current perspective to the adjacent monitor.
|
||||
|
||||
Also, in my opinion, Emacs apps like [EMMS](https://www.gnu.org/software/emms/) and [elfeed](https://github.com/skeeto/elfeed) deserve to be on the same "level" as "proper" apps like a browser. On other tiling WMs, something like that can be done with Emacs daemon and multiple Emacs frames, but in EXWM this seems natural without much extra work.
|
||||
|
||||
As for switching between X windows and perspectives, I've ended up preferring having one perspective for all X windows in the workspace, at least if these windows are full-fledged apps. For instance, all my messengers go to the workspace 3 to the perspective "comms", and I switch between them with `M-x perspective-exwm-cycle-exwm-buffers-<forward|backward>`, bound to `s-[` and `s-]`. For switching perspectives, I've bound `s-,` and `s-.`:
|
||||
|
||||
```emacs-lisp
|
||||
(setq exwm-input-global-keys
|
||||
`(
|
||||
...
|
||||
;; Switch perspectives
|
||||
(,(kbd "s-,") . persp-prev)
|
||||
(,(kbd "s-.") . persp-next)
|
||||
|
||||
;; EXWM buffers
|
||||
(,(kbd "s-[") . perspective-exwm-cycle-exwm-buffers-backward)
|
||||
(,(kbd "s-]") . perspective-exwm-cycle-exwm-buffers-forward)
|
||||
...)
|
||||
```
|
||||
|
||||
|
||||
## Workspaces on multiple monitors {#workspaces-on-multiple-monitors}
|
||||
|
||||
Here, `exwm-randr` provides basic functionality for running EXWM on multiple monitors. For instance, with configuration like that:
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
#+HUGO_SECTION: posts
|
||||
#+HUGO_BASE_DIR: ../
|
||||
#+TITLE: Using EXWM and perspective.el on multi-monitor setup
|
||||
#+DATE: 2022-01-01
|
||||
#+DATE: 2022-01-03
|
||||
#+HUGO_TAGS: emacs
|
||||
#+HUGO_TAGS: exwm
|
||||
#+HUGO_DRAFT: true
|
||||
|
|
@ -99,6 +99,27 @@ To pull this off for various Emacs apps, it is necessary to open the right EXWM
|
|||
#+end_src
|
||||
|
||||
=my-leader-def= is a [[https://github.com/noctuid/general.el#creating-new-key-definers][custom definer]]. That way the defined keybinding opens [[https://www.gnu.org/software/emms/][EMMS]] in the workspace 0 in the perspective "EMMS". I have this for several other apps, like elfeed, notmuch, dired =$HOME= and so on.
|
||||
** Some workflow notes
|
||||
As I said above, using perspectives in EXWM makes a lot of sense. Because all the EXWM workspace share the same buffer list (sans X windows), and because Emacs becomes the central program (for instance, it can't be easily closed), it is only natural to split the buffer list.
|
||||
|
||||
Another aspect of using EXWM is that it becomes very easy to work with code on multiple monitors. While it may signify some issue with the code in question if such need arises, having that possibility is still handy and it's not something easily replicable on other tiling WMs. =perspective-exwm= also presents some features here, for instance, =M-x perspective-exwm-copy-to-workspace= can be used to copy the current perspective to the adjacent monitor.
|
||||
|
||||
Also, in my opinion, Emacs apps like [[https://www.gnu.org/software/emms/][EMMS]] and [[https://github.com/skeeto/elfeed][elfeed]] deserve to be on the same "level" as "proper" apps like a browser. On other tiling WMs, something like that can be done with Emacs daemon and multiple Emacs frames, but in EXWM this seems natural without much extra work.
|
||||
|
||||
As for switching between X windows and perspectives, I've ended up preferring having one perspective for all X windows in the workspace, at least if these windows are full-fledged apps. For instance, all my messengers go to the workspace 3 to the perspective "comms", and I switch between them with =M-x perspective-exwm-cycle-exwm-buffers-<forward|backward>=, bound to =s-[= and =s-]=. For switching perspectives, I've bound =s-,= and =s-.=:
|
||||
#+begin_src emacs-lisp :tangle no :noweb-ref exwm-keybindings
|
||||
(setq exwm-input-global-keys
|
||||
`(
|
||||
...
|
||||
;; Switch perspectives
|
||||
(,(kbd "s-,") . persp-prev)
|
||||
(,(kbd "s-.") . persp-next)
|
||||
|
||||
;; EXWM buffers
|
||||
(,(kbd "s-[") . perspective-exwm-cycle-exwm-buffers-backward)
|
||||
(,(kbd "s-]") . perspective-exwm-cycle-exwm-buffers-forward)
|
||||
...)
|
||||
#+end_src
|
||||
* Workspaces on multiple monitors
|
||||
Here, =exwm-randr= provides basic functionality for running EXWM on multiple monitors. For instance, with configuration like that:
|
||||
#+begin_src emacs-lisp :eval no
|
||||
Loading…
Add table
Reference in a new issue