use*_*159 3 gnome keyboard keyboard-layout shortcut-keys language
我需要配置几个 Ubuntu 14.04/14.10 桌面。大多数事情我都能够轻松配置,因为它们可以在配置文件中或从命令行设置。
但是我在两件事上遇到了麻烦,设置可用语言和设置用于在语言之间切换的键盘快捷键。我知道如何从gnome-control-center
设置可用语言
Region & Language > Input Sources > English (US) + German + Italian
设置切换语言的键盘快捷键
Shortcut Settings > Typing > Switch to next source (Super+Escape), Switch to previous source (Shift+Super+Escape)
但我不知道如何从配置文件或命令行进行操作,因此我无法自动配置它。
您正在寻找的键是:
用于编辑输入源:
org.gnome.desktop.input-sources sources
Run Code Online (Sandbox Code Playgroud)用于编辑向前切换语言的键盘快捷键:
org.gnome.desktop.wm.keybindings switch-input-source
Run Code Online (Sandbox Code Playgroud)用于向后切换输入源:
org.gnome.desktop.wm.keybindings switch-input-source-backward
Run Code Online (Sandbox Code Playgroud)从命令行编辑这三个的示例命令:
要编辑输入源,请设置问题中提到的输入源:
gsettings set org.gnome.desktop.input-sources sources "[('xkb', 'us'), ('xkb', 'it'), ('xkb', 'de')]"
Run Code Online (Sandbox Code Playgroud)将 switch- 快捷键组合设置为Ctrl+space
gsettings set org.gnome.desktop.wm.keybindings switch-input-source "['<Primary>space']"
Run Code Online (Sandbox Code Playgroud)设置切换-快捷键组合向后切换Shift+ Super+space
gsettings set org.gnome.desktop.wm.keybindings switch-input-source-backward "['<Shift><Super>space']"
Run Code Online (Sandbox Code Playgroud)gsettings get org.gnome.desktop.input-sources sources
gsettings get org.gnome.desktop.wm.keybindings switch-input-source
gsettings get org.gnome.desktop.wm.keybindings switch-input-source-backward
Run Code Online (Sandbox Code Playgroud)
您可以通过使用以下命令列出所有键来搜索数据库中的关键字:
gsettings list-recursively
Run Code Online (Sandbox Code Playgroud)
它将列出所有现有的密钥,或者(我经常这样做)安装dconf-editor并使用Ctrl+简单地找到您的关键字F。
编辑
根据评论中的要求,我添加了一个小脚本来从命令行遍历输入源:
org.gnome.desktop.input-sources sources
Run Code Online (Sandbox Code Playgroud)
switch_source.py通过以下命令运行它:
python3 /path/to/switch_source.py +
Run Code Online (Sandbox Code Playgroud)
转到下一个输入源,然后
python3 /path/to/switch_source.py -
Run Code Online (Sandbox Code Playgroud)
转到上一个
| 归档时间: |
|
| 查看次数: |
4423 次 |
| 最近记录: |