Skip to content

Instantly share code, notes, and snippets.

@sdirix
Last active February 15, 2019 11:08
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sdirix/74ebfb2a1e60cf4926ac0fdbd77b53d3 to your computer and use it in GitHub Desktop.
Save sdirix/74ebfb2a1e60cf4926ac0fdbd77b53d3 to your computer and use it in GitHub Desktop.
How to add a US-based keyboard layout with support for german special characters to Ubuntu 18.04

Description

How to add a custom keyboard layout based on the standard US layout with slight modifications for german special characters.

  • Enter üäöß by pressing right Alt + uaos.
  • Enter ÜÄÖẞ by pressing right Alt + Shift + uaos.
  • Enter by pressing right Alt + 5.

HowTo

Add the following lines to end of /usr/share/X11/xkb/symbols/us file

partial alphanumeric_keys
xkb_symbols "us_german" {

  include "us"
  name[Group1]= "US (German)";

  key <AD07> { [ u, U,       U00FC, U00DC] };
  key <AD09> { [ o, O,       U00F6, U00D6] };
  key <AC01> { [ a, A,       U00E4, U00C4] };
  key <AC02> { [ s, S,       U00DF, U1E9E] };
  key <AE05> { [ 5, percent, U20AC       ] };

  include "level3(ralt_switch)"
};

To register the layout you need to modify /usr/share/X11/xkb/rules/evdev.xml. In layoutList search for the layout containing configItem containing <name>us</name> and add the following variant to the variantList

<variant>
  <configItem>
    <name>us_german</name>
    <description>English (US German)</description>
    <languageList>
      <iso639Id>eng</iso639Id>
      <iso639Id>ger</iso639Id>
    </languageList>
  </configItem>
</variant>

To choose this layout in Ubuntu 18.04 restart your PC (log out is not enough). In Settings > Region & Language add another Input Source. Choose English (United States) on the first page and English (US German) on the second.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment