命令修改shift+print快捷键的多种方法
时间: 2023-12-17 19:03:10 浏览: 31
除了使用 `gsettings` 命令来修改 `shift+print` 快捷键外,还有其他几种方法可以实现快捷键修改,具体如下:
1. 使用 `dconf-editor` 工具:
`dconf-editor` 是一个可以编辑 Gnome 配置的图形化工具,它可以让你轻松地修改快捷键设置。安装 `dconf-editor` 后,打开它并导航到 `org.gnome.settings-daemon.plugins.media-keys` 目录,然后修改 `screenshot` 键的值为你想要的快捷键。
2. 编辑 `~/.config/gtk-3.0/gtk.css` 文件:
在 `gtk.css` 文件中,你可以添加自定义 CSS 样式来修改快捷键。例如,你可以添加以下样式来将 `shift+print` 快捷键修改为 `super+print`:
```
@binding-set custom-screenshot-keybinding
{
bind "<Super>Print" { "screenshot" };
}
headerbar entry,
headerbar spinbutton,
headerbar button,
headerbar separator {
/* ... */
-gtk-key-bindings: custom-screenshot-keybinding;
}
```
3. 修改 `~/.config/gconf/apps/metacity/global_keybindings/%gconf.xml` 文件:
`metacity` 是 Gnome 默认的窗口管理器,它的全局快捷键设置存储在 `~/.config/gconf/apps/metacity/global_keybindings/%gconf.xml` 文件中。你可以使用文本编辑器打开该文件并修改 `<key name="run_command_screenshot">` 节点的 `value` 属性为你想要的快捷键。例如,你可以修改为:
```
<key name="run_command_screenshot" value="<Super>Print"/>
```
以上是几种常见的方法,你可以选择其中任何一种来修改 `shift+print` 快捷键。