1

I'm spent hours trying to get this to work, and I have no idea, what I'm doing wrong. I must admit, that I'm fairly new to Ubuntu, so I might be missing something obvious.

I've read several questions and answers in here, regarding this same thing, but none of the answers help me.

I'm trying to setup a custom keyboard layout, since I'm from Denmark, and we have three ridiculus letters (Æ, ø and å), that I need to write every now and again.

The thing that I hoped that I could get some help with, is that when I go to this folder:

/usr/share/X11/xkb/symbols/

And edit the 'us'-file, where I change this:

key <AE05> {    [     5,    percent     ]   };

to this:

key <AE05> {    [     J,    percent     ]   };

then I can still not get a change in the layout. I'm just doing this to try to get this fricking layout to do something (so that it would write 'J', whenever i pressed '5' on the keyboard). Ideally, I would like to map

  • æ to ALTGR+a
  • ø to ALTGR+s and
  • å to ALTGR+d

But I figured, that if I couldn't even change the '5' to a 'J', then I should maybe get that to work first.

And yes... I and using the right version of the english keyboard - called 'English (US, international with dead keys)'. I've also tried modifying the regular english keyboard (called 'English (US)'), but with just as much luck.

Here's the layout code, from the 'us'-file:

partial alphanumeric_keys
  73 xkb_symbols "intl" {
  74 
  75     name[Group1]= "English (US, international with dead keys)";
  76 
  77     include "us(basic)"
  78 
  79     key <TLDE> { [dead_grave, dead_tilde,         grave,       asciitilde ] };
  80     key <AE01> { [     1,     exclam,    exclamdown,      onesuperior ] };
  81     key <AE02> { [     2,         at,   twosuperior, dead_doubleacute ] };
  82     key <AE03> { [     3, numbersign, threesuperior,      dead_macron ] };
  83     key <AE04> { [     4,     dollar,      currency,         sterling ] };
  84     key <AE05> { [     J,    percent,      EuroSign,     dead_cedilla ] };
  85     key <AE06> { [    6, dead_circumflex,    onequarter,      asciicircum ] };
  86     key <AE07> { [     7,  ampersand,       onehalf,    dead_horn ] };
  87     key <AE08> { [     8,   asterisk, threequarters,      dead_ogonek ] };
  88     key <AE09> { [     9,  parenleft, leftsinglequotemark, dead_breve ] };
  89     key <AE10> { [     0, parenright, rightsinglequotemark, dead_abovering ] };
  90     key <AE11> { [     minus, underscore,           yen,    dead_belowdot ] };
  91     key <AE12> { [     equal,       plus,      multiply,         division ] };
  92 
  93     key <AD01> { [     q,          Q,    adiaeresis,       Adiaeresis ] };
  94     key <AD02> { [     w,          W,         aring,            Aring ] };
  95     key <AD03> { [     e,          E,        eacute,           Eacute ] };
  96     key <AD04> { [     r,          R,    registered,       registered ] };
  97     key <AD05> { [     t,          T,         thorn,            THORN ] };
  98     key <AD06> { [     y,          Y,    udiaeresis,       Udiaeresis ] };
  99     key <AD07> { [     u,          U,        uacute,           Uacute ] };
 100     key <AD08> { [     i,          I,        iacute,           Iacute ] };
 101     key <AD09> { [     o,          O,        oacute,           Oacute ] };
 102     key <AD10> { [     p,          P,    odiaeresis,       Odiaeresis ] };
 103     key <AD11> { [ bracketleft,  braceleft,  guillemotleft, leftdoublequotemark ] };
 104     key <AD12> { [bracketright, braceright, guillemotright, rightdoublequotemark ] };
 105 
 106     key <AC01> { [     a,          A,        aacute,           Aacute ] };
 107     key <AC02> { [     s,          S,        ssharp,          section ] };
 108     key <AC03> { [     d,          D,           eth,              ETH ] };
 109     key <AC04> { [     f,          F,             f,                F ] };
 110     key <AC05> { [     g,          G,             g,                G ] };
 111     key <AC06> { [     h,          H,             h,                H ] };
 112     key <AC07> { [     j,          J,             j,                J ] };
 113     key <AC08> { [     k,          K,            oe,               OE ] };
 114 
 115     key <AC09> { [     l,          L,        oslash,         Ooblique ] };
 116     key <AC10> { [ semicolon,      colon,     paragraph,           degree ] };
 117     key <AC11> { [dead_acute, dead_diaeresis, apostrophe,        quotedbl ] };
 118 
 119     key <AB01> { [     z,          Z,            ae,               AE ] };
 120     key <AB02> { [     x,          X,             x,                X ] };
 121     key <AB03> { [     c,          C,     copyright,             cent ] };
 122     key <AB04> { [     v,          V,             v,                V ] };
 123     key <AB05> { [     b,          B,             b,                B ] };
 124     key <AB06> { [     n,          N,        ntilde,           Ntilde ] };
 125     key <AB07> { [     m,          M,            mu,               mu ] };
 126     key <AB08> { [     comma,       less,      ccedilla,         Ccedilla ] };
 127     key <AB09> { [    period,    greater, dead_abovedot,       dead_caron ] };
 128     key <AB10> { [     slash,   question,  questiondown,        dead_hook ] };
 129     key <BKSL> { [ backslash,        bar,       notsign,        brokenbar ] };
 130 
 131     key <LSGT> { [ backslash,   bar,            backslash,      bar ] };
 132 
 133     include "level3(ralt_switch)"
 134 };
1

Delete xkb cache.

Notes:

To load changes to the layouts menu simply close out of gnome-keyboard-preferences and reload, relaunching the windows manager should not be necessary.

There is a change in Ubuntu version (13.10) which causes the keyboard settings cache to not refresh after files in "/usr/share/X11/xkb/symbols" directory are modified. It looks like changes just don't get applied. To force the cache refreshing a one should delete *.xkm files from "/var/lib/xkb". Reference: Howto: Custom keyboard layout definitions:

sudo rm /var/lib/xkb/*.xkm

or

sudo dpkg-reconfigure xkb-data

This is a rip off this thread: How to add a new keyboard layout (Custom keyboard layout definition)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.