GNOME Bugzilla – Bug 678171
add keyboard layout options
Last modified: 2012-12-02 18:54:20 UTC
For 3.6, we are implementing http://live.gnome.org/ThreePointFive/Features/IBus The design http://live.gnome.org/Design/SystemSettings/RegionAndLanguage (see the table) calls for several xkb options to be moved to the tweak tool: Remap or disable Caps Lock Map a Meta key Enable Ctrl+Alt+Delete to kill XServer
Is there an API for xkb or does one just execute /usr/bin/setxkbmap -option bla ?
(In reply to comment #1) > Is there an API for xkb or does one just execute /usr/bin/setxkbmap -option bla > ? You shouldn't apply the options from g-t-t. Please see bug 679075 for how g-s-d will apply the options. I'm also working on API in gnome-desktop to give you access to all the options defined in xkeyboard-config but it's quite finished yet.
*** Bug 682893 has been marked as a duplicate of this bug. ***
For those in dire need of a workaround, you can set xkbd options by doing: gsettings set org.gnome.desktop.input-sources xkb-options "['ctrl:nocaps']" (value is a comma-separated list.) The option names can be found in: /usr/share/X11/xkb/rules/evdev.xml
yeah sorry, I have a paper due on Monday, I'll get this done before release.
Also, it would rule if we could just migrate the old xkb options to the new system.
(In reply to comment #6) > Also, it would rule if we could just migrate the old xkb options to the new > system. Where did the old options live?
(In reply to comment #7) > (In reply to comment #6) > > Also, it would rule if we could just migrate the old xkb options to the new > > system. > > Where did the old options live? org.gnome.libgnomekbd.keyboard It's not just dropping a .convert file unfortunately. I could probably do it in gnome-settings-daemon but I didn't find any prior art about doing it yet.
I think you can probably steal the approach of the gconf conversion: have a 'stamp' file in ~/.config somewhere. So you would only copy the old settings if 1. there are old settings 2. there are no new settings 3. the stamp file does not exist Does that make sense ?
Created attachment 225154 [details] [review] Add XKB options to the Typing group -- The code is a bit funny because each option is actually an element in a gsettings string array. Also because my python foo is almost non-existent. This needs the patch in bug 684802 to work.
Created attachment 225156 [details] [review] Show the XKB option group description instead of ID as tweak summary -- When doing GnomeXkbInfo I forgot to add a method to get the option group description so the previous patch just uses the group ID as the tweak summary. This patch uses the proper string now but needs the patch in bug 684803 which I didn't want to bother the r-t with for today's release, so this can only go in after that lands, probably for 3.6.1.
Created attachment 225177 [details] [review] Add XKB options to typing group
(In reply to comment #10) > Created an attachment (id=225154) [details] [review] > Add XKB options to the Typing group > > -- > > The code is a bit funny because each option is actually an element in > a gsettings string array. Also because my python foo is almost > non-existent. > > This needs the patch in bug 684802 to work. Rui, Could you check out my patch (attachment 225177 [details] [review]) for how I would recommend doing this in a more pythonic way (no globals, etc)? The patch is un-tested, but it should be close to working. I will download the GNOME beta livecd and try it there, if you don't beat me to it. John
> Could you check out my patch (attachment 225177 [details] [review]) Oh, and obviously remove my FIXME code which I was using to test against my older GNOME version.
Review of attachment 225154 [details] [review]: See my comment for the recommended way to do this, but otherwise this is OK.
Review of attachment 225156 [details] [review]: sure
Review of attachment 225177 [details] [review]: Hey, thanks, it certainly looks more elegant this way and works with the 2 small fixes I noted below. Shall I push? ::: gtweak/tweaks/tweak_typing.py @@ +62,3 @@ + + def reload(self): + for v in self._parent_settings.get_strv(self.XKB_GSETTINGS_NAME): TypingTweakGroup.XKB_GSETTINGS_NAME @@ +91,3 @@ + self._parent_settings.setting_add_to_list(TypingTweakGroup.XKB_GSETTINGS_NAME, new_value) + #FIXME: did you need to set this somewhere? + #self._value = new_value no need IMO as it gets set on reload() but can be if you prefer @@ +106,3 @@ + try: + self._kbdsettings = GSettingsSetting("org.gnome.desktop.input-sources") + self._kbdsettings.connect("changed::"+self.self.XKB_GSETTINGS_NAME, self._on_changed) there's and extra self there
(In reply to comment #17) > Review of attachment 225177 [details] [review]: > > Hey, thanks, it certainly looks more elegant this way and works with the 2 > small fixes I noted below. Shall I push? Yep, please push with the fixes you suggest. Keep the self._value setting as you wrote, I missed it. Thanks a lot!
Pushed. I'm going to leave this open until bug 684803 is fixed so that we can then commit attachment 225156 [details] [review].
Created attachment 225889 [details] [review] Show the XKB option group description instead of ID as tweak summary -- Since gnome-desktop 3.6.0 didn't get this API would you prefer somehing like this patch to handle both old and new versions of the library or should we add a versioned dependency in configure.ac?
Attachment 225889 [details] pushed as fe467c6 - Show the XKB option group description instead of ID as tweak summary