如何在Mint 21.1 Cinnamon中通过dconf绑定Ctrl+^快捷键?
Mint 21.1 Cinnamon:用dconf设置Ctrl+^自定义快捷键的正确方式
已完成的Ctrl+s绑定
你已经成功通过dconf配置了Ctrl+s打开Tilix Quake窗口,命令如下:
dconf write /org/cinnamon/desktop/keybindings/custom-list "['custom0']" dconf write /org/cinnamon/desktop/keybindings/custom-keybindings/custom0/command "'tilix --quake'" dconf write /org/cinnamon/desktop/keybindings/custom-keybindings/custom0/name "'tilixquake'" dconf write /org/cinnamon/desktop/keybindings/custom-keybindings/custom0/binding "['<Control>s']"
为什么Ctrl+^绑定失败
你尝试的Caret、Circumflex等名称是字符的语义标签,但dconf的快捷键绑定依赖的是按键对应的键盘符号(keysym),而非字符本身的名称,因此这些尝试无法被系统识别。
正确的解决步骤
1. 用xev获取目标按键的准确keysym
打开终端运行xev,会弹出一个小交互窗口:
- 保持窗口处于焦点,按住
Ctrl并按下能输入^的按键(多数美式键盘中需要配合Shift,即实际按下Ctrl+Shift+6) - 在终端输出中找到
KeyPress event块,其中的keysym字段会显示该按键组合的标识符。对于Ctrl+Shift+6的组合,对应的绑定字符串是<Control><Shift>6。
2. 执行绑定命令
如果你的^需要Shift配合输入,执行以下命令更新绑定:
dconf write /org/cinnamon/desktop/keybindings/custom-keybindings/custom0/binding "['<Control><Shift>6']"
若你的键盘布局中^可直接输入(无需Shift),则使用"['<Control>6']"即可。
获取完整键标识符列表
- 运行
xmodmap -pke,终端会输出当前键盘所有键位的keycode和对应keysym,可从中查找所有可用的键标识符。 - 运行
gsettings list-recursively org.gnome.desktop.wm.keybindings,查看系统默认快捷键的格式示例,参考其中的键标识符写法。
内容的提问来源于stack exchange,提问作者buddemat
相关产品推荐
相关产品推荐

