XMonad: dmenu not launching/spawning on startup

核能气质少年 提交于 2019-12-05 06:51:26

I have a vague feeling that when you first launch xmonad, it uses one executable+configuration, and then when you recompile, it finds the "right" one. In xmonad.desktop, try changing the Exec= line to include a full path to your xmonad.start.

Exec=/full/path/to/xmonad.start

Or you might try changing the last line in xmonad.start to include the full path to your xmonad executable.

dbus-launch --exit-with-session /full/path/to/xmonad

Another thing to try is changing the last two lines to:

exec xmonad
#dbus-launch --exit-with-session xmonad

If any of these options change the behaviour you're seeing, that might give us a clue.


EDIT: Let's try a different way of launching it, to see if we can learn anything. Don't start any window manager, log into a plain terminal instead. Type the command xinit -- xmonad or xinit -- /full/path/to/xmonad.

Alternatively, create the file .xinitrc with one line in it:

xmonad

Then type the command startx.

I also found this on the Xmonad FAQ, which may help:

2.6 not found errors or changes to xmonad.hs won't take effect

Ensure that ghc, and the xmonad executable are both in the environment PATH from which you start X. Alternatively symlink them to locations already in the PATH. ghc-pkg list should show ghc, xmonad, X11, etc. without brackets, e.g. {xmonad} is bad. ghc-pkg check will tell you if you have inconsistent dependencies or other registration problems.

The mod-q action calls the xmonad binary to recompile itself, so if your display manager is starting it with /path/to/xmonad you'll also have to edit your xmonad.hs mod-q binding to use the full path and restart X (or in newer versions use 'xmonad --restart') to restart xmonad with the new mod-q full path binding.

UPDATE:

The fix that seems to have solved the problem is changing:

exec xmonad

To:

touch ~/.xmonad/xmonad.hs
exec xmonad

in

/usr/local/bin/xmonad.start (or .xinitrc/.xsession if xmonad is started using startx)

OLD:

How about changing:

} `additionalKeys`
 [ ((mod4Mask .|. shiftMask, xK_l), spawn "gnome-screensaver-command --lock") ]

To:

} `additionalKeys`
  [ ((mod4Mask .|. shiftMask, xK_l), spawn "gnome-screensaver-command --lock") 
  , ((mod4Mask, xK_p), spawn "dmenu_run -b -nb black") ]

I had the same issue as you and it was because I had used something like:

((mod4Mask, xK_p), spawn "exe=`dmenu_path | dmenu` && eval \"exec $exe\"")

which, for some reason, only works properly after a "xmonad --restart". Changing the binding to simply "dmenu-run" fixed the problem. In your case, though, it looks like you're missing the binding at all.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!