How to change keyboard layout in Lubuntu 15.10?

I have recently upgraded my PC from Lubuntu 14.10 to 15.10. Before the upgrade my keyboard layout matched my Danish keyboard. But after the upgrade I probably have a standard English/US layout.

  • Preferences/Language Support, doesn't let me configure the keyboard layout.
  • Preferences/Keyboard and Mouse, only let me configure stroking delay and similar.

I don't know about iBus and fcitx, as far as the tooltip infomation tells me, its for more complex languages such as Chinese.

I don't have a US icon in the taskbar, no keyboard and/or language icon at all.

Things I have tried:

  • Running the following in a terminal works, but only until the next reboot:

    setxkbmap -layout dk
    
  • I got the following parameter in the file /etc/default/keyboard:

    XKBLAYOUT="dk"
    
  • Installing and running the app Lxkeymap changes the keyboard to Danish when I run it, but rebooting will change the layout back to US.

I don't want anything fancy, I just want to set my keyboard layout to Danish. How can I do that?


Some googling and a test led me to this:

Right click the panel -> Add / Remove Panel Items -> Add -> Keyboard Layout Handler

That adds an icon to the panel, and by right clicking it and selecting "Settings", a GUI tool for managing keyboard layouts shows up.

To add languages, "keep system layout" should be unchecked.


I believe this solution only works if systemd is implemented? It works for me in Lubuntu 16.04. Let's check first if this works.

Go to the terminal and type in

localectl status

You should have this (partically the VC Keymap and X11 layout). If there isn't a command or something, I'm out of ideas.

 System Locale: LANG=en_AU.UTF-8
                LANGUAGE=en_AU:en_GB:en
     VC Keymap: us
    X11 Layout: us

If so, the following should fix it.

localectl set-keymap dk
localectl set-x11-keymap dk

I had set the GB keyboard instead of the US keyboard myself so my situation is quite similar. Unfortunately I don't have much know-how so maybe the following has changed more than you would want, but I haven't experienced any problems myself.

Solution adapted from Meuh's answer: https://unix.stackexchange.com/a/307767


On Lubuntu, complementing solutions above: Right-click on the bottom panel, and add the Keyboard Layout Handler.

At this point it only handles "US English", and the US flag appears (can be changed to text).

To add support to the US International (with dead keys), right click on the flag and enter to Settings.

In the Keyboard Layouts frame, click +Add. A nice list with flags of all countries in the world is displayed. Select US English again, but observe the diminutive triangle shaped icon to the left of it: it will expand to a rather complete list of variants, one of which is the wanted US Intl. with dead keys.

You can pick the key combination to activate it (I use Right Alt). Once installed you can also click on the flag icon in the panel: each click toggles the layout.

Now you have the wanted layout, in my case I frequently write in Spanish on a US keyboard. Apostrophe+vocal gives you the accents, also the ñ. áéíóúü.


As previous tries did not solve the problem, here is a workaround:

echo "setxkbmap -layout dk" >> ~/.xsessionrc 

Referance: https://wiki.debian.org/Keyboard