Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux Xmonad,如何将密钥绑定到运行shell脚本?_Linux_Bash_Shell_Window Managers_Xmonad - Fatal编程技术网

Linux Xmonad,如何将密钥绑定到运行shell脚本?

Linux Xmonad,如何将密钥绑定到运行shell脚本?,linux,bash,shell,window-managers,xmonad,Linux,Bash,Shell,Window Managers,Xmonad,我是新来的。是否可以在每次单击(例如f1)时运行shell脚本(比如~/x.sh)?这在配置文件中看起来如何?我已经在谷歌上搜索了很久,没有找到任何我想要的东西。使用xev确定我的系统0xffbe上的F1-键的keysym,然后添加 myKeys = [ ((0, 0xffbe), spawn "/path/to/x.sh") ] 到您的xmonad.hs。如中所述,使用 在main函数中,重新编译并重新启动。可能它也适用于additionalKeysP和,但我还没有测试过-上面的链接包含所有

我是新来的。是否可以在每次单击(例如f1)时运行shell脚本(比如~/x.sh)?这在配置文件中看起来如何?我已经在谷歌上搜索了很久,没有找到任何我想要的东西。

使用
xev
确定我的系统
0xffbe
上的
F1
-键的keysym,然后添加

myKeys = [ ((0, 0xffbe), spawn "/path/to/x.sh") ]
到您的
xmonad.hs
。如中所述,使用


main
函数中,重新编译并重新启动。可能它也适用于
additionalKeysP
,但我还没有测试过-上面的链接包含所有信息。

从您链接的
EZConfig
模块文档中,您可以单击函数类型中的
KeySym
以获得:xK\f1以下来自Leiaz的评论,您应该能够编写类似于
main=xmonad$desktopConfig`additionalKeys`[(0,xK_F1),spawn”/path/to/x.sh”)…]的内容。
`additionalKeys` myKeys