keyboard layout is not saved

Asked by Andres Muniz

After restarting the computer the spanish keyboard configuration is not saved and I need to reset it each time I restart the computer.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu lxkeymap Edit question
Assignee:
No assignee Edit question
Solved by:
Andres Muniz
Solved:
Last query:
Last reply:
Revision history for this message
N1ck 7h0m4d4k15 (nicktux) said :
#1

Open a terminal (CTRL+ALT+T) and run the following commands

    lsb_release -rcd
    echo $DESKTOP_SESSION
    ls /usr/share/xsessions

Post back here FULL results please.

Regards
 NikTh

Revision history for this message
Andres Muniz (andresmp) said :
#2

That was quick.

belen@panbean:~$ lsb_release -rcd
Description: Ubuntu 12.04.2 LTS
Release: 12.04
Codename: precise
belen@panbean:~$ echo $DESKTOP_SESSION
LXDE
belen@panbean:~$ ls /usr/share/xsessions
LXDE.desktop openbox-gnome.desktop xsession.desktop xubuntu.desktop
openbox.desktop openbox-kde.desktop xterm.desktop
belen@panbean:~$

Revision history for this message
N1ck 7h0m4d4k15 (nicktux) said :
#3

Here is an example (copy-paste the following command in terminal and logout - login)

    echo '@setxkbmap -option grp:alt_shift_toggle "us,es"' | sudo tee -a /etc/xdg/lxsession/Lubuntu/autostart

Alt+Shift will change the keyboard layout. us=American english , es=spanish.

Regards
 NikTh

Revision history for this message
N1ck 7h0m4d4k15 (nicktux) said :
#4

BE AWARE
that above command (answer #3) is ONE command . It starts with echo and ends with autostart.
Here it is appear like 2 lines because of launchpad formatting.

Thanks

Revision history for this message
Andres Muniz (andresmp) said :
#5

thank you, very helpful. but what if i just want spanish keyboard by default?

Revision history for this message
Andres Muniz (andresmp) said :
#6

tee: /etc/xdg/lxsession/Lubuntu/autostart: No existe el archivo o el directorio
@setxkbmap -option grp:alt_sxshift_toggle "us,es"

Seems like the file does not exist.

Revision history for this message
N1ck 7h0m4d4k15 (nicktux) said :
#7

Try this

 echo '@setxkbmap -option grp:alt_shift_toggle "us,es"' | sudo tee -a /etc/xdg/lxsession/LXDE/autostart

Regards
 NikTh

Revision history for this message
Andres Muniz (andresmp) said :
#8

Hi I think this solved my problem:
I changed the last line of autostart file to:

@setxkbmap es

That way when I log in I am on the spanish keyboard by default. Please let me know if this is going to give problems in future.