-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Emacs Window Manager (EXWM) Layer AKA SpacemacsOS #3321
Conversation
@CestDiego Does it work on MacOS X? |
@zilongshanren I don't know. Someone will have to try it with x Quartz and also would only work with x widgets I guess... So there are not many uses I guess :( |
hahaha Awesome @CestDiego !! |
de3a9d3
to
d20a7f4
Compare
such a meme-loving f*ck! |
(defvar exwm--terminal-command "xterm" | ||
"Terminal command to run.") | ||
|
||
(defvar exwm--locking-command "lock" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think lock
makes sense as a default, but I don't know what would be a good default value.
I tried this out and I ran into some issues. First was that, xelb failed to install during first startup. The app launcher doesn't open helm until you hit The |
I agree.... but exwm essentially provides two input modes quite similar to vim's/spacemacs input and normal mode: char and line mode (borrowed from ansi-mode). Oversimplified, char mode = input mode and line mode = normal mode in that char mode sends all keys to the X window while line mode currently sends most key sequences to the X-window but also enables some Emacs keybindings. That's why I forked exwm and made exwm send all key sequences to Emacs in line mode, essentially behaving similar to normal mode. EDIT got it backwards, fixed it wrt line/char mode Now I am able to continue using SPC as my leader and all other Emacs keybindings and switch to input/char mode whenever I want to interact with my X-window/program. At first it was kinda tedious but with help from xcape I am now using the left and right Super key to switch between input/char and normal/line mode and it already feels like all the other editing done in vim/spacemacs.... I don't know if it makes sense and it would require a change within exwm but for me it's working just fine right now, preserving all features of spacemacs while adding the niceties of emacs being my WM :-) Unfortunately my elisp-fu is too weak to go beyond this shoddy hack.... |
@marcushg can you share the setup you have for your fork? I would totally try to implement it in Spacemacs. so that we have normal and insert mode in XWindows as well it sounds like a great choice. |
@CestDiego sure, but I am a little embarrassed how much of a hack it really is 😄 Actually I got it backwards in my comment above (I will correct it afterwards) -- it is the line mode that essentially sends some keys to the X-window but also binds some standard Emacs keys - and I modified it to not send any keys to the X-window, so it behaves more like normal mode in Spacemacs. It's essentially just this commit. |
I would love to know what @ch11ng thinks of having this separation though, I don't know if it will break stuff D: |
d20a7f4
to
f8d4ca6
Compare
so far @ch11ng has been very receptive and fast to respond to issues. I believe for someone more knowledgeable in elisp than myself it would be kind of trivial to either add a new mode (which would behave like normal mode, i.e. not sending any keys to the X-window) or make line mode configurable to achieve the same.... Then, to make it consistent with spacemacs, we would somehow need a way to integrate it with evil's input and normal mode switching, though I don't know if that would have any other side effects for the X-window buffer. |
I'm fine currently switching between windows with |
I truely believe you're comfortable with your setup, but I also believe we should stay in line with spacemacs philosophy and change as little as possible of its current workflow, i.e. use SPC as leader (or whatever you've configured in your .spacemacs personally) and make X-windows behave according to normal and input mode. By enabling this layer in its current form the we would change something that should remain user configurable (i.e. the evil leader key sequence). I think the key idea behind spacemacs and its success (besides evil mode and sane configurability) is its consistency and making it behave the same across different parts of emacs. EDIT that sounded way too negative ;-) I am certain we can make it work (with a little help from exwm) so that this great layer stays in tune with spacemacs philosophy! |
I forgot about the additional editing styles which make the matter (of sending keys to either the x-window or emacs) a bit more complicated?! |
@ch11ng suggested the following over at the exwm issue
Sounds like a reasonable approach to not have to modify exwm. Don't know though which keys besides the leader key we would have to add and we also would have to be careful about the selected editing style. |
but about the style, how would one then send the space key to an X Window? |
IIRC |
e621ce8
to
c0ee03f
Compare
I think this has many drawbacks now. For example having multiple workspaces makes Emacs too long in changing stuff and updating many things unbearably slow( See ch11ng/exwm#84 ) I will have to device a way that uses the |
There's also a https://github.com/flexibeast/ewmctrl |
cool, spacemacs + awesome/i3 |
Spacemacs OS
To clarify these commits, the idea is to have the corresponding modes of EXWM mapped to Evil states with their visual feedback. Most of the keybindings are removed and left instead to the user, with a few extra (documentation coming) variables that allow for fine-tuning with sane defaults. All comments are welcome. |
What stops merging? :) |
Manpower, and the never-ending stream of PRs...
…On 1/8/19 4:07 PM, Moritz wrote:
What stops merging? :)
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#3321 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABaMOey54MEcoFb5teEd6B2mEV9goMbks5vBQiegaJpZM4GMa4j>.
|
Remember -- nothing stops you from pulling these changes in and cherry-picking them. |
Anyone having any luck cherry-picking this to their personal spacemacs now? When I cherry-pick the commits on top of current spacemacs/master, I get an error regarding
Moreover, if at least one window is open and I try to I also tried checking out the CestDiego/SpacemacsOS branch directly. The Helm issue is gone, but the evil-related issues above still persist. Is there anyone currently using SpacemacsOS who could overcome these issues? Or is the project now abandoned? |
If any has managed to port this on top of latest master, I'm interested as well. |
Unlikely -- switch to develop -- it's actually stable.
…On 4/7/19 8:59 AM, zabbal wrote:
If any has managed to port this on top of latest master, I'm
interested as well.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#3321 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABaMApz2lzGJeo39FXmal41Ob7ZZX7Zks5veeupgaJpZM4GMa4j>.
|
I'm not sure what we should do here... |
https://github.com/timor/spacemacsOS seems to work happily on top of current develop in emacs 28, could it become a layer? |
I currently use exwm + spacemacs as my main workflow, across multiple architectures (arm, aarch64, arm64). Can't vouch for this particular layer, but I have - added a .desktop with a shell script which starts "emacs" using dbus-launch, added exwm and xelb to Very useful and would recommend 👍 |
A layer, please! |
Looks promising I will have a look in the next view days and see where we can integrate it. Thanks for keeping this alive and the posted test results. |
Thank you for contributing to spacemacs 💜, I have cherry picked your commit into develop. |
When reviewing another PR, I've found multiple serious issues of this PR. README.org is poorly written:
funcs.el is poorly written:
|
…14714) I'm not sure how best to start doing this, but the branch over at timor:spacemacsOS has moved ahead a bit. I've grown used to a lot of these changes, and would like to see them moved to the main develop branch. But, the pull request (formed by merging in CestDiego:spacemacs/SpacemacsOS in #3321) started diverging. Again, I'm not sure how to approach moving together these two changes. Maybe @timor can help somehow?? This at the least moves in some little things from Timor's branch: - Can enable exwm-systemtray with `exwm-enable-systray` - Can enable running XDG autostart applications (only in XDG_USER_HOME/autostart for now) with `exwm-autostart-xdg-applications` - Support for reading `.desktop` files and XDG autostart. - Can specify additional code appended to exwm-init hook with `exwm-custom-init` --- This PR also fixed some other existing issues, and improved documentation. Co-authored-by: timor <timor.dd@googlemail.com> Co-authored-by: Benjamin Yang <be11ng@users.noreply.github.com>
Most of that criticism is on point. Two things though:
|
Some issues are already fixed. |
* 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>
…yl20bnr#14714) I'm not sure how best to start doing this, but the branch over at timor:spacemacsOS has moved ahead a bit. I've grown used to a lot of these changes, and would like to see them moved to the main develop branch. But, the pull request (formed by merging in CestDiego:spacemacs/SpacemacsOS in syl20bnr#3321) started diverging. Again, I'm not sure how to approach moving together these two changes. Maybe @timor can help somehow?? This at the least moves in some little things from Timor's branch: - Can enable exwm-systemtray with `exwm-enable-systray` - Can enable running XDG autostart applications (only in XDG_USER_HOME/autostart for now) with `exwm-autostart-xdg-applications` - Support for reading `.desktop` files and XDG autostart. - Can specify additional code appended to exwm-init hook with `exwm-custom-init` --- This PR also fixed some other existing issues, and improved documentation. Co-authored-by: timor <timor.dd@googlemail.com> Co-authored-by: Benjamin Yang <be11ng@users.noreply.github.com>
It's Happening
SpacemacsOS
For those of you who want to use Spacemacs as your Operating System, this is the closest you'll ever be, by using Spacemacs to manage your windows.
Looks like this:
This is basically just part of the configuration found in the wiki page from EXWM project, it's great, currently one has to restart Spacemacs twice, because I can't make external dependencies install in a diferent order, @syl20bnr (I need XELB installed before EXWM) but that doesn't seem to work like that :(