Results 1 to 9 of 9

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

  1. #1
    Join Date
    Mar 2008
    Location
    Phuket, Thailand
    Posts
    26,569
    Blog Entries
    38

    Default 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
    Code:
    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
    Code:
    -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
    Code:
    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 ?

  2. #2
    Join Date
    Feb 2010
    Location
    Germany
    Posts
    4,654

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

    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

  3. #3
    Join Date
    Mar 2008
    Location
    Phuket, Thailand
    Posts
    26,569
    Blog Entries
    38

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

    Quote Originally Posted by martin_helm View Post
    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?
    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.

  4. #4
    Join Date
    Feb 2010
    Location
    Germany
    Posts
    4,654

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

    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
    Code:
    [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

  5. #5
    Join Date
    Mar 2008
    Location
    Phuket, Thailand
    Posts
    26,569
    Blog Entries
    38

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

    Quote Originally Posted by martin_helm View Post
    The lxde wiki just says:
    "Add a .desktop file to your ~/.config/autostart directory (create one if
    not available)." Autostart - LXDE.org
    Code:
    [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.
    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
    Code:
    #!/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
    Code:
    [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.

  6. #6
    Join Date
    Mar 2008
    Location
    Phuket, Thailand
    Posts
    26,569
    Blog Entries
    38

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

    Quote Originally Posted by oldcpu View Post
    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 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:
    Code:
    [Desktop.Entry]
    instead of
    Code:
    [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.



    I fact I simplified the thai.desktop file to:
    Code:
    [Desktop Entry]
    Type=Application
    Exec=/home/mrscpu/bin/thaikeyboard.sh
    It works nicely now I will provide a screen print.

  7. #7
    Join Date
    Mar 2008
    Location
    Phuket, Thailand
    Posts
    26,569
    Blog Entries
    38

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

    Quote Originally Posted by oldcpu View Post
    It works nicely now 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:


    This is the right corner of the LXDE desktop when selecting the Thai keyboard:


    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.

  8. #8
    Join Date
    Feb 2010
    Location
    Germany
    Posts
    4,654

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

    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

  9. #9
    Join Date
    Feb 2010
    Location
    Germany
    Posts
    4,654

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

    Glad to see it works, the screenshots look good, I am afraid my thai is not
    good enough to read 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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •