
Exwm – Emacs X Window Manager - rfreytag
https://github.com/ch11ng/exwm
======
nextos
I really like exwm but I currently prefer using StumpWM:
[https://stumpwm.github.io/](https://stumpwm.github.io/). If there was no
StumpWM I'd use Exwm.

Both have really similar designs, but for me StumpWM has a decisive advantage:
it's implemented in Common Lisp and doesn't run inside of Emacs. Still, it has
pretty good Emacs integration and many commands are Emacs-inspired. For
example, there's a winner-mode equivalent.

Since Emacs is not multi-threaded, if something inside Emacs freezes your
whole X session will become in blocked case you run Exwm. For the same reason,
it is a bit more responsive.

After a decade using XMonad, I switched to StumpWM after carefully test-
driving exwm and other options. I found I really prefer manual window tiling.
StumpWM is really underappreciated. It's the successor of ratpoison, which
kind of started the whole tiling window manager saga in Linux.

~~~
profsnuggles
I agree with you about preferring manual tiling, the worst thing about manual
tiling managers is that there are so few choices. EXWM is my favorite with
StumpWM a close second and i3 a distant 3rd.

I've been using EXWM for a few years now and the fact that emacs isn't multi-
threaded has caused me very little pain. It really isn't something to worry
about. I've had way more issues with StumpWM than I have ever had with EXWM.

I find it slightly amusing that you list Common Lisp as a plus for StumpWM. At
the time the gigamonkeys lisp book was published I was using StumpWM and had
some issues I wanted to fix (which still existed when I finally switched to
EXWM). Trying to learn Common Lisp exposed me to a community that is, to this
day, the absolutely most toxic I have ever experienced. For a decade lisp was
anathema to me until I discovered Clojure and from there realized that the
Scheme and other non Common Lisp communities are great.

~~~
int_19h
Speaking of tiling WMs in general - is there any tiling WM that can be
controlled entirely by mouse? I find that I have to do any sort of window
management rarely enough that shortcuts aren't worth learning, but I do like
tiled windows, so if there's something where you can e.g. lay things out by
dragging them around and having them snap etc would be much preferable.

~~~
profsnuggles
I'm pretty sure that KDE at least (no idea about gnome) has the same kind of
tiling feature that recent Windows version have where dragging a window to the
left/right/corners tiles it.

Before I discovered tiling window managers I used to use evilwm and later fvwm
customized to work the same as evilwm. Both of those window managers had
options to make windows snap to the screen edge or each others borders if
moved within so many pixels of each other. Maybe something like that would
work for you?

~~~
int_19h
Tiling in Windows isn't full featured - you can tile windows by dragging, yes,
but as soon as you resize them, you get disconnects. I want something where I
can e.g. snap two windows side by side, and then drag the divider between
them, such that it resizes _both_ windows.

------
emptysongglass
EXWM is great but one place it is in dire need of help is managing fullscreen
applications such as videogames. Right now, those windows are unmanaged,
meaning they don’t show up in your buffers. If you manage to leave the
unmanaged window to check something else, it is impossible to return and you
need to force kill the application in question.

It is a big big problem and one that has almost driven me to leave EXWM more
than once. The developer has stated this is intended behavior which is insane
to me.

~~~
molloy
I just started using exwm and was wondering about the cause of this, thanks
for sharing. There should really be a way to open unmanaged windows into their
own individual workspaces.

~~~
emptysongglass
The way to get around this, until (or if) this is ever fixed, is to first
switch to a different numbered workspace than your primary then open the
fullscreen app there. If you need to look something up without quitting the
app you can then just use whatever keyboard shortcut you’ve assigned to your
primary to switch.

~~~
aerique
I do the same for games in StumpWM: I just switch to an unused virtual
desktop.

I don't really see the issue once you're used to it.

------
snackematician
Is it possible for emacs-exwm to run within another window manager, so that I
use i3 as my main WM, but can also open X windows inside emacs?

Love emacs, but I hang/tweak/break it enough that I would be scared to use it
as my main WM. But it would be awesome to open R graphics inside it, a la
Rstudio.

~~~
shabble
back when I last looked, xnest[1] was the go-to for that sort of thing. It's
been the best part of a decade though, so YMMV.

[1]
[https://www.x.org/releases/X11R7.7/doc/man/man1/Xnest.1.xhtm...](https://www.x.org/releases/X11R7.7/doc/man/man1/Xnest.1.xhtml)

~~~
throwamay1241
I switched to Xephyr[1] for reasons I can't remember some time ago, iirc it
superseded xnest.

[1]
[https://en.wikipedia.org/wiki/Xephyr](https://en.wikipedia.org/wiki/Xephyr)

------
fovc
How much configuration/yak shaving is required to get this or StumpWM running?
I would love to set this up but am always afraid it will suck 3 days of my
time

~~~
mbrock
If your distribution packages StumpWM, it just works. I can use it very
happily with zero configuration, although I do change the font.

~~~
alalalahelp
What distro do you use?

~~~
nextos
I fixed the NixOS package, it works fine now.

The Arch AUR package is also fine.

Lastly, you can go the Quicklisp route (which is a Common Lisp package
manager, equivalent to pip or gem). That works fine too and is distribution
independent.

~~~
mbrock
Cool, I’ve been using StumpWM from an old Nixpkgs tree because it was broken
for some time, I guess I can upgrade it now!

------
platz
Why not just run a tiling wm like i3 and use emacs 'make-frame'.

~~~
mbrock
With EXWM, X windows are Emacs buffers and rendered inside of Emacs windows,
so you switch between X windows the same way you switch between Emacs buffers;
you use the same tiling system for both Emacs and other programs, so you don't
need an extra set of key bindings, etc. It's a very nice unification.

~~~
starpucks
Does emacs have a common leader key set up ? I’m new to emacs

~~~
sachdevap
It can, and a significant part of the community uses that setup including me.
You might be interested in checking 1\. Spacemacs -
[http://spacemacs.org/](http://spacemacs.org/): A config for emacs with
starter packs. They have a good collection of leader key and vim bindings. 2\.
evil mode and evil-leader - Well integrated standalone vim emulation and
leader key.

I personally started building into vim keybindings in emacs via spacemacs, and
then over time created my own config with the features I needed from spacemacs
(which is much more than just vim emulation).

PS: Should also mention
[https://github.com/noctuid/general.el](https://github.com/noctuid/general.el).
I don't use this one, but it is pretty popular too.

~~~
starpucks
Thanks! I hopped ship from vim to emacs recently precisely because my vim
setup was getting super bloated from adding hacky extensions to try to make it
like an IDE. Trying to set up an ide per language in vim is an exercise in
frustration.

I guess I made a good choice since emacs is able to integrate an x manager
(lol).

The issue for me is my tmux leader is Ctrl-f and my vim Ctrl-p uses ctrl-p..
ctrl-d and ctrl-u are used in vim for page up and down. And some other nice
Ctrlkeys are taken by vim as well. I will need to carry these key bindings
into emacs evil mode...

So Really running out of good leader keys I can use !

I started on evil-mode only. Heard about space macs but I wasn’t sure how well
it could work with emacs ide-packages such as SLIME for lisp (and I will want
to find emacs ides for Java, Js, Python, C, Cpp, ruby, Ocaml - any suggestions
here much appreciated as well)

~~~
swaroop
Also consider [https://spacevim.org/](https://spacevim.org/) (inspired by
Spacemacs)

~~~
platz
or, avoid spacemacs & spacevim, and just install evil-leader, evil-surround,
and evil-matchit. Emacs starts up faster in this case too.

~~~
iLemming
Recommendation to a former Vimmer who wants to try Emacs to avoid Spacemacs
IMO is irrational. Spacemacs and Doom-emacs are the best things to try.
Spacemacs is well documented, community supported and extremely popular among
former Vimmers. Trying to learn and configure Emacs from scratch usually does
the opposite effect - an overwhelmed person gives up and runs back to the
comfort of the familiar tool.

------
manjana
That is really cool!

I just recently started using i3wm but miss my some features from OpenBox,
this seems like it has some features of both i3wm and OpenBox.

But will it work well with dmenu/i3bar i wonder?

------
alalalahelp
Can someone explain to an emacs noob what this does exactly? And how it
differs from the window manager of Windows/Mac for example.

~~~
iLemming
read my comment above
[https://news.ycombinator.com/item?id=19141645](https://news.ycombinator.com/item?id=19141645)

------
gnulinux
Emacs is my favorite software (I do "basically" everything in emacs, except I
also use firefox) but how is exwm a ood idea? Emacs is single threaded... How
did they solve this problem?

~~~
MultusSalus
The answer is that they didn’t. If emacs freezes up, you just have to wait.

~~~
iLemming
In reality this almost never happens. Besides - it is so lightweight - killing
a session and starting a new one takes seconds.

~~~
gnulinux
Not sure what you mean? I don't use exwm but my emacs gets stuck e.g. when
tramp-mode is connecting to ssh. This is not a problem for tasks I use emacs
for, but if my entire OS gets stuck because I'm trying to connect a server,
I'd get annoyed.

~~~
tbe
Maybe it's less of an issue because your window manager doesn't need to
connect to ssh servers or even do any kind of heavy lifting.

------
b3n
What's the value of the dynamic workspace support being built in to EXWM,
rather than using one of the many packages which does something similar (e.g.
persp-mode.el)?

~~~
iLemming
I'm using Spacemacs and Layouts (they based on persp-mode). Either way -
multi-monitor setup is a pain, but that's IMO more like X11 problem. I rarely
use multiple monitors with my Linux machine though.

------
iambvk
It has as much impact on my workflows as Magit does. If you are an Emacs user
on Linux, you should give it a try.

~~~
fxfan
You have to tell us what you were using earlier?

Magit people usually compare with stock git.

~~~
iLemming
I can share my anecdotal experience. I've used IntelliJ for about 7 years. For
a long time I hesitated to switch to Emacs because IntelliJ has superb git
integration. I thought Emacs simply cannot deliver same kind of experience. Oh
boy - how wrong I was. Not only Magit turned out to be way more capable, but I
also learned so much more about Git internals. I had no idea about so many
things you can do with it. Most Git UIs are shallow and don't let you do
extremely advanced stuff, like they're afraid users will be overwhelmed and
perplexed. Magit doesn't lie to you, doesn't try to hide things.

I simply can't imagine my life without Magit, Org-mode and (EXWM on Linux).

------
iLemming
Let me try to explain what so awesome about this project and why I have chosen
it instead of other, more popular WMs. The function of a window manager like
managing windows to me is kind of secondary - more important is to have a
complete keyboard-driven workflow.

What this exactly means to me is the ability to manage as much possible with
keeping fingers on the "home row", ideally without having to touch mouse or
arrow keys at all. Is that achievable? Without having to introduce plethora of
different keybindings?

Yes, that's possible with modality. So for example: I want to be able to
control my music volume by pressing `j` and `k`. And move windows up and down
also by using `j` and `k`. And resize windows vertically, again, by `j` and
`k`. And move windows across multiple monitors, and resize font in my browser,
scroll up and down in my pdf viewer, etc. etc. Sounds crazy? Well, maybe. But
I promise you, once you get used to it - you wouldn't want to go back to your
ordinary, boring and complicated old way.

My main work machine is a Mac and fortunately for OSX there's an automation
tool called Hammerspoon. One day I wrote a nice config inspired by Spacemacs,
so for the lack of better ideas I called it Spacehammer. You can find it here:
[https://github.com/agzam/spacehammer](https://github.com/agzam/spacehammer).

To my surprise sadly there's nothing similar to Hammerspoon exists for Linux.
Initially I simply wanted something trivial: "how do I rebind
`Ctrl+Tab`/`Shift+Ctrl+Tab` to `Win+J`/`Win+K` so I can switch between tabs in
my browser more efficiently?". See? `j` and `k` again. Even something simple
like that turned out to be difficult to achieve. And AFAIK none of the popular
WMs let you do that sort of stuff. With the exception of StumpWM (formerly
known as RatPoison).

I wanted to try StumpWM but honestly I didn't give a heartfelt attempt to
actually use it. I am still skeptical and the main reason is - CommonLisp. It
is an amazing language but its popularity has declined drastically and at this
point it's pretty much "Latin" of PLs. Yes, it's cool to know it but
practicality of that knowledge might be a bit questionable. Learning whole new
language for the sake of configuring a window manager doesn't feel very
enticing to me. But at some point maybe I will give it a try.

Then I found EXWM. And almost immediately regretted not trying it out sooner.
It took a few days to configure it and next thing I know I wrote a plugin for
it: [https://github.com/agzam/exwm-edit](https://github.com/agzam/exwm-edit).
Yes, the project is still young and from time to time you stumble upon some
rare quirks. Multimonitor setup is a pain. It doesn't support "gaps" so
praised in other WMs - I personally don't care about aesthetics of my WM
though.

With EXWM everything simply becomes just a buffer in Emacs - your browser,
Slack, pdf-viewer, music player - you name it. Because everything goes through
Emacs you can create complex keybindings and "simulate" keypresses, for
example: you can make `Win+W` to act like `Ctrl+W` in your browser or any
other app (no context switching between Mac and Linux).

It is indeed an awesome project and if you are an avid Emacsen and seasoned
Linux user - I really encourage you to give it a try.

~~~
aerique
Your next to last paragraph might just have sold me on EXWM.

------
lbj
This looks just like AWesomeWM - Only more awesome!

------
JulianMorrison
Needs a text editor, though.

~~~
mbrock
With Exwm you can run KDevelop or whatever editor you like inside Emacs!

