Author Topic: How to change your keyboard layout in LXDE  (Read 11275 times)

Offline longtom

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 3342
  • Satellite Station Africa
How to change your keyboard layout in LXDE
« on: February 27, 2011, 01:02:55 PM »
For this “How To” I will refrain from using any CLI command.

I grew font of using the ZA keyboard layout from my early Linux days.  The reason is that it gives me easy access to characters I need in Afrikaans (like ë and é ) as well as German (like ü, ä, ö, and last but not least ß)

In LXDE there is no GUI way to do this, not for ZA and I would imagine not for some others.  In the PCLinuxOS Control Center the ZA layout does not feature.  So what to do?

1. Go to Menu > File Tools > File Manager Super User
2. In the address bar type  /etc/xdg/lxsession/LXDE/
3. Open the file “autostart” and add the following :
    setxkbmap -layout "za,us"
4. Save the file, log out and log in

The first layout in the command will be the default one, in my case “za”.


Now we add the “Keyboard Layout Switcher” to our taskbar:

1. Right-click on your taskbar
2. Choose “Add / Remove Panel Items”
3. Choose “Add”
4. Choose “Keyboard Layout Switcher”

If you choose a setting like mine you will see that the US setting has a neat little US flag, the ZA doesn't have that, it just says “ZA”.  In order to give it one you need to find and download a ZA flag from somewhere.  I got mine from here:

http://linuxgazette.net/gx/flags/ZA.png

It needs to be 60x40 pixels in size and must be a png file.  You also have to make sure that the country code is correct and in lower case in the file name (in my case za.png).  The directory where this flag has to end up is:

/usr/share/lxpanel/images/xkb-flags

You will not be able to download it directly to this root directory.  Download it somewhere possible and copy it to the desired location using your Super User File Manager and rename it if necessary.

Now you should have your desired setting in your taskbar with the flag of your country.

Small things is what keeps me loving Linux!  


« Last Edit: February 27, 2011, 11:43:42 PM by longtom »
Regards longtom

PCLinuxOS KDE 32bit
Intel Core 2 Duo E2200 / 2.2 GHz
2GB Ram
Nvidia GT610

Offline GuypronouncedGuynotGuy

  • Hero Member
  • *****
  • Posts: 1706
  • I used to suffer from migraines. So I gave up MS.
Re: How to change your keyboard layout in LXDE
« Reply #1 on: July 16, 2011, 09:39:25 AM »
Is there a list somewhere of the various keyboard layouts?

example: how do you know 'za' is the keyboard you want?
The idea that Bill Gates has appeared like a knight in shining armour to lead all customers out of a mire of technological chaos neatly ignores the fact that it was he, by peddling second-rate technology, who led them into it in the first place. - Douglas Adams (1952 - 2001)

Offline longtom

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 3342
  • Satellite Station Africa
Re: How to change your keyboard layout in LXDE
« Reply #2 on: July 16, 2011, 01:21:08 PM »
Is there a list somewhere of the various keyboard layouts?

example: how do you know 'za' is the keyboard you want?

That is a very good question.  My preferences were worked out when I started out in Linux with a Gnome based distro.  They had a wonderful way of showing keyboard layouts when one wished to change them and one could even print them out.   That enabled me to find out which one would suite my 3 language approach best.

I am not sure nor could I find in a quick search on the net how to find an overview of keyboard layouts and how special characters are printed in those different layouts.  But if somebody does find a way I would certainly love to know.
Regards longtom

PCLinuxOS KDE 32bit
Intel Core 2 Duo E2200 / 2.2 GHz
2GB Ram
Nvidia GT610

Offline longtom

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 3342
  • Satellite Station Africa
Re: How to change your keyboard layout in LXDE
« Reply #3 on: July 16, 2011, 01:34:43 PM »
Revisiting this I did find a site giving a tat more inside in all this.  Maybe you can find yourself a clue or 2:

http://alt-codes.org/linux/

Regards longtom

PCLinuxOS KDE 32bit
Intel Core 2 Duo E2200 / 2.2 GHz
2GB Ram
Nvidia GT610

Offline titzitattoo

  • New Friend
  • *
  • Posts: 1
    • romanian progressive metal band
Re: How to change your keyboard layout in LXDE
« Reply #4 on: October 09, 2011, 09:21:07 AM »
Thank you very-very much for the info, it´s cool that this thing works! I was really frustrated that I could´t change my keyboard layout in lxde. After a lot of research on the net I found nothing that work permanently, my bad that didn't came in my mind to look here first. Now I like my lxde much more then before :) thanks again.

Offline la_monda

  • Full Member
  • ***
  • Posts: 97
  • Registered Linux User #548015
    • Sis's fur design website!
Re: How to change your keyboard layout in LXDE
« Reply #5 on: December 13, 2011, 12:19:22 PM »
Nice guide indeed. Does any of you know if it is possible to set a keyboard shortcut to do the change,instead of clicking the layout icon "alt+shift" for example..
Intel Core 2 Duo E8200, Gigabyte GA-EP43DS3, 4GB Kingston DDR2 PC8500 1066MHZ, Nvidia 8500GT 512 RAM. Corsair 450VX
Thinkpad R61
PCLinuxOS 2012.x KDE, 3.2.18-pclos1.pae.bfs Kernel

