<div dir="ltr"><div dir="ltr">Not by default; there's already a bug (<a href="https://github.com/xmonad/xmonad/issues/78">https://github.com/xmonad/xmonad/issues/78</a>) about our not obeying the ICCCM replace protocol unless started by replacing some other WM.<div><br></div><div>There's a few other places you can hide extra parameters; starting that early, the environment is probably the easiest to use, provided they're not too large (see why there's a state file now).</div></div></div><br><div class="gmail_quote"><div dir="ltr">On Wed, Nov 28, 2018 at 1:20 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">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 screen <br>
> but in reality just uses a large window).  I was wondering if I could <br>
> suspend or change some keybindings from a script that I can run 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 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 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 restart<br>
xmonad. I need to modify `XConfig` before calling 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 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) `--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><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>