29

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?

user.dz
  • 48,105
Chau
  • 433
  • 2
    You can try with this guide – trunk96 Jun 17 '16 at 16:14
  • In Ubuntu Unity, the correct System Settings section is "Text Entry" and not "Keyboard". Do you have that in Lubuntu too? – Byte Commander Jun 17 '16 at 16:17
  • Having an old PC, I try to avoid Unity, thus using Lubuntu. But I normally have no clue as where to change stuff. I cannot find any Text Entry and Lubuntu don't seem to have a System Settings application like Unity. – Chau Jun 17 '16 at 16:20
  • 1
    If that does not work, you can try the terminal command setxkbmap -layout dk (I think that dk should mean Danish...) – Byte Commander Jun 17 '16 at 16:20
  • It does, but it doesn't survive a reboot. – Chau Jun 17 '16 at 16:25
  • 1
    Try to edit /etc/default/keyboard. That should survive a reboot. ;) – Gunnar Hjalmarsson Jun 17 '16 at 17:05
  • @Gunnar Hjalmarsson I've updated my question based on your suggestion. It could be that something is overriding my settings somewhere. – Chau Jun 17 '16 at 18:55
  • @Sneetsher, I've also included your suggestion in my question, though sadly it only helps momentarily. – Chau Jun 17 '16 at 18:56
  • @trunk96, sorry I didn't see the link under this in your comment. I have already found that guide, but since I don't have the Keyboard Layout Handler (or a button with US written on it in the taskbar), I cannot use it. – Chau Jun 17 '16 at 19:01
  • @Sneetsher, your suggestion seems to work. I guess this is yet another situation, where a distribution upgrade has gone wrong. I suppose this normally should work out of the box. – Chau Jun 17 '16 at 20:04
  • @Sneetsher, feel free to add an answer and I'll mark it. Thanks for your help! – Chau Jun 17 '16 at 20:05
  • yes @Chau this is kind of workaround . There is something may be hard to dig for it. – user.dz Jun 17 '16 at 20:06

7 Answers7

49

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.

Gunnar Hjalmarsson
  • 33,540
  • 3
  • 64
  • 94
7

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

2

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 ñ. áéíóúü.

David Ramirez
  • 191
  • 1
  • 4
1
  1. In Lubuntu, open up a terminal window with ctrl-alt-t
  2. type sudo apt install lxkeymap
  3. type your password
  4. close terminal window
  5. click on the startbutton, preferences, lxkeymap
  6. click on your country in the left column
  7. click on your keyboard choice in the right column
  8. click Apply
  9. you can test how the keys work in the line at the bottom of the lxkeymap window
  10. close lxkeymap window

For me, having bought a laptop with an English keyboard, but being a Dutch user, so wanting to be able to type "e for an ë, the combination of United Kingdom and English (UK, international with dead keys) works fine. Before that the combination of United States and English (US, international with dead keys) worked fine.

  • This does not answer the question. The OP stated that "Installing and running the app Lxkeymap changes the keyboard to Danish when I run it, but rebooting will change the layout back to US." – stumblebee Feb 28 '18 at 02:10
1

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

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

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

user.dz
  • 48,105
0

Why not just edit /etc/default/keyboard and change XKBLAYOUT to whatever value you want to set(dk, gb, us etc). I did this to change from uk layout to us layout, works after a reboot.

gussy
  • 1
  • 1
    Welcome to AskUbuntu! You may have noticed that this question asks specifically about Lubuntu 15.10. If your answer relates to a more recent version, it would be useful to [edit] that information into your post. If not, and you are still using 15.10 I highly recommend that you upgrade to a newer version. Cheers! – Elder Geek Dec 08 '19 at 03:18
0

Had a similar problem with the german qwertz keyboard in a Lubuntu variant for eeepc. After some search I installed the Lxkeymap tool. It adds the missing selection options to the LXDE GUI.

Patrik
  • 1