我正在尝试Xmonad,并且正在构建一个配置文件。但是,我对键绑定有一个问题。我的一些键绑定正在工作,而另一些不工作。我不明白为什么。它编译得很好,没有错误。对我来说,要么都能工作,要么什么都不能做。为什么只有一些?
例如,我可以启动一个终端,锁定我的屏幕,启动文件管理器,但我不能启动firefox或vscode。下一节也是如此。我可以启动rofi launcher,rofi window finder,但dmenu和rofi exit菜单在我的配置中不起作用:
terminalCmd = "alacritty"
browserCmd = "firefox"
editorCmd = "code"
fileManagerCmd = "nautilus --new-window"
dmenuCmd = "dmenu_run"
rofiCmd = "rofi -show drun -theme clean"
rofiWinCmd = "rofi -show window -theme clean_window"
rofiExitCmd = "~/.config/rofi/launch.sh powermenu"
screenLockCmd = "slock"
myFocusFollowsMouse = True
myKeybindings conf@XConfig {modMask = modMask} = M.fromList $
--Launch programs
[ ((modMask, xK_Return), spawn terminalCmd) --Launch terminal
, ((modMask, xK_w), spawn browserCmd) --Launch browser
, ((modMask, xK_e), spawn editorCmd) --Launch editor
, ((modMask, xK_a), spawn fileManagerCmd) --Launch file manager
, ((modMask, xK_l), spawn screenLockCmd) --Lock the screen
--Launchers and menus
, ((modMask, xK_r), spawn dmenuCmd) --Launch dmenu launcher
, ((modMask, xK_p), spawn rofiCmd) --Launch rofi launcher
, ((modMask .|. shiftMask, xK_p), spawn rofiWinCmd) --Launch rofi window finder
, ((modMask .|. shiftMask, xK_e), spawn rofiExitCmd) --Launch rofi exit menu
main = xmonad $ def
{ modMask = mod4Mask
, focusFollowsMouse = myFocusFollowsMouse
, borderWidth = 1
, terminal = terminalCmd
, normalBorderColor = "#cccccc"
, focusedBorderColor = "#cd8b00"
, workspaces = myWorkspaces
, keys = myKeybindings
, startupHook = myStartupHook }发布于 2020-11-09 06:44:24
下面是我调试这个问题的方法。
xev,按要使用的键,然后仔细检查触发的事件的名称。此外,为了排除XMonad看到的PATH环境变量的值与终端看到的值之间的任何差异,请尝试在您的配置中提供命令的完整路径。
https://stackoverflow.com/questions/64726136
复制相似问题