LeeYaoSan
Posts: 4
Joined: Wed Sep 26, 2012 1:11 pm

Changin keyboard language in lxde

Wed Sep 26, 2012 6:17 pm

Hi all!
First of all my apologies if it has been posted yet, but with so many pages I was unable to find it.

My question is: How can I change the keyboard language in lxde?
I mean, I'm spanish and I can change my keyboard language to Spanish using raspi-config, but it only works when I'm in conlose mode, once I start x server (using startx) the keyboard continues in En-GB language, so, how can I change it to Spanish?

I tried with dpkg-reconfigure keyboard-configuration with no succes

any idea?

Thanks and sorry for my poor English

thradtke
Posts: 492
Joined: Wed May 16, 2012 5:16 am
Location: Germany / EL

Re: Changin keyboard language in lxde

Thu Sep 27, 2012 8:56 am

Sorry, no *good* solution yet, but:

Put setxkbmap "es" somwhere in your startup scripts (I have it in .bashrc, but that's not the best idea, allthough working).

Your likely have a keyboard with a controller that reports support for english only, while you have spanish keytops. I'm in the same situation, unfortunately.

Maybe some of our Gurus could look at what evdev does here and why the preferences are ignored.
Rocket Scientist.

User avatar
malakai
Posts: 1382
Joined: Sat Sep 15, 2012 10:35 am
Contact: Website

Re: Changin keyboard language in lxde

Thu Sep 27, 2012 9:01 am

I have had an issue and saw another with similar issue we resolved it by running sudo raspi-config multiple times

Boot Pi run config - load desktop run config logout

sudo shutdown -h -H now unplug plug power start again.

Next time when you hit the desktop see if it saves if not continue on the 3rd try it seemed to stay for both of us.

Seems a hassle but it worked for two of us. I think the file gets loaded into memory and for some reason isn't writing back to the SD Card (See threads where some users change to static ip but no save occurs)
http://www.raspians.com - always looking for content feel free to ask to have it posted. Or sign up and message me to become a contributor to the site. Raspians is not affiliated with the Raspberry Pi Foundation. (RPi's + You = Raspians)

Lirex
Posts: 16
Joined: Sat Jul 14, 2012 2:18 pm

Re: Changin keyboard language in lxde

Fri Sep 28, 2012 10:56 am

You can in user's home, the user create a file .xsessionrc

best in terminal

nano .xsessionrc --> Enter

setxkbmap de (override with your language)

Ctrl + o --> Enter

Ctrl + x

Logout - Login

now u have automatically your desired keyboard layout.

Lirex

thradtke
Posts: 492
Joined: Wed May 16, 2012 5:16 am
Location: Germany / EL

Re: Changin keyboard language in lxde

Wed Oct 03, 2012 10:56 am

Lirex wrote:You can in user's home, the user create a file .xsessionrc
That works, thank you Lirex. Very difficult to find the right script if you're new to these things.
Rocket Scientist.

LeeYaoSan
Posts: 4
Joined: Wed Sep 26, 2012 1:11 pm

Re: Changin keyboard language in lxde

Wed Oct 03, 2012 1:11 pm

Thank you vey much Lirex, that worked flawlessly

rasp123
Posts: 1
Joined: Mon Dec 31, 2012 7:48 pm

Re: Changin keyboard language in lxde

Mon Dec 31, 2012 7:52 pm

Thanks a lot Lirex, this has solved the problem :mrgreen: :)

PocketSized
Posts: 13
Joined: Sat Sep 15, 2012 10:36 am
Location: Norway

Re: Changin keyboard language in lxde

Thu Jan 03, 2013 7:54 pm

Thank you so much for this Lirex! Was about to go mental here...
It's here!

croge
Posts: 16
Joined: Mon Dec 10, 2012 11:12 pm

Re: Changin keyboard language in lxde

Fri Jan 18, 2013 12:39 am

Thanks also. I was starting to get annoyed but it worked a treat!

nickelliott
Posts: 1
Joined: Tue May 14, 2013 8:56 pm

Re: Changin keyboard language in lxde

Tue May 14, 2013 9:01 pm

Thanks for that.

BTW, for a British keyboard (which I thought it defaulted to anyway, but apparently not), you need gb as the country code (took me a bit of searching to work that out).

N

Amalian
Posts: 1
Joined: Sat May 25, 2013 10:28 am

Re: Changin keyboard language in lxde

Sat May 25, 2013 10:59 am

Lirex wrote:You can in user's home, the user create a file .xsessionrc

best in terminal

nano .xsessionrc --> Enter

setxkbmap de (override with your language)

Ctrl + o --> Enter

Ctrl + x

Logout - Login

now u have automatically your desired keyboard layout.

Lirex
:idea:

So if I want to have everything in Greek language I should do put:

setxkbmap GR

Correct :?:

Thanks

George :|

jemac001
Posts: 2
Joined: Tue Apr 09, 2013 8:37 am

Re: Changin keyboard language in lxde

Mon May 27, 2013 9:34 pm

didnt work, I use the LXDE desktop and the change only remain on the login screen before starting the lxde desktop with "startx"

thradtke
Posts: 492
Joined: Wed May 16, 2012 5:16 am
Location: Germany / EL

Re: Changin keyboard language in lxde

Thu Jun 06, 2013 2:11 pm

Maybe you've put the .xsessionrc in the wrong place? What gives...

Code: Select all

cat ~/.xsessionrc
...you?
Rocket Scientist.

stoooo
Posts: 9
Joined: Fri Feb 28, 2014 7:21 pm

Re: Changin keyboard language in lxde

Fri Feb 28, 2014 7:27 pm

That worked great. My only spare wired keyboard is a US one which we used for the installation, but then we switched to a UK bluetooth keyboard once the Pi was up and running. raspi-config worked OK to change the console keyboard layout, but the GUI was stuck at the US layout. Adding setxkbmap gb to the ~/.xsessionrc file did the trick. I had seen other references to use .xinitrc, but it looks like you have to build a full working .xinitrc if you want to use it, not just add the one keymap line in an attempt to add it to the default xinit process.

Return to “Raspberry Pi OS”