Linux-Mint

通過 gsettings 為 Linux Mint 20 自定義鍵綁定

  • August 26, 2020

通過 gsettings 在 cinnamon 中自定義全域鍵綁定中給出的解決方案在 Linux Mint 20 中不起作用。

我使用 GUI 監視了更改,dconf watch /並在使用 GUI 創建快捷方式時進行了以下更改:

/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 中設置自定義快捷方式。

您可以使用以下幾行作為範例

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']"

引用自:https://unix.stackexchange.com/questions/596308