Help needed to make permanent US,other keyboard mapping in LXDE

I’m seeking to make permanent a selection in openSUSE-11.4 LXDE between english and Thai keyboards. And I need help here, as I have only succeed partially.

After installing Thai via YaST regional settings, I followed the advice in an LXDE forum here LXDE.org Forum • View topic - How to add layouts to keyboard preferences in LXDE? and on the LXDE Panel I righted click on LXPanel->Add/Remove Panel Items->Panel Applets->Add->Keyboard Layout Switcher. Upon a restart of X that gave me a US flag symbol (for US keyboard) in lower right hand corner. No other language selection.

I then as a regular user sent the command


setxkbmap -option grp:switch,grp:alt_shift_toggle,grp_led:scroll us,th

and I then had a choice between Thai and US keyboard which worked well. That unfortunately is only temporary until the next reboot.

The question I have is, HOW to make it permanent ?

I tried, and I was unable to make that permanent. I tried adding .Xkbmap to /home/user (restarted/tested) and when that failed I tried adding .Xmodmap to /home/user (restarted/tested) and when that failed I tried adding /etc/X11/Xkbmap (restarted/tested) and when that failed I added same line to /etc/X11/Xmodmap (restarted/tested) and that also failed. The line in all cases was


-option grp:ctrl_shift_toggle,grp_led:scroll us, th

I also tired editing the /etc/X11/xorg.conf.d/90_keytable.conf file, changing it to


Section "InputClass"
        Identifier "LocalKeyboard"
        MatchIsKeyboard "on"
        Option  "XkbLayout"     "us, th"
        Option  "XkbOptions"   "grp:alt_shift_toggle"
EndSection

Any suggestions as to what I am doing wrong ?

I could create a script with my 1st successful effort (and have that run when LXDE starts up) but surely there is a more elegant way ? I am also NOT keen to have this system wide (even thou I tried that system wide (unsuccessfully) at the end) but I would rather only have this for one LXDE user (my wife).

Again, any suggestions ?

oldcpu wrote:

> setxkbmap -option grp:switch,grp:alt_shift_toggle,grp_led:scroll us,th
What about copying that line into a script which you then put into the
autostart folder ~/.config/autostart?
Of course I do not know enough about lxde to know if lxde respects that
folder and the scripts in it?


PC: oS 11.3 64 bit | Intel Core2 Quad Q8300@2.50GHz | KDE 4.6.4 | GeForce
9600 GT | 4GB Ram
Eee PC 1201n: oS 11.4 64 bit | Intel Atom 330@1.60GHz | KDE 4.6.4 | nVidia
ION | 3GB Ram

In fact I have created a script of the line, and as a work around I could put it as an icon launched script on the desktop, … but I forget how to create a desktop script in LXDE (I was told once). I’ll have to look it up again … lol …

Now, wrt ~/.config/autostart, in LXDE there is a ~./config but there is no autostart file.

I know the openSUSE community packager for the official LXDE that is provided with openSUSE (he is a Packman packager) and I could ask him. … He is quite busy thou, and I hate to load him down with my requests, … but then again, it IS my wife I am trying to help so I must might take advantage of that openSUSE community contact.

The lxde wiki just says:
“Add a .desktop file to your ~/.config/autostart directory (create one if
not available).” http://wiki.lxde.org/en/Autostart


[Desktop Entry]
Type=Application
Exec=wicd-client -n

The example is for wicd but that should not matter if you replace it with
your command line.
So I think you just need to make the autostart folder there and then it can
be used.


PC: oS 11.3 64 bit | Intel Core2 Quad Q8300@2.50GHz | KDE 4.6.4 | GeForce
9600 GT | 4GB Ram
Eee PC 1201n: oS 11.4 64 bit | Intel Atom 330@1.60GHz | KDE 4.6.4 | nVidia
ION | 3GB Ram

Unfortunately its easier typed than done.

I have tried that. I can’t get it to work. I will not waste any more time on this , as it is simply too sensistive to syntax or there is another reason.

But for the record, I created the file /home/mrscpu/bin/thaikeyboard.sh


#!/bin/bash
# oldcpu hack to provide switch between us and thai keyboard
setxkbmap -option grp:switch,grp:alt_shift_toggle,grp_led:scroll us,th
# end of hacked script

which if run directly works.

I then created /home/mrscpu/.config/autostart/thai.desktop with content


[Desktop.Entry]
Encoding=UTF-8
Name=StartThaiKeyboard
Comment=Starts-Thai-keyboard
Exec=/home/mrscpu/bin/thaikeyboard.sh
MimeType=text/plain
Terminal=false
Type=Application

It does not work upon restart. I tried many different file name combinations, different contents inside the .desktop file, etc …

I’m simply spinning my wheels. So I will stop now, as spinning wheels is a total time waster and only leads to frustration.

I’ve been surfing a LOT on this, with many solutions in other LXDE distribtions. NONE of which have worked for me with openSUSE.
I think I will have to get help from the packager, or from someone who has done this on LXDE on openSUSE.

I could easily be making an obvious mistake, but now I am tired and blind to any errors.

Thanks for the post.

I walked away, had a drink, ate some yogurt, and looked at this again, and my syntax error hit me.

I was using:

[Desktop.Entry]

instead of

[Desktop Entry]

I need to go back and see where the ’ . ’ came from. Dirt on the screen ? Or someone else’s error I copied ?

My guess is, dirt on the screen.

I replaced the ’ dot ’ with ’ space ’ and it worked.

:slight_smile:

I fact I simplified the thai.desktop file to:


[Desktop Entry]
Type=Application
Exec=/home/mrscpu/bin/thaikeyboard.sh

It works nicely now :slight_smile: I will provide a screen print.

Again, thanks for the help ! …my syntax error was frustrating me !

This is the right corner of the LXDE desktop with US keyboard selected:
http://thumbnails41.imagebam.com/13816/f69a23138157042.jpg](ImageBam)

This is the right corner of the LXDE desktop when selecting the Thai keyboard:
http://thumbnails46.imagebam.com/13816/02db84138157043.jpg](ImageBam)

and this is the right corner of the LXDE desktop after selecting the Thai keyboard and replacing the english language text with some random Thai characters from the keyboard.
http://thumbnails49.imagebam.com/13816/c5661e138157044.jpg](ImageBam)

oldcpu wrote:

> [Desktop.Entry]
This needs to be [Desktop Entry], no dot in it.


PC: oS 11.3 64 bit | Intel Core2 Quad Q8300@2.50GHz | KDE 4.6.4 | GeForce
9600 GT | 4GB Ram
Eee PC 1201n: oS 11.4 64 bit | Intel Atom 330@1.60GHz | KDE 4.6.4 | nVidia
ION | 3GB Ram

Glad to see it works, the screenshots look good, I am afraid my thai is not
good enough to read it :wink:


PC: oS 11.3 64 bit | Intel Core2 Quad Q8300@2.50GHz | KDE 4.6.4 | GeForce
9600 GT | 4GB Ram
Eee PC 1201n: oS 11.4 64 bit | Intel Atom 330@1.60GHz | KDE 4.6.4 | nVidia
ION | 3GB Ram