Offline la_monda

  • Full Member
  • ***
  • Posts: 97
  • Registered Linux User #548015
    • Sis's fur design website!
Re: How to change your keyboard layout in LXDE
« Reply #6 on: December 13, 2011, 12:46:44 PM »
found this video that helped me:

How to change KEYBOARD LAYOUTS in XFCE,LXDE (Openbox,e17,ICEWM,Fluxbox)

Intel Core 2 Duo E8200, Gigabyte GA-EP43DS3, 4GB Kingston DDR2 PC8500 1066MHZ, Nvidia 8500GT 512 RAM. Corsair 450VX
Thinkpad R61
PCLinuxOS 2012.x KDE, 3.2.18-pclos1.pae.bfs Kernel

Offline Vorteggs

  • Hero Member
  • *****
  • Posts: 2399
Re: How to change your keyboard layout in LXDE
« Reply #7 on: December 13, 2011, 12:53:45 PM »
Thanks for the video.

There's GUI way too:
If I go Configure Your Computer-->Hardware-->Setup keyboard layout, choose the layout and click "OK" on the next screen I can choose the key combination for switching between the layouts.

Offline GuypronouncedGuynotGuy

  • Hero Member
  • *****
  • Posts: 1706
  • I used to suffer from migraines. So I gave up MS.
Re: How to change your keyboard layout in LXDE
« Reply #8 on: January 19, 2012, 03:46:48 PM »
Is there a list somewhere of the various keyboard layouts?

example: how do you know 'za' is the keyboard you want?

......aaaaand we're back! 

I love Linux! Turns out that the code for the dvorak layout is.....wait for it..... dvorak ! (how obvious is that?)

My next question for the gurus here, how do I associate an icon to US - dvorak layout?  Right now it will only make it a US flag, I have nothing against US flags it's just not representative of the dvorak layout when the default and alternate are both the same flag.

I tried renaming one of the other flags dvorak.png and then US - dvorak.png but it doesn't seem to work...still looking.
The idea that Bill Gates has appeared like a knight in shining armour to lead all customers out of a mire of technological chaos neatly ignores the fact that it was he, by peddling second-rate technology, who led them into it in the first place. - Douglas Adams (1952 - 2001)

Offline longtom

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 3342
  • Satellite Station Africa
Re: How to change your keyboard layout in LXDE
« Reply #9 on: January 20, 2012, 12:36:54 AM »
Not on a LXDE install right now, but deducing from the op I would go to

/usr/share/lxpanel/images/xkb-flags

backup us.png to somewhere and make a 60x40 pixels image and name it us.png .

Maybe that's just too simple - but it's worth a shot.  But then I am no guru .....
Regards longtom

PCLinuxOS KDE 32bit
Intel Core 2 Duo E2200 / 2.2 GHz
2GB Ram
Nvidia GT610

Offline GuypronouncedGuynotGuy

  • Hero Member
  • *****
  • Posts: 1706
  • I used to suffer from migraines. So I gave up MS.
Re: How to change your keyboard layout in LXDE
« Reply #10 on: January 20, 2012, 08:40:54 AM »
the conundrum is then BOTH flags will still be the same thing.... USA - dvorak and US both show up as the stars and stripes, I need one of them to be different.

I can try the CA I suppose, it shouldn't change the keyboard layout unless it adds all the French characters.


addendum:

YES! That did the trick, two flags now but it would still be nice to change the dvorak flag to the icon of my choice!
« Last Edit: January 20, 2012, 08:46:12 AM by GuypronouncedGuynotGuy »
The idea that Bill Gates has appeared like a knight in shining armour to lead all customers out of a mire of technological chaos neatly ignores the fact that it was he, by peddling second-rate technology, who led them into it in the first place. - Douglas Adams (1952 - 2001)

Offline frazelle09

  • Hero Member
  • *****
  • Posts: 1476
  • Open my what?
    • Fundacion Anisa, A.C.
Re: How to change your keyboard layout in LXDE
« Reply #11 on: January 17, 2013, 08:01:32 PM »
Just installed LXDE on an old AMD 1.33 Gz. w/256 Mb. -- it's runnin' great!  What's more, the first question i have - how do i set up a Spanish keyboard - is already answered in the LXDE forum!  Yea PCL!!!

Thanks for the great tip.  It works great!  Have a wonderful evening!  :)
"The earth is one country and mankind its citizens."
Baha'u'llah
"La tierra es un solo pais y la humanidad sus ciudadanos."


Offline longtom

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 3342
  • Satellite Station Africa
Re: How to change your keyboard layout in LXDE
« Reply #12 on: January 20, 2013, 06:46:13 AM »
Great to hear.  Enjoy your install - LXDE is just wonderful ...  :D
Regards longtom

PCLinuxOS KDE 32bit
Intel Core 2 Duo E2200 / 2.2 GHz
2GB Ram
Nvidia GT610