简体   繁体   English

XMonad不会使用mod4Mask生成任何东西

[英]XMonad won't spawn anything with mod4Mask

I have seen a few somewhat similar problems on the Arch forums, but I have not been able to find a solution for this. 我在Arch论坛上看到了一些类似的问题,但是我还没有找到解决方案。

So I am running XMonad 0.1 in XFCE4 on Fedora 17 x64, and I have xmonad-contrib installed as well. 所以我在Fedora 17 x64上运行XFCE4中的XMonad 0.1,我也安装了xmonad-contrib。 Here is my xmonad.hs file: 这是我的xmonad.hs文件:

import System.Posix.Env (getEnv)
import Data.Maybe (maybe)
import Control.Monad
import XMonad.Hooks.SetWMName
import qualified XMonad.StackSet as W
import XMonad.Util.EZConfig

import XMonad
import XMonad.Config.Desktop
import XMonad.Config.Gnome
import XMonad.Config.Kde
import XMonad.Config.Xfce

main = do
     session <- getEnv "DESKTOP_SESSION"
     xmonad  $ xfceConfig     --(maybe desktopConfig desktop session)        
        {
        modMask = mod4Mask
        , terminal = "gnome-terminal"
        , logHook = takeTopFocus >> setWMName "LG3D"
        }
        `additionalKeys` [ ((mod4Mask, xK_p), spawn "dmenu_run")
                           ,((mod4Mask, xK_v), spawn "gvim")
            ]


-----------------------------------------
------------Custom Keys------------------
-----------------------------------------


-----------------------------------------
------------Other horrible stuff---------
-----------------------------------------

desktop "gnome" = gnomeConfig
desktop "kde" = kde4Config
desktop "xfce" = xfceConfig
desktop "xmonad-gnome" = gnomeConfig
desktop _ = desktopConfig

atom_WM_TAKE_FOCUS ::
  X Atom
atom_WM_TAKE_FOCUS =
  getAtom "WM_TAKE_FOCUS"

takeFocusX ::
  Window
  -> X ()
takeFocusX w =
  withWindowSet . const $ do
    dpy       <- asks display
    wmtakef   <- atom_WM_TAKE_FOCUS
    wmprot    <- atom_WM_PROTOCOLS
    protocols <- io $ getWMProtocols dpy w
    when (wmtakef `elem` protocols) $
      io . allocaXEvent $ \ev -> do
          setEventType ev clientMessage
          setClientMessageEvent ev w wmprot 32 wmtakef currentTime
          sendEvent dpy w False noEventMask ev

takeTopFocus ::
  X ()
takeTopFocus =
  withWindowSet $ maybe (setFocusX =<< asks theRoot) takeFocusX . W.peek

You will notice in the additionalKeys part, I have 2 bindings. 你会注意到在additionalKeys部分,我有2个绑定。 Both are using mod4Mask , which is also my default mod key. 两者都使用mod4Mask ,这也是我的默认mod键。 The second binding, for gvim, works perfectly. gvim的第二个绑定工作得很好。 The problem is that the first binding, for dmenu, simply does nothing. 问题是dmenu的第一个绑定什么都不做。 What's strange is that if I change mod4Mask (for dmenu) to mod1Mask then it works. 什么奇怪的是,如果我改变mod4Mask (用于dmenu)到mod1Mask然后它工作。 Also, dmenu works fine if I run it from a terminal. 此外,如果我从终端运行它,dmenu工作正常。

EDIT: mod4Mask and P doesn't seem to spawn / do anything. 编辑:mod4Mask和P似乎没有产生/做任何事情。

Any ideas? 有任何想法吗? This config seems fine to me, I have no idea why it won't work. 这个配置对我来说似乎很好,我不知道它为什么不起作用。

I don't know what's wrong, but I have a few suggestions for debugging it. 我不知道出了什么问题,但我有一些调试建议。

  1. I've had situations where I thought I was running my current custom xmonad.hs, but I was really running a previous version or the default. 我有过这样的情况,我认为我正在运行我当前的自定义xmonad.hs,但我确实在运行以前的版本或默认版本。 Rule this out by making some other change to your xmonad.hs, and verifying that it works. 通过对xmonad.hs进行一些其他更改并验证它是否有效来对此进行排除。

  2. Try mapping mod4Mask p to something else, and see if that works. 尝试将mod4Mask p映射到其他东西,看看是否有效。

  3. Using xev, press mod4Mask + p, and verify that it indeed generates the events you're expecting. 使用xev,按mod4Mask + p,并验证它确实生成了您期望的事件。 Compare with mod4Mask + v, and see if there's any difference apart from the change from p to v. 与mod4Mask + v比较,看看除了从p到v的变化之外是否存在任何差异。

  4. Make sure you don't have NumLock or Fn or something like that active! 确保你没有NumLock或Fn或类似的东西! (NumLock would change your p to a number, I think.) (我想,NumLock会将你的p改为数字。)

What kind of keyboard are you using? 你用的是哪种键盘? US? 我们? UK? 英国? Something else? 别的什么?

XFCE binds Mod4-p to something in this file XFCE将Mod4-p绑定到此文件中的某些内容

~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml

By searching for "Super" in that file I find two lines with < Super>-p. 通过在该文件中搜索“Super”,我找到了两行<Super> -p。 One seems to be "empty" and the other executes "xfce4-display-settings --minimal" for setting up an external display output. 一个似乎是“空”而另一个执行“xfce4-display-settings --minimal”来设置外部显示输出。

I changed both occurrences in that file to use o instead of p and then logged out of XFCE and back in. Now Mod4-p works in XMonad! 我将该文件中的两个更改都更改为使用o而不是p然后退出XFCE并重新登录。现在Mod4-p在XMonad中工作!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM