我以前在用户会话中有很多自定义快捷方式。Settings > Keyboard > Shortcuts > Custom Shortcuts
我今天将网络从 LTS 12.04 升级到了 LTS 14.04.1。我登录到我的用户,唉!没有更多的自定义快捷键(我的其他修改,除了自定义快捷键,都在那里)。列表变空了。有人能告诉我如何恢复所有这些自定义快捷方式吗?:-)
答案1
我今天也遇到了同样的问题。我写了一个小脚本将旧的键绑定转换为新的界面。
#!/bin/bash
# Delete old new-style keybindings
gsettings set org.gnome.settings-daemon.plugins.media-keys custom-keybindings "[]"
gconftool-2 -R /desktop/gnome/keybindings | while read LINE; do
read BINDINGLINE
read ACTIONLINE
read NAMELINE
NUM="`echo "$LINE" | sed -e 's@^/desktop/gnome/keybindings/custom@@g' -e 's/:$//g'`"
BINDING="`echo "$BINDINGLINE" | sed 's/^binding = //g'`"
ACTION="`echo "$ACTIONLINE" | sed 's/^action = //g'`"
NAME="`echo "$NAMELINE" | sed 's/^name = //g'`"
gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom$NUM/ name "'$NAME'"
gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom$NUM/ command "'$ACTION'"
gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom$NUM/ binding "'$BINDING'"
CURRENTLIST="`gsettings get org.gnome.settings-daemon.plugins.media-keys custom-keybindings`"
CURRENTLIST="${CURRENTLIST%]}, '/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom$NUM/']"
gsettings set org.gnome.settings-daemon.plugins.media-keys custom-keybindings "${CURRENTLIST/[, /[}"
done