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.
-
4You'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.– GlutanimateDec 15, 2012 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)– Bleep BloopApr 23, 2013 at 12:48
-
Seems to be fixed in 13.10 finally.– user203893Oct 18, 2013 at 2:06
-
@Nick Judging by the latest comments in the bug report this doesn't seem to be the case.– Bleep BloopJan 1, 2014 at 22:05
-
1Applies to 14.04 as well.– tishmaJun 4, 2014 at 8:57
3 Answers
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.
-
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. Feb 22, 2014 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 YFeb 26, 2014 at 15:25
-
2You can find them using the command
gsettings list-keys org.gnome.desktop.wm.keybindings
Mar 23, 2014 at 11:59
This seems to be related to a series of bugs on launchpad.
- Ubuntu 12.10 The first answer to this post has a workaround using
gsettings set org.gnome.desktop.wm.keybindings <command> "[<key-sequence>]"
within your startup script. - Ubuntu 12.10 - I'm guessing it should be merged with the first
- Ubuntu 12.04
-
Just an FYI, bugs are never "merged", they're duped to each other. :P– Thomas Ward ♦Oct 18, 2013 at 4:26
Get rid of Alt+F1 (panel-main-menu) binding which is used in some Jetbrain products (Phpstorm)
I couldn't get the information on how to permanently set custom keybindings in Ubuntu 19 so after countless tries I ended up doing the following (maybe someone knows how to do that without the need of a script):
- Create a script paste code and set executable permissions:
vi custom-key-bindings.sh
#!/bin/bash
gsettings set org.gnome.desktop.wm.keybindings panel-main-menu "['<Alt>7']"
chmod +x
- Alt+F2
gnome-session-properties
- Add command & set path to script
- Done
Check after reboot with
gsettings get org.gnome.desktop.wm.keybindings panel-main-menu