使用gsettings修改命令ubuntu快捷键

ubuntu中除了使用界面修改键盘快捷键外,还可以使用命令行修改键盘快捷键.

一种方式为使用gsettings修改键盘快捷键.

1. 在目录/usr/share/gnome-control-center/keybindings中,可以找到一组xml配置文件

2.  该文件包含一组节点, 该节点与界面操作键盘快捷键(system settings-> keyboard->shortcuts)一一对应.

?xml version="1.0" encoding="UTF-8"?>
<KeyListEntries wm_name="Compiz" schema="org.gnome.desktop.wm.keybindings" package="compiz" group="system" name="Windows">

<KeyListEntry name="activate-window-menu" description="Activate the window menu"></KeyListEntry>

<KeyListEntry name="toggle-fullscreen" description="Toggle fullscreen mode"></KeyListEntry>

<KeyListEntry name="toggle-maximized" description="Toggle maximization state"></KeyListEntry>

<KeyListEntry name="maximize" description="Maximize window"></KeyListEntry>

<KeyListEntry name="unmaximize" description="Restore window"></KeyListEntry>

<KeyListEntry name="toggle-shaded" description="Toggle shaded state"></KeyListEntry>

<KeyListEntry name="close" description="Close window"></KeyListEntry>

<KeyListEntry name="minimize" description="Minimize window"></KeyListEntry>

<KeyListEntry name="begin-move" description="Move window"></KeyListEntry>

<KeyListEntry name="begin-resize" description="Resize window"></KeyListEntry>

<KeyListEntry name="raise" description="Raise window above other windows"></KeyListEntry>

<KeyListEntry name="lower" description="Lower window below other windows"></KeyListEntry>

<KeyListEntry name="maximize-vertically" description="Maximize window vertically"></KeyListEntry>

<KeyListEntry name="maximize-horizontally" description="Maximize window horizontally"></KeyListEntry>

</KeyListEntries>

3. 使用gsettings设置Alt-F4不关闭界面.

  gsettings list-keys  org.gnome.desktop.wm.keybindings 

罗列出所有按键

4. 获取"close"关闭界面的快捷键.

gsettings get  org.gnome.desktop.wm.keybindings close

5. 设置"close"关闭界面快捷键.

gsettings set  org.gnome.desktop.wm.keybindings close "[]"

此时Alt-F4将不起效果.

6. 如果想恢复默认快捷键.

gsettings reset org.gnome.desktop.wm.keybindings close

此时Alt-F4将关闭快捷键.

转载于:https://www.cnblogs.com/svenzhang9527/p/10819202.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值