[xmonad] alt q causes crash

Wirt Wolff wirtwolff at gmail.com
Wed Aug 19 17:54:34 EDT 2009


Excerpts from Daniel Goldin's message of Wed Aug 19 14:41:52 -0600 2009:

> ----------------------- snip --------------------------
> -- when I hit alt q, not only does nothing happen, but I lose all keyboard
> shortcuts....
> 
> I load from .xinitrc and had to set the path in this file to load xmonad from
> my ~/.cabal/bin directory. I have a feeling this has something to do with the
> problem.
> 
>           -- skipped
>         } `additionalKeys`
>         [ ((mod4Mask .|. shiftMask, xK_z), spawn "xscreensaver-command -lock")
>         , ((controlMask, xK_Print), spawn "sleep 0.2; scrot -s")
>         , ((0, xK_Print), spawn "scrot")
>         ]
> 
> ----------------------- snip --------------------------
> 

Since you don't have the path to xmonad executable in the environment
from which you start it, mod-q can't find xmonad to restart.

Check .xsession-errors for clues if you still have problems, but I
think the following should get you going:

Include in your display manager environment the path to ~/.cabal/bin,
or there are other ways to do it too, but a simple way is:

Use full path in keybindings.

-- Define at top level. Prepends cabal bin path to a string.
cbin = (++) "/home/daniel/.cabal/bin/"

main = do 
    -- skipped
   } `additionalKeys`
   [ ((mod4Mask .|. shiftMask, xK_z), spawn "xscreensaver-command -lock")
   , ((controlMask, xK_Print), spawn "sleep 0.2; scrot -s")
   , ((0, xK_Print), spawn "scrot")
     -- add new mod-q binding using full path <-----------------------
   , ((mod4Mask, xK_q), restart (cbin "xmonad") True)
     -- OR for darcs versions of xmonad
-- , ((mod4Mask, xK_q),
--      spawn $ cbin "xmonad --recompile; " ++ cbin "xmonad --restart") ]

Save these changes, and check that they compile by running
xmonad --recompile in a shell, (should give no errors.) Then with release
version of xmonad you will have to restart X (first time only) to use the
newly compiled xmonad. If you have darcs instead, then just run
xmonad --restart to use the new config.

-- 
wmw


More information about the xmonad mailing list