sxhkd
有一个功能可以让我串联和弦。来自man sxhkd
:
When multiple chords are separated by semicolons, the hotkey is a chord
chain: the command will only be executed after receiving each chord of
the chain in consecutive order.
现在我想创建一个像“super + o ; t”这样的快捷方式来打开终端。也就是说,我会按下super
和o
键,释放它们,然后按下t
键。在他们的 GitHub 存储库中,他们有一个像这样改变和弦的示例:
super + o ; {e,w,m}
{gvim,firefox,thunderbird}
因此,对于我的示例来说,它应该是这样的:
super + o ; t
st
现在我将其保存在一个文件中,$HOME/.config/sxhkd/sxhkdrc
然后使用以下命令在终端中运行该程序:
sxhkd &
它打印以下警告:
Could not grab key 232 with modfield 0: the combination is already grabbed.
Could not grab key 232 with modfield 16: the combination is already grabbed.
Could not grab key 232 with modfield 2: the combination is already grabbed.
Could not grab key 232 with modfield 18: the combination is already grabbed.
Could not grab key 233 with modfield 0: the combination is already grabbed.
Could not grab key 233 with modfield 16: the combination is already grabbed.
Could not grab key 233 with modfield 2: the combination is already grabbed.
Could not grab key 233 with modfield 18: the combination is already grabbed.
每次我按下上述快捷键,它都会打印这些行。但它能正常工作,并打开我的终端,英石。
现在的问题是当我想要暗网做同样的事情。所以我有一个$HOME/.dwm/autostart.sh
每次启动 dwm 时都会运行的脚本。我将它放入sxhkd &
该文件中:
#!/bin/bash
# Hotkeys
sxhkd &
# set wallpaper
./set_wallpaper.sh
此自动启动脚本从以下函数运行dwm.c
:
void
runAutostart(void) {
system("cd ~/.dwm; ./autostart_blocking.sh");
system("cd ~/.dwm; ./autostart.sh &");
}
但它不起作用。我确保在更改这些文件后重新启动 X。我甚至重新启动了。
我怎样才能解决这个问题?
答案1
我遇到了同样的错误。the combination is already grabbed
我认为这意味着您已经使用了该组合键。尝试将其更改为super + alt + o ; t
。