6

I switched to the American keyboard layout mainly because I find it easier to program that way. But for other applications I sometimes need umlauts.

I tried using the US international layout but the position for the umlauts is just strange and it wasn't as good for programming as well.

Can I configure my i3wm to have custom keyboard shortcuts for that? Something like holding o or pressing alt+o will yield ö.

Melebius
  • 11,431
  • 9
  • 52
  • 78

3 Answers3

5

The ArchLinux wiki has an answer that worked for me with i3. You can use the compose key to achieve typing any kind of Unicode character. I have a UK layout, but often need to type German characters. With the compose key, I can type CapsLock then " then a to get ä.

First, find which compose options are available

grep "compose:" /usr/share/X11/xkb/rules/base.lst

This should give you something along the lines of:

...
compose:menu         Menu
compose:caps         Caps Lock
...

Then set your compose key to the preferred key. I'm using caps lock for that.

setxkbmap -option compose:caps

If you can't find a suitable pre-defined configuration for the compose key, I think you'll have to set up your own xmodmap configuration.

1

I suggest you to install the autokey app:

sudo apt-get install autokey-gtk

and configure your shortcuts for the umlauts. For the initial configuration you can copy them manually from the characters app.

momi94
  • 21
-1

You can enable a compose key. After having done so, you can for instance type ö by pressing this sequence:

Compose followed by " followed by o

Gunnar Hjalmarsson
  • 33,540
  • 3
  • 64
  • 94
  • Could you please add the relevant information on how to enable the Compose key to your answer? As it is, this is mostly a link-only answer. Furthermore, the link is not even that helpful as it only describes how to enable Compose in GNOME, whereas the question is specifically mentions and is tagged with i3-wm. – Adaephon Jul 11 '17 at 12:32
  • @Adaephon: The suggestion to enable a compose key is my answer. I consider how to do it to be another question, so the the link to the official Ubuntu documentation is a bonus. ;) I know nothing about i3-wm. – Gunnar Hjalmarsson Jul 11 '17 at 15:14