GNOME Bugzilla – Bug 564687
Keyboard settings do not apply when new keyboard is plugged in.
Last modified: 2008-12-17 10:33:16 UTC
Please describe the problem: I have changed a setting under "Hardware > Keyboard > Layouts > Layout Options... > CapsLock Key Behaviour". I have selected "Swap ESC and CapsLock". This setting works on my primary keyboard (the built in keyboard on my laptop). When I insert a new keyboard (ID 05ac:0220 Apple, Inc. Aluminum Keyboard) the capslock key does not behave as 'ESC', nor does the ESC behave as capslock, they both have their original functions. Going to this dialog and selecting 'Default' then 'Swap ESC and CapsLock' makes the behaviour take effect as expected. Steps to reproduce: 1. Change a setting under "Hardware > Keyboard > Layouts > Layout Options... > CapsLock Key Behaviour" 2. Plug in new usb keyboard Actual results: New keyboard does not behave as per the setting, instead the default behaviour is seen. Expected results: A new keyboard plugged in should follow the settings that are set for the keyboard, instead of the defaults. Does this happen every time? Yes. Other information:
Fixed in 2.25.x (with new libxklavier)
Okay, but I'm running 2.24 - is there any way to fix this now? I'm having to do this twice a day. Even if it's possible to script it.
Running setxkbmap (with necessary parameters) on plugging the kbd might help. How to setup the hook script? I do not know, actually (whether it is actually possible at all).
I'm okay with having a script that I run in a shell or when I click on a launcher in the bar, it's just that at the moment I have to surf through dialogs to get to this part of the ui. How do I figure out what gnome is doing in order to enact this setting so I can script it? Or is there a way I can send a signal to gnome to apply these settings.
In that case, just look at the manual of setxkbmap, create one-liner script, put the launcher on the panel. In order to find out your current xkb settings, do "xprop -root _XKB_RULES_NAMES" - you'll see them (ruleset, model, layouts, variants, options). HTH