CARVIEW |
Navigation Menu
-
Notifications
You must be signed in to change notification settings - Fork 20
exwm-enable: Set environment variables and x-no-window-manager #104
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
Conversation
@Stebalien Which approach do you use to handle Emacs nesting? This is not my common setup, but nevertheless I sometimes like to start a nested Emacs instance and then I need to detect the outer EXWM. This also applies to scripts which want to detect the window manager. Maybe we can use a (quasi-)standardized variable for the active window manager, e.g., set |
0084785
to
fa7899f
Compare
fa7899f
to
75c3714
Compare
I don't use a nested setup but I do set an I set |
75c3714
to
89e5cb9
Compare
Which breakage do you expect? Do you have some references? |
Hmm, I looked a bit around and found some discussions:
So it seems that most window managers don't set this and leave the responsibility to the login or session script. Unfortunately this won't work for the purpose of detecting EXWM and determining if EXWM should be started or not, since for this to work the variable must be set inside Emacs itself. I think this leaves us no other choice than going with a custom variable, even if a little bit hackish? |
At this point, all I remember is a vague "it caused some problems". But that was a while ago and I didn't put any effort into resolving those issues (and I might just be misremembering the entire thing). So I'd just go for it. |
Technically it should be set by the login manager, but, IMO, setting it if it's not already set is also reasonable. |
Agree. However it won't work for the nested Emacs purpose then if it could also have been set already from outside. |
How so? If we change it from within Emacs, all Emacs sub-processes will inherit the new value. |
It is a hypothetical case, since the login manager doesn't set the variable yet to EXWM. But assume it would set XDG_CURRENT_DESKTOP=EXWM, then the following check wouldn't work in the init.el: (unless (equal "XDG_CURRENT_DESKTOP" "EXWM")
(exwm-enable)) The check is needed for the aformentioned nesting of Emacs instances. (I've added a commit to the master branch for now which only sets the |
Oh, I see. Yeah, that wouldn't work. Honestly, for that I'd just check the |
Ah... and that's set regardless, I thought that was only set in sub-shells. |
(getenv "INSIDE_EMACS") evaluates to nil. Nevertheless I originally had planned to set the INSIDE_EXWM environment variable in |
It evaluates to But |
I am still on 30, but there INSIDE_EMACS is only non-nil inside Eshell. In the scratch buffer it evaluates to nil. But anyway, I think this is not reliable enough. So let's just go with INSIDE_EXWM. |
* exwm.el (exwm-enable): Set environment variable INSIDE_EXWM such that EXWM can be detected inside nested Emacs sessions.
89e5cb9
to
0edc3d7
Compare
Oh, lol. That's my fault. I got annoyed at it only showing up in shells so I set it globally so I can detect emacs from all sub-processes. (my config is way too big at this point) |
Okay, I see. I still think INSIDE_EXWM is a good variable to have :) |
I use lxqt-session to start the window manager, and XDG_SESSION_DESKTOP is lxqt. |
Uh oh!
There was an error while loading. Please reload this page.