问题描述
XMonad的新手,至今为止还是很喜欢.我的XMonad设置非常原始/常规,并且 dmenu 遇到了问题.当我登录并点击mod+p
时,什么都没有发生.如果然后我打开一个终端并按xmonad --restart
然后mod+p
,则dmenu
将起作用.
New to XMonad and loving it so far. I have a fairly vanilla / regular XMonad setup and am having problems with dmenu. When I login and hit mod+p
nothing happens. If I then open a terminal and hit xmonad --restart
then mod+p
, dmenu
will be working.
我的xmonad.hs
一定有问题吗?我尝试了XMonad的无自定义设置,并且一切工作正常(即dmenu
在登录后仍在工作).
There must be something wrong with my xmonad.hs
? I tried a no-customization setup of XMonad and things were working normally (i.e. dmenu
was working after login).
我的问题:
- 我的
xmonad.hs
有什么问题吗? - 为什么除非我
xmonad --restart
,否则dmenu
不能工作? - 在
xmonad.start
中是否有某些故障会导致启动xmonad时无法正确加载dmenu?
- Is there something wrong with my
xmonad.hs
? - Why won't
dmenu
work unless Ixmonad --restart
? - Could something fail in
xmonad.start
that would prevent dmenu from loading properly when starting xmonad?
这是我的文件(从过度思考中借用). :
Here are my files (borrowed from overthink). :
xmonad.hs
import System.IO
import XMonad
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.SetWMName
import XMonad.Util.EZConfig(additionalKeys)
import XMonad.Util.Run(spawnPipe)
import XMonad.Hooks.ICCCMFocus
myWorkspaces = ["1", "2", "3", "4", "5", "6"]
myManageHook = composeAll
[ className =? "Gimp" --> doFloat
, className =? "Vncviewer" --> doFloat
]
main = do
xmproc <- spawnPipe "/usr/bin/xmobar /home/aaron/.xmobarrc"
xmonad $ defaultConfig { terminal = "urxvt" }
{ manageHook = manageDocks <+> manageHook defaultConfig
, startupHook = takeTopFocus >> setWMName "LG3D" -- fix for Java apps
, layoutHook = avoidStruts $ layoutHook defaultConfig
, logHook = dynamicLogWithPP xmobarPP
{ ppOutput = hPutStrLn xmproc
, ppTitle = xmobarColor "green" "" . shorten 50
}
, modMask = mod4Mask -- Rebind Mod to the Windows key
, workspaces = myWorkspaces
} `additionalKeys`
[ ((mod4Mask .|. shiftMask, xK_l), spawn "gnome-screensaver-command --lock") ]
xmonad.desktop
[Desktop Entry]
Encoding=UTF-8
Name=Xmonad-****
Comment=Ligthweight, pretentious tiling window manager
Exec=xmonad.start
Icon=xmonad.png
Type=XSession
xmonad.start
#!/bin/bash
xrdb -merge .Xresources
trayer --edge top --align right --SetDockType true --SetPartialStrut true --expand true --widthtype percent --width 10 --heighttype pixel --height 20 --transparent true --alpha 0 --tint 0x333333 &
# settings daemon is a prereq for some other gnome apps
gnome-settings-daemon &
# Network monitor (connections, vpns) applet in tray
if [ -x /usr/bin/nm-applet ] ; then
nm-applet --sm-disable &
fi
# volume indicator in tray
if [ -x /usr/bin/gnome-sound-applet ] ; then
gnome-sound-applet &
fi
eval $(gnome-keyring-daemon --start)
export GNOME_KEYRING_SOCKET
export GNOME_KEYRING_PID
#exec xmonad
dbus-launch --exit-with-session xmonad
感谢您的帮助!
推荐答案
更新:
似乎已解决问题的解决方案正在更改:
The fix that seems to have solved the problem is changing:
exec xmonad
收件人:
touch ~/.xmonad/xmonad.hs
exec xmonad
在
/usr/local/bin/xmonad.start (or .xinitrc/.xsession if xmonad is started using startx)
OLD:
OLD:
如何更改:
} `additionalKeys`
[ ((mod4Mask .|. shiftMask, xK_l), spawn "gnome-screensaver-command --lock") ]
收件人:
} `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\"")
由于某种原因,它只能在"xmonad --restart"之后正常工作.将绑定更改为简单的"dmenu运行"即可解决此问题.但是,就您而言,似乎根本就没有绑定.
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.
这篇关于XMonad:dmenu在启动时不会启动/产生的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!