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'm having a problem with both Ubuntu 12.04 and 12.10 with custom keyboard shorcuts. They are reset after a while (I can't find a pattern but it seems to be when a massive upgrade happens). It happend to me a couple of days ago, when 12.10 got about 27 updates. I've searched launchapd and askubuntu, and found no question similar. My shortucts are not lost on reboot, I still can't find a pattern to identify the problem as I said. I tried also not using Control Center app, but gnome's dconf-editor, but same result as I found on some blog post. My question is, how can I save my custom shorcuts to restore them when this happens? Can somebody help me compose a bug for launchpad, like what package could be causing this, so I can fill a bug report. Thanks in advance.

share|improve this question
4  
You're not alone with this. I was experiencing the same problems a couple of months ago, but I am now running Xubuntu, so no way of checking if the same problem persists on my machine. This should be a common enough bug, so someone else might be able to chime in. –  Glutanimate Dec 15 '12 at 10:50
    
Same here, I change eg. Ctrl+Alt+0 (minimize) to either ctrl+alt+h or Super+H (try with or without the Super key), and while they often work after a single reboot, the Keyboard Shortcuts dialog stills shows "ctrl+alt+0" (the default). After a couple reboots usually my custom shortcut stops working. (Ubuntu 12.10) –  faB Apr 23 '13 at 12:48
    
Seems to be fixed in 13.10 finally. –  user203893 Oct 18 '13 at 2:06
    
@Nick Judging by the latest comments in the bug report this doesn't seem to be the case. –  faB Jan 1 at 22:05
1  
Applies to 14.04 as well. –  tishma Jun 4 at 8:57
show 2 more comments

2 Answers 2

up vote 14 down vote accepted

Thanks to Graham's links, it seems this was fixed for 13.04 but not "backported" to 12.10.

Update Amazingly.. this doesn't appear to be fixed in 13.04 release! :( I still had to use solution below.

Until then here's something I've pieced together from the comments on launchpad, it works for me on Ubuntu 12.10.

/etc/rc.local didn't work for me, so I created ~/.config/autostart/key_settings.desktop :

[Desktop Entry]
Type=Application
Exec=sh -c 'sleep 1; exec ~/.config/autostart/key_settings.sh'
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name=Load My Custom Shortcuts

Then the actual script ~/.config/autostart/key_settings.sh:

#!/bin/sh -e
#
#dconf write /org/gnome/desktop/wm/keybindings/minimize "['<Super>h']"
#dconf write /org/gnome/desktop/wm/keybindings/close "['<Super>q']"

gsettings set org.gnome.desktop.wm.keybindings minimize "['<Super>h']"
gsettings set org.gnome.desktop.wm.keybindings close "['<Super>q']"

Commented out the dconf method for reference, though gsettings works for me.

To find the keycodes, you can simply use Keyboard Shortcuts window open next to Terminal, then use the "get" command:

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

PS: this was meant more to elaborate on a practical fix suggested by Graham's links.

share|improve this answer
    
So the best fix for a problem that appears to be present since 12.10 and still there in 13.10 is to ignore the bug and reset / script the bindings each time over again? Way to go Ubtuntu! I appreciate your solution though - saves me the frustration from having to re-enter the bindings over and over again. –  Ivo van der Wijk Feb 22 at 8:12
    
Where can I find a listing of shortcut names? (Where you have 'minimize' and 'close'.) I looked in /usr/share/glib-2.0/schemas/org.gnome.desktop.wm.keybindings.gschema.xml but it doesn't seem to have shortcuts for locking the screen, altering the volume, or toggling muting, and these are the things I have custom shortcuts for... –  John Yeates Feb 26 at 15:25
2  
You can find them using the command gsettings list-keys org.gnome.desktop.wm.keybindings –  Pieter van Ginkel Mar 23 at 11:59
add comment

This seems to be related to a series of bugs on launchpad.

share|improve this answer
    
Just an FYI, bugs are never "merged", they're duped to each other. :P –  Thomas W. Oct 18 '13 at 4:26
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.