How can I change my keyboard layout to a modified version?

Now, my goal is to change the keyboard layout for the entire xubuntu install to my own modded version. I think the way to do this is to make an X11 keymap and load it - but as always there is a thousand ways to do things and I'm open to suggestions.

I have created a modified xkb symbols keymap that I want to use in my xubuntu installation but I can't see it in the list of layouts in the settings dialog.

I put the following into /usr/share/X11/xkb/symbols/se

partial alphanumeric_keys
xkb_symbols "psvorak" {
name[Group1]="Sweden - PSvorak";
include "keypad(comma)"
include "level3(ralt_switch)"

key <AD01>  { [odiaeresis, Odiaeresis, dollar, none ]   };
<etc>
};

to no effect.

I also tried to regenerate symbols.dir according to http://www.linuxquestions.org/questions/linux-desktop-74/problem-creating-custom-xkb-layout-605568/ and while xkbcomp says there are no faults in my file, nothing else changes. It isn't available in the gui and setxkbmap (with its very confusing syntax) only responds with 'couldnt find file' or 'error loading new keyboard description'.

I did manage to create a console key map and load it using loadkeys...

charset "iso-8859-1"
keymaps 0-2,4-6,8,12
alt_is_meta
strings as usual
keycode   1 = Escape
    alt     keycode   1 = Meta_Escape
keycode   2 = one              exclam
    alt     keycode   2 = Meta_one
keycode   3 = two              quotedbl         at
    control keycode   3 = nul
    alt     keycode   3 = Meta_two
<etc>

... but it only seems to work in the Ctrl-Alt-F1 console.


Solution 1:

Reading the instructions cleverly hidden in a link far down on this page reveals the information that <variant><configItem><name>psvorak</name><description>PSvorak</description></configItem></variant> needs to be added to the appropriate <layout> section of the file /usr/share/X11/xkb/rules/evdev.xml

After adding this, the modified x11 keymap works for me in both ubuntu and xubuntu.

Solution 2:

I see you have made changes to the "Sweden - psvorak" layout. Are you sure that is the selected layout in your keyboard settings? If you go to System > Preferences > Keyboard under the Layouts tab:

Keyboard Preferences

Click Add and select Sweden and the variant you have modified. Choose a Layout