通过 gsettings 针对 Linux Mint 20 自定义键绑定

通过 gsettings 针对 Linux Mint 20 自定义键绑定

中给出的解决方案通过 gsettings 在 cinnamon 中自定义全局键绑定在 Linux Mint 20 中不工作。

我使用 GUI 监控了更改dconf watch /,并在创建快捷方式时进行了以下更改:

/org/cinnamon/desktop/keybindings/custom-list
  ['custom0']

/org/cinnamon/desktop/keybindings/custom-keybindings/custom0/binding
  @as []

/org/cinnamon/desktop/keybindings/custom-keybindings/custom0/command
  'screen -d -m "/home/blueray/src/Translate/screen_ts.sh"'
  
/org/cinnamon/desktop/keybindings/custom-keybindings/custom0/name
  'capture2text'

/org/cinnamon/desktop/keybindings/custom-keybindings/custom0/binding
  ['<Super>q']

要设置我使用的第一行:

gsettings set org.cinnamon.desktop.keybindings custom-list "['custom0']"

但是当涉及到第二行时,它会抛出错误:

% gsettings set org.cinnamon.desktop.keybindings.custom-keybindings.custom0 binding "@as []" 
No such schema “org.cinnamon.desktop.keybindings.custom-keybindings.custom0”

如何使用 gsettings(而非 GUI)在 Linux Mint 20 中设置自定义快捷方式。

答案1

您可以使用以下几行作为示例

dconf write /org/cinnamon/desktop/keybindings/custom-list "['custom0']"
dconf write /org/cinnamon/desktop/keybindings/custom-keybindings/custom0/command "'tmux new-session -d "/home/blueray/src/Translate/screen_ts.sh"'"
dconf write /org/cinnamon/desktop/keybindings/custom-keybindings/custom0/name "'capture2text'"
dconf write /org/cinnamon/desktop/keybindings/custom-keybindings/custom0/binding "['<Super>q']"

# xkill keybinding for ctrl + escape
dconf write /org/cinnamon/desktop/keybindings/custom-list "['custom0', 'custom1']"
dconf write /org/cinnamon/desktop/keybindings/custom-keybindings/custom1/command "'xkill'"
dconf write /org/cinnamon/desktop/keybindings/custom-keybindings/custom1/name "'xkill'"
dconf write /org/cinnamon/desktop/keybindings/custom-keybindings/custom1/binding "['<Primary>Escape']"

相关内容