This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
spacemacs/layers/+window-management/exwm/README.org

92 lines
4.6 KiB
Org Mode
Raw Normal View History

#+TITLE: EXWM layer
Add Emacs Window Manager (EXWM) Layer AKA SpacemacsOS (#3321) * Add Emacs Window Manager (EXWM) Layer The time has come of SpacemacsOS * set window manager name to EXWM * update copyright notice * start server when EXWM is active When using EXWM, Emacs should be ready to receive clients but the final choice should be the user's in their shell configuration. * respect Spacemacs naming conventions and layer organization * leave keyboard remapping to users * add EXWM states for Evil * add support for helm-exwm when helm is in use * use both exwm-randr and exwm-systemtray * set up workspaces to match displays by default * use ido-config instead of the deprecated workaround When using helm-exwm, its sources distinguish title and class automatically. It is only necessary to keep the buffer name updated when the window title changes. When using ido, rename differently for different applications. * add bindings for common X keys * use standard prefix commands where available Spacemacs already has prefix commands for controlling windows. These are directly available in exwm-state as well as in exwm-insert-state through leader * remove most keybindings as they are available directly in exwm-state * enable exwm directly in the layer configuration It is safe to enable it here as an existing window manager will simply fail with a warning. * add user-configurable variables for RandR and workspaces By default, create as many workspaces as there are displays and assign them in RandR order. * fix naming convention for variables * use helm for launching applications when possible * fix conditional helm-exwm leader keys * remove redundant function EXWM provides the equivalent * conform to naming convention for Spacemacs * separate prefix commands into those for major mode and global * remove all default bindings * improve readability * clean up bindings * remove obsolete comments Co-authored-by: M. Domenzain <luis.domenzain@parrot.com>
2021-04-19 20:53:59 +00:00
#+TAGS: layer|tool
[[file:img/spacemacsOS.jpg]]
* Table of Contents :TOC_5_gh:noexport:
- [[#description][Description]]
- [[#features][Features:]]
- [[#install][Install]]
- [[#layer][Layer]]
- [[#note-about-display-managers][Note about Display Managers]]
- [[#not-having-display-managers][Not having Display Managers]]
- [[#osx][OSX]]
- [[#key-bindings][Key bindings]]
Add Emacs Window Manager (EXWM) Layer AKA SpacemacsOS (#3321) * Add Emacs Window Manager (EXWM) Layer The time has come of SpacemacsOS * set window manager name to EXWM * update copyright notice * start server when EXWM is active When using EXWM, Emacs should be ready to receive clients but the final choice should be the user's in their shell configuration. * respect Spacemacs naming conventions and layer organization * leave keyboard remapping to users * add EXWM states for Evil * add support for helm-exwm when helm is in use * use both exwm-randr and exwm-systemtray * set up workspaces to match displays by default * use ido-config instead of the deprecated workaround When using helm-exwm, its sources distinguish title and class automatically. It is only necessary to keep the buffer name updated when the window title changes. When using ido, rename differently for different applications. * add bindings for common X keys * use standard prefix commands where available Spacemacs already has prefix commands for controlling windows. These are directly available in exwm-state as well as in exwm-insert-state through leader * remove most keybindings as they are available directly in exwm-state * enable exwm directly in the layer configuration It is safe to enable it here as an existing window manager will simply fail with a warning. * add user-configurable variables for RandR and workspaces By default, create as many workspaces as there are displays and assign them in RandR order. * fix naming convention for variables * use helm for launching applications when possible * fix conditional helm-exwm leader keys * remove redundant function EXWM provides the equivalent * conform to naming convention for Spacemacs * separate prefix commands into those for major mode and global * remove all default bindings * improve readability * clean up bindings * remove obsolete comments Co-authored-by: M. Domenzain <luis.domenzain@parrot.com>
2021-04-19 20:53:59 +00:00
2021-04-23 13:52:28 +00:00
* Description
Add Emacs Window Manager (EXWM) Layer AKA SpacemacsOS (#3321) * Add Emacs Window Manager (EXWM) Layer The time has come of SpacemacsOS * set window manager name to EXWM * update copyright notice * start server when EXWM is active When using EXWM, Emacs should be ready to receive clients but the final choice should be the user's in their shell configuration. * respect Spacemacs naming conventions and layer organization * leave keyboard remapping to users * add EXWM states for Evil * add support for helm-exwm when helm is in use * use both exwm-randr and exwm-systemtray * set up workspaces to match displays by default * use ido-config instead of the deprecated workaround When using helm-exwm, its sources distinguish title and class automatically. It is only necessary to keep the buffer name updated when the window title changes. When using ido, rename differently for different applications. * add bindings for common X keys * use standard prefix commands where available Spacemacs already has prefix commands for controlling windows. These are directly available in exwm-state as well as in exwm-insert-state through leader * remove most keybindings as they are available directly in exwm-state * enable exwm directly in the layer configuration It is safe to enable it here as an existing window manager will simply fail with a warning. * add user-configurable variables for RandR and workspaces By default, create as many workspaces as there are displays and assign them in RandR order. * fix naming convention for variables * use helm for launching applications when possible * fix conditional helm-exwm leader keys * remove redundant function EXWM provides the equivalent * conform to naming convention for Spacemacs * separate prefix commands into those for major mode and global * remove all default bindings * improve readability * clean up bindings * remove obsolete comments Co-authored-by: M. Domenzain <luis.domenzain@parrot.com>
2021-04-19 20:53:59 +00:00
The time has arrived when one can finally use Emacs as a Window Manager, long
ago the concepts of *windows* and *frames* made so much sense when one was
working in a TTY, and basically that's all the window management you got. In
these *modern* times though, it sounds silly to have those names. But not
Anymore!
Thanks to @ch11ng and his [[https://github.com/ch11ng/exwm][EXWM]] project we can now use Emacs as our window
manager, and all those *windows* that didn't make sense before, now can not only
hold buffers, but X Windows, that means that you can spawn a Browser Window, or
your music player, or anything.
I urge you to read the [[https://github.com/ch11ng/exwm/wiki][EXWM Wiki]] for a more in depth explanation and if you can
contribute, please do so! The purpose of me making this layer is that I find it
awesome and having nice defaults would make more people dive into it and the
project would receive more attention and contributions which will only make it
more awesome, so if you try it and like it, share it!
** Features:
- Support for using Spacemacs as window manager
Add Emacs Window Manager (EXWM) Layer AKA SpacemacsOS (#3321) * Add Emacs Window Manager (EXWM) Layer The time has come of SpacemacsOS * set window manager name to EXWM * update copyright notice * start server when EXWM is active When using EXWM, Emacs should be ready to receive clients but the final choice should be the user's in their shell configuration. * respect Spacemacs naming conventions and layer organization * leave keyboard remapping to users * add EXWM states for Evil * add support for helm-exwm when helm is in use * use both exwm-randr and exwm-systemtray * set up workspaces to match displays by default * use ido-config instead of the deprecated workaround When using helm-exwm, its sources distinguish title and class automatically. It is only necessary to keep the buffer name updated when the window title changes. When using ido, rename differently for different applications. * add bindings for common X keys * use standard prefix commands where available Spacemacs already has prefix commands for controlling windows. These are directly available in exwm-state as well as in exwm-insert-state through leader * remove most keybindings as they are available directly in exwm-state * enable exwm directly in the layer configuration It is safe to enable it here as an existing window manager will simply fail with a warning. * add user-configurable variables for RandR and workspaces By default, create as many workspaces as there are displays and assign them in RandR order. * fix naming convention for variables * use helm for launching applications when possible * fix conditional helm-exwm leader keys * remove redundant function EXWM provides the equivalent * conform to naming convention for Spacemacs * separate prefix commands into those for major mode and global * remove all default bindings * improve readability * clean up bindings * remove obsolete comments Co-authored-by: M. Domenzain <luis.domenzain@parrot.com>
2021-04-19 20:53:59 +00:00
2021-04-23 13:59:07 +00:00
* Install
To use this configuration layer, add it to your =~/.spacemacs=. You will need to
add =exwm= to the existing =dotspacemacs-configuration-layers= list in this
file.
Add Emacs Window Manager (EXWM) Layer AKA SpacemacsOS (#3321) * Add Emacs Window Manager (EXWM) Layer The time has come of SpacemacsOS * set window manager name to EXWM * update copyright notice * start server when EXWM is active When using EXWM, Emacs should be ready to receive clients but the final choice should be the user's in their shell configuration. * respect Spacemacs naming conventions and layer organization * leave keyboard remapping to users * add EXWM states for Evil * add support for helm-exwm when helm is in use * use both exwm-randr and exwm-systemtray * set up workspaces to match displays by default * use ido-config instead of the deprecated workaround When using helm-exwm, its sources distinguish title and class automatically. It is only necessary to keep the buffer name updated when the window title changes. When using ido, rename differently for different applications. * add bindings for common X keys * use standard prefix commands where available Spacemacs already has prefix commands for controlling windows. These are directly available in exwm-state as well as in exwm-insert-state through leader * remove most keybindings as they are available directly in exwm-state * enable exwm directly in the layer configuration It is safe to enable it here as an existing window manager will simply fail with a warning. * add user-configurable variables for RandR and workspaces By default, create as many workspaces as there are displays and assign them in RandR order. * fix naming convention for variables * use helm for launching applications when possible * fix conditional helm-exwm leader keys * remove redundant function EXWM provides the equivalent * conform to naming convention for Spacemacs * separate prefix commands into those for major mode and global * remove all default bindings * improve readability * clean up bindings * remove obsolete comments Co-authored-by: M. Domenzain <luis.domenzain@parrot.com>
2021-04-19 20:53:59 +00:00
2021-04-23 13:59:07 +00:00
** Note about Display Managers
Add Emacs Window Manager (EXWM) Layer AKA SpacemacsOS (#3321) * Add Emacs Window Manager (EXWM) Layer The time has come of SpacemacsOS * set window manager name to EXWM * update copyright notice * start server when EXWM is active When using EXWM, Emacs should be ready to receive clients but the final choice should be the user's in their shell configuration. * respect Spacemacs naming conventions and layer organization * leave keyboard remapping to users * add EXWM states for Evil * add support for helm-exwm when helm is in use * use both exwm-randr and exwm-systemtray * set up workspaces to match displays by default * use ido-config instead of the deprecated workaround When using helm-exwm, its sources distinguish title and class automatically. It is only necessary to keep the buffer name updated when the window title changes. When using ido, rename differently for different applications. * add bindings for common X keys * use standard prefix commands where available Spacemacs already has prefix commands for controlling windows. These are directly available in exwm-state as well as in exwm-insert-state through leader * remove most keybindings as they are available directly in exwm-state * enable exwm directly in the layer configuration It is safe to enable it here as an existing window manager will simply fail with a warning. * add user-configurable variables for RandR and workspaces By default, create as many workspaces as there are displays and assign them in RandR order. * fix naming convention for variables * use helm for launching applications when possible * fix conditional helm-exwm leader keys * remove redundant function EXWM provides the equivalent * conform to naming convention for Spacemacs * separate prefix commands into those for major mode and global * remove all default bindings * improve readability * clean up bindings * remove obsolete comments Co-authored-by: M. Domenzain <luis.domenzain@parrot.com>
2021-04-19 20:53:59 +00:00
This is most common among Ubuntu and derivative users:
LightDM, GDM, and other Display managers that need a session file will need you
to copy the [[file:files/exwm.desktop][desktop file]] I bundled with this layer to
~/usr/local/xsessions/exwm.desktop~, that's what I used on my Ubuntu box, but
make sure the [[file:files/exwm-start][exwm-start script]] is in your PATH, you can put it in
~/usr/local/bin/exwm-start~ and that should be enough, next time you log out,
select the EXWM session instead of the Ubuntu one and you should be alright.
2021-04-23 13:59:07 +00:00
** Not having Display Managers
Add Emacs Window Manager (EXWM) Layer AKA SpacemacsOS (#3321) * Add Emacs Window Manager (EXWM) Layer The time has come of SpacemacsOS * set window manager name to EXWM * update copyright notice * start server when EXWM is active When using EXWM, Emacs should be ready to receive clients but the final choice should be the user's in their shell configuration. * respect Spacemacs naming conventions and layer organization * leave keyboard remapping to users * add EXWM states for Evil * add support for helm-exwm when helm is in use * use both exwm-randr and exwm-systemtray * set up workspaces to match displays by default * use ido-config instead of the deprecated workaround When using helm-exwm, its sources distinguish title and class automatically. It is only necessary to keep the buffer name updated when the window title changes. When using ido, rename differently for different applications. * add bindings for common X keys * use standard prefix commands where available Spacemacs already has prefix commands for controlling windows. These are directly available in exwm-state as well as in exwm-insert-state through leader * remove most keybindings as they are available directly in exwm-state * enable exwm directly in the layer configuration It is safe to enable it here as an existing window manager will simply fail with a warning. * add user-configurable variables for RandR and workspaces By default, create as many workspaces as there are displays and assign them in RandR order. * fix naming convention for variables * use helm for launching applications when possible * fix conditional helm-exwm leader keys * remove redundant function EXWM provides the equivalent * conform to naming convention for Spacemacs * separate prefix commands into those for major mode and global * remove all default bindings * improve readability * clean up bindings * remove obsolete comments Co-authored-by: M. Domenzain <luis.domenzain@parrot.com>
2021-04-19 20:53:59 +00:00
If you use Arch, Gentoo, or any other Linux, most probably you'll start your
configurations via a ~.xinitrc~ file, just append ~exwm-start~ to the end of
that file and you should be fine. I do recommend to check the [[https://github.com/ch11ng/exwm/wiki][EXWM Wiki]] for more
details.
2021-04-23 13:59:07 +00:00
** OSX
Add Emacs Window Manager (EXWM) Layer AKA SpacemacsOS (#3321) * Add Emacs Window Manager (EXWM) Layer The time has come of SpacemacsOS * set window manager name to EXWM * update copyright notice * start server when EXWM is active When using EXWM, Emacs should be ready to receive clients but the final choice should be the user's in their shell configuration. * respect Spacemacs naming conventions and layer organization * leave keyboard remapping to users * add EXWM states for Evil * add support for helm-exwm when helm is in use * use both exwm-randr and exwm-systemtray * set up workspaces to match displays by default * use ido-config instead of the deprecated workaround When using helm-exwm, its sources distinguish title and class automatically. It is only necessary to keep the buffer name updated when the window title changes. When using ido, rename differently for different applications. * add bindings for common X keys * use standard prefix commands where available Spacemacs already has prefix commands for controlling windows. These are directly available in exwm-state as well as in exwm-insert-state through leader * remove most keybindings as they are available directly in exwm-state * enable exwm directly in the layer configuration It is safe to enable it here as an existing window manager will simply fail with a warning. * add user-configurable variables for RandR and workspaces By default, create as many workspaces as there are displays and assign them in RandR order. * fix naming convention for variables * use helm for launching applications when possible * fix conditional helm-exwm leader keys * remove redundant function EXWM provides the equivalent * conform to naming convention for Spacemacs * separate prefix commands into those for major mode and global * remove all default bindings * improve readability * clean up bindings * remove obsolete comments Co-authored-by: M. Domenzain <luis.domenzain@parrot.com>
2021-04-19 20:53:59 +00:00
If you are an OSX user, please report back on whether this works with xQuartz,
always back up your data before attempting to try stuff like this.
2021-04-23 13:59:07 +00:00
* Key bindings
Add Emacs Window Manager (EXWM) Layer AKA SpacemacsOS (#3321) * Add Emacs Window Manager (EXWM) Layer The time has come of SpacemacsOS * set window manager name to EXWM * update copyright notice * start server when EXWM is active When using EXWM, Emacs should be ready to receive clients but the final choice should be the user's in their shell configuration. * respect Spacemacs naming conventions and layer organization * leave keyboard remapping to users * add EXWM states for Evil * add support for helm-exwm when helm is in use * use both exwm-randr and exwm-systemtray * set up workspaces to match displays by default * use ido-config instead of the deprecated workaround When using helm-exwm, its sources distinguish title and class automatically. It is only necessary to keep the buffer name updated when the window title changes. When using ido, rename differently for different applications. * add bindings for common X keys * use standard prefix commands where available Spacemacs already has prefix commands for controlling windows. These are directly available in exwm-state as well as in exwm-insert-state through leader * remove most keybindings as they are available directly in exwm-state * enable exwm directly in the layer configuration It is safe to enable it here as an existing window manager will simply fail with a warning. * add user-configurable variables for RandR and workspaces By default, create as many workspaces as there are displays and assign them in RandR order. * fix naming convention for variables * use helm for launching applications when possible * fix conditional helm-exwm leader keys * remove redundant function EXWM provides the equivalent * conform to naming convention for Spacemacs * separate prefix commands into those for major mode and global * remove all default bindings * improve readability * clean up bindings * remove obsolete comments Co-authored-by: M. Domenzain <luis.domenzain@parrot.com>
2021-04-19 20:53:59 +00:00
As other window managers the ~s~ or *Super* key (Windows Key) is the one that
is the prefix to every action. We'll use a lot of ~s~.
I have, for convenience, disabled the use of ~C-x~ and ~C-c~ in X windows,
mainly because that's something we could use for Cutting and Copying text, but if
you want you can enable it, this layer focuses on less Emacs-y bindings.
| Key Binding | Description |
|-----------------------+------------------------------------------------|
| ~C-q~ | Send next key pressed to the X window |
| ~C-'~ | Pop shell |
| ~C-g~ | Universal GetMeOuttaHere Key from Emacs |
| ~C-u~ | Universal Argument |
| ~C-[0-9]~ | Universal Prefix for [0-9] |
| ~M-m~ | Spacemacs Leader Key |
| ~s-[1 2 3 ... 8 9 0]~ | Switch to workspace [1 2 3 ... 8 9 10] |
| ~s-TAB~ | Switch to last workspace |
| ~s-w~ | Workspace Switch Menu (kinda like micro-state) |
| ~s-r~ | Reset window state |
| ~s-SPC~ | App Launcher |
| ~s-ESC~ | Lock Screen |
| ~s-:~ and ~s-;~ | Helm M-x (same as ~SCP :~) |
| ~s-u,U~ | Undo, Redo window configurations |
| ~s-b~ | Show all opened buffers |
| ~s-h,j,k,l~ | Switch to left,lower,upper,right window |
| ~s-H,J,K,L~ | Move window to far left,down,lower,upper,right |
| ~M-s-h,j,k,l~ | Resizing (try them, it's too hard to explain) |
| ~s-[,]~ | Switch to prev,next workspace |