<div dir="ltr">Yes. More specifically, it's ultimately using the execve() syscall, via one of the wrappers which propagates the environment (which one depends on whether it's asked to do $PATH search or not).</div><br><div class="gmail_quote"><div dir="ltr">On Thu, Nov 29, 2018 at 4:07 PM Dmitriy Matrosov <<a href="mailto:sgf.dma@gmail.com">sgf.dma@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 11/29/2018 09:50 PM, Brandon Allbery wrote:<br>
> You were talking about restart, between the running xmonad and its <br>
> replacement via executeFile. There, you can use the environment. There <br>
> is no way to pass information between an invoked "xmonad --restart" and <br>
> the running xmonad.<br>
<br>
You mean, `executeFile` preserves environment? So, i may change it from <br>
running xmonad (by e.g. keybinding) and then restart it?<br>
<br>
> On Thu, Nov 29, 2018 at 6:01 AM Dmitriy Matrosov <<a href="mailto:sgf.dma@gmail.com" target="_blank">sgf.dma@gmail.com</a> <br>
> <mailto:<a href="mailto:sgf.dma@gmail.com" target="_blank">sgf.dma@gmail.com</a>>> wrote:<br>
> <br>
> <br>
> <br>
> On November 28, 2018 9:25:00 PM GMT+03:00, Brandon Allbery<br>
> <<a href="mailto:allbery.b@gmail.com" target="_blank">allbery.b@gmail.com</a> <mailto:<a href="mailto:allbery.b@gmail.com" target="_blank">allbery.b@gmail.com</a>>> wrote:<br>
> >Not by default; there's already a bug (<br>
> ><a href="https://github.com/xmonad/xmonad/issues/78" rel="noreferrer" target="_blank">https://github.com/xmonad/xmonad/issues/78</a>) about our not obeying the<br>
> >ICCCM<br>
> >replace protocol unless started by replacing some other WM.<br>
> ><br>
> >There's a few other places you can hide extra parameters; starting<br>
> that<br>
> >early, the environment is probably the easiest to use, provided<br>
> they're<br>
> >not<br>
> >too large (see why there's a state file now).<br>
> <br>
> Hm, i don't understand how to use environment. I need to pass<br>
> something to running xmonad process (to which i send<br>
> XMONAD_RESTART). As far as i know, i can't change environment of<br>
> another process..<br>
> <br>
> <br>
> >On Wed, Nov 28, 2018 at 1:20 PM Dmitriy Matrosov<br>
> <<a href="mailto:sgf.dma@gmail.com" target="_blank">sgf.dma@gmail.com</a> <mailto:<a href="mailto:sgf.dma@gmail.com" target="_blank">sgf.dma@gmail.com</a>>><br>
> >wrote:<br>
> ><br>
> >> Hi.<br>
> >><br>
> >> On 11/21/2018 09:49 PM, Eyal Erez wrote:<br>
> >> > Hi,<br>
> >> ><br>
> >> > I'm getting some collisions between my xmonad keybindings and an<br>
> >> > application I'm running (it's a game that is suppose to run full<br>
> >screen<br>
> >> > but in reality just uses a large window). I was wondering if I<br>
> >could<br>
> >> > suspend or change some keybindings from a script that I can run<br>
> >before<br>
> >> > the app launches and then restore later.<br>
> >> ><br>
> >> > Is this at all possible? Happy to entertain other options.<br>
> >><br>
> >> Here is proof of concept:<br>
> >><br>
> >><br>
> >> import XMonad<br>
> >> import XMonad.Hooks.EwmhDesktops<br>
> >><br>
> >> import System.Directory<br>
> >> import System.FilePath<br>
> >><br>
> >><br>
> >> main :: IO ()<br>
> >> main = do<br>
> >> let xcf = ewmh $ def<br>
> >> { modMask = mod4Mask<br>
> >> , handleExtraArgs = disableKeys<br>
> >> }<br>
> >> xmonad xcf<br>
> >><br>
> >> disableKeys :: [String] -> XConfig Layout -> IO (XConfig<br>
> >Layout)<br>
> >> disableKeys _ xcf = do<br>
> >> xd <- getXMonadDir<br>
> >> let disableFn = xd </> "disable_keys"<br>
> >> b <- doesFileExist disableFn<br>
> >> if b<br>
> >> then do<br>
> >> trace "Disabling all keys."<br>
> >> removeFile disableFn<br>
> >> return (xcf {keys = \_ -> mempty})<br>
> >> else return xcf<br>
> >><br>
> >><br>
> >> To disable all keys create file `~/.xmonad/disable_keys` and then<br>
> >> restart xmonad with `xmonad --restart`. All keys will be disabled<br>
> >> _and_ file deleted (to avoid locking yourself), thus next restart<br>
> >will<br>
> >> restore all keys back.<br>
> >><br>
> >> As far as i understand, xmonad grabs keys in `X.Main.launch` before<br>
> >> entering main loop. Thus, the one way to change key grab is to<br>
> >restart<br>
> >> xmonad. I need to modify `XConfig` before calling<br>
> X.Main.launch`, and<br>
> >> this may be done by `handleExtraArgs` (called in `launch'` in<br>
> >> `X.Main.xmonad`). Unfortunately, it seems, that xmonad does not<br>
> allow<br>
> >> to pass extra cmd arguments during restart (`X.Operations.restart`<br>
> >> always starts xmonad with name `xmonad` and no arguments). Also, i<br>
> >> can't use extensible state in `handleExtraArgs`, because it runs in<br>
> >> `IO` (`X` context is not yet built at that time). Thus, to pass<br>
> >> something to it, i may use either file or (probably)<br>
> `--replace`. The<br>
> >> above version uses file. And i have no luck with `--replace`: it<br>
> >> seems, `xmonad` can't replace itself?..<br>
> >> _______________________________________________<br>
> >> xmonad mailing list<br>
> >> <a href="mailto:xmonad@haskell.org" target="_blank">xmonad@haskell.org</a> <mailto:<a href="mailto:xmonad@haskell.org" target="_blank">xmonad@haskell.org</a>><br>
> >> <a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/xmonad" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/xmonad</a><br>
> >><br>
> _______________________________________________<br>
> xmonad mailing list<br>
> <a href="mailto:xmonad@haskell.org" target="_blank">xmonad@haskell.org</a> <mailto:<a href="mailto:xmonad@haskell.org" target="_blank">xmonad@haskell.org</a>><br>
> <a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/xmonad" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/xmonad</a><br>
> <br>
> <br>
> <br>
> -- <br>
> brandon s allbery kf8nh<br>
> <a href="mailto:allbery.b@gmail.com" target="_blank">allbery.b@gmail.com</a> <mailto:<a href="mailto:allbery.b@gmail.com" target="_blank">allbery.b@gmail.com</a>><br>
<br>
_______________________________________________<br>
xmonad mailing list<br>
<a href="mailto:xmonad@haskell.org" target="_blank">xmonad@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/xmonad" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/xmonad</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>brandon s allbery kf8nh</div><div><a href="mailto:allbery.b@gmail.com" target="_blank">allbery.b@gmail.com</a></div></div></div></div></div>