Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have customized some of the shortcuts in System ▸ Preferences ▸ Keyboard Shortcuts.

How can I restore individual shortcuts to their default settings? I do not want to reset all of the shortcuts, just a few of my choice.

share|improve this question
    
I need to reset the "Workspace switcher" shortcut, but cannot find where the setting is. –  To Do Dec 16 '12 at 17:36
    
@ToDo I'd recommend opening a new question about that. That keyboard shortcut isn't currently designed to be customizable, so solutions are going to be a little ugly. –  ændrük Dec 16 '12 at 22:19
    
Here it is. –  To Do Dec 17 '12 at 6:51
add comment

8 Answers 8

up vote 3 down vote accepted

It looks like the way keyboard shortcuts are implemented has slightly changed for Ubuntu 13.04

The shortcut settings are saved in the following locations (may be different for 12.10):

org.gnome.settings-daemon.plugins.media-keys
org.compiz.integrated
org.gnome.desktop.wm.keybindings
org.gnome.shell.keybindings

You can find these in the dconf-editor application, then using the "Set to Default" button to reset each desired entry. dconf-editor can be installed at the command line with sudo apt-get install dconf-tools.

Otherwise, you could also try resetting any one of the locations by using the following command in the terminal:

gsettings reset-recursively <insert location>

(e.g. gsettings reset-recursively org.gnome.settings-daemon.plugins.media-keys)

share|improve this answer
add comment

They key bindings stored in the gconf database, but they aren't all in the same place unfortunately.

However, you can get a list of all the key bindings gconf keys by looking in the files located in /usr/share/gnome-control-center/keybindings/.

For example, /usr/share/gnome-control-center/keybindings/01-desktop-key.xml contains the list of keys for all the shortcuts Keyboard Shortcuts lists under Desktop.

<?xml version="1.0" encoding="UTF-8"?>
<KeyListEntries name="Desktop">

<KeyListEntry name="/apps/gnome_settings_daemon/keybindings/help"/>

<KeyListEntry name="/apps/gnome_settings_daemon/keybindings/calculator"/>

<KeyListEntry name="/apps/gnome_settings_daemon/keybindings/email"/>

<KeyListEntry name="/apps/gnome_settings_daemon/keybindings/www"/>

<KeyListEntry name="/apps/gnome_settings_daemon/keybindings/power"/>

<KeyListEntry name="/apps/gnome_settings_daemon/keybindings/screensaver"/>

<KeyListEntry name="/apps/gnome_settings_daemon/keybindings/home"/>

<KeyListEntry name="/apps/gnome_settings_daemon/keybindings/search"/>

</KeyListEntries>

Once you know the key name you can restore it to its default value.

For example, let's say you want to restore the shortcut to launch the calculator,

alt text

Simply run:

gconftool -u "/apps/gnome_settings_daemon/keybindings/calculator"

alt text

share|improve this answer
    
This does not seem to work for Ubuntu 12.10. –  Crimbo Jan 20 '13 at 22:32
add comment

Building DoR's answer, this simple script, typed at the command line, will reset all shortcuts:

cd /usr/share/gnome-control-center/keybindings
for entry in $(grep KeyListEntry * |cut -d'/' -f2- |cut -d'"' -f1); do
    echo $entry
    gconftool -u "/$entry"
done
share|improve this answer
    
I get a bunch of errors like these Error unsetting /'': Bad key or directory name: "/'": '' is an invalid character in key/directory names -f2- –  zengr Mar 8 '13 at 1:07
add comment

You can't. But you can see what are default values if you press help and click Section 1.2 ― Keyboard Skills and then on the right you have a list of key grous:

  • Global Shortcut Keys
  • Window Shortcut Keys
  • Application Keys
  • Access Keys

regards

share|improve this answer
    
As @danizmax suggestion see the default keys and put them back... –  karthick87 Dec 15 '10 at 19:35
add comment

Here is something I discovered by accident:

Open gconf-editor (press Alt+F2 and type in gconf-editor).

Find the setting you want to reset. I found several places they are located:

  1. Apps > gnome_settings_daemon > keybindings

  2. Apps > metacity > global_keybindings

  3. Apps > metacity > window_keybindings

There may be others.

Right click on the setting, and click 'Unset Key'. This will restore it to the default setting.

share|improve this answer
1  
Has this actually worked for anyone? Do you need to restart for this to take effect? Just tried this and this doesn't work for me... didn't want to rate this unless you do actually need to restart first. –  hazrpg May 13 '12 at 21:10
1  
I cannot find those locations in Ubuntu 12.10. –  Crimbo Jan 20 '13 at 22:30
add comment

In Ubuntu 13.04 it's looking like a lot of the shortcuts can be found at org->gnome->settings-daemon->plugins->media-keys. I was able to reset my volume buttons with it and I didn't even need to look up the default values as there's a reset button.

share|improve this answer
add comment

This worked for me without restarting Ubuntu or Gnome Desktop. I had tried using "Shutter" for screen capture, and it changed some hotkey bindings for PrintScreen and Alt+PrintScreen. After uninstalling Shutter I needed to restore the hotkey settings that it had changed. I was able to change my hotkey bindings for those keys by running gconf-editor (from a terminal window) and then changing settings in both of these places:

  • apps->metacity->global_keybindings
  • apps->metacity->keybinding_commands

I'm running Ubuntu 10.04 LTS, Gnome Desktop 2.30.2

share|improve this answer
1  
In Ubuntu 12.10 those locations are not there. So between versions 10.04 and 12.10, the locations must of changed. –  Crimbo Jan 20 '13 at 22:29
add comment

gsettings reset-recursively org.gnome.desktop.wm.keybindings

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.