LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 09-27-2010, 09:50 AM   #1
slackman77
LQ Newbie
 
Registered: Sep 2010
Posts: 10

Rep: Reputation: 0
dual keyboard input (2 language) in X (xorg.conf)


I need to set 2 language options for Xorg, I did this on Suse 11.1, but when they changed to remove the xorg config file, and other changes I am now back to using Slackware.

Currently running Slackware 13.1 full install from DVD.
System is AMD 64 Phenom II quad-core.

currently my xorg.conf file I have:

Section "InputDevice"
#Testing
Identifier "Keyboard0"
Driver "kbd"
Option "XkbRules" "xorg"
Option "XkbLayout" "us,th"
Option "XkbOptions" "grp:alt_shift_toggle"
EndSection

But the keyboard layout switch function does not work.
Already installed Thai fonts and added the font directories to the config file as well. They display fine, not sure what I am doing wrong here though. It seems Slackware does not come with any default Thai lang. support but that should not prevent this from working.

Any suggestions would be appreciated.
 
Old 09-27-2010, 10:28 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

Shouldn't that be:
Option "XkbOptions" "grp:switch,grp:alt_shift_toggle"

If you want to let the Scroll Lock LED indicate th is active:
Option "XkbOptions" "grp:switch,grp:alt_shift_toggle,grp_led:scroll"

Hope this helps.
 
Old 09-27-2010, 11:41 AM   #3
slackman77
LQ Newbie
 
Registered: Sep 2010
Posts: 10

Original Poster
Rep: Reputation: 0
(current xorg.conf file) actually the spacing is right in my file but does not display on the forum correctly

Section "InputDevice"
#Testing
Identifier "Keyboard0"
Driver "kbd"
Option "XkbRules" "xorg"
Option "XkbLayout" "us,th"
Option "XkbOptions" "grp:switch,grp:alt_shift_toggle,grp_led:scroll"
EndSection


Thanks for pointing the "switch" out. Still a no-go though. Maybe something else I am forgetting....?
How do I use other key combos? Is there a list of command names that are excepted in the xorg.conf? Ultimately if the regular alt-shift works that is fine, but it would be better to use "~" instead (only 1 key)

Is the Rules option necessary [Option "XkbRules" "xorg"] because it is not in the default xorg.conf file. Also Layout language should be two letter abbreviation but is is Capital or lowercase?
 
Old 09-27-2010, 12:17 PM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

The Option "XkbRules" "xorg" line and a missing Option "XkbModel" "pc104" (pc104 being an example) was what I first noticed.

BTW: The XKB Configuration Guide

Hope this helps.
 
Old 09-27-2010, 12:43 PM   #5
slackman77
LQ Newbie
 
Registered: Sep 2010
Posts: 10

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by druuna View Post
Hi,

The Option "XkbRules" "xorg" line and a missing Option "XkbModel" "pc104" (pc104 being an example) was what I first noticed.

BTW: The XKB Configuration Guide

Hope this helps.
Ok thanks!

For some reason editing the config did not work, but the command line did!

#setxkbmap -rules xorg -model logic -layout "us,th" \ -option "grp:alt_shift_toggle"

If all else fails I will just make a shell script to fix this problem I am having with xorg

Thanks for the help!!
 
Old 09-27-2010, 12:49 PM   #6
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
You're welcome
 
Old 09-27-2010, 12:51 PM   #7
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556
If need be, you could put that line into your /etc/X11/xinit/xinitrc file (whichever one you're using, or the .xinitrc in your home directory if you have one there) or into your ~/.xsession file if you have one, rather than making a new script somewhere.

You'd need to check the manpage(s) for X to see which location is the "proper" one; on my machine, I have items like that in my /etc/X11/xinit/xinitrc file, but I tend to sometimes not do things exactly as they are intended to be done, so if you want to do it the 'right' way, read a little bit to see where that *should* go.
 
Old 09-28-2010, 07:12 AM   #8
slackman77
LQ Newbie
 
Registered: Sep 2010
Posts: 10

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by GrapefruiTgirl View Post
If need be, you could put that line into your /etc/X11/xinit/xinitrc file (whichever one you're using, or the .xinitrc in your home directory if you have one there) or into your ~/.xsession file if you have one, rather than making a new script somewhere.

You'd need to check the manpage(s) for X to see which location is the "proper" one; on my machine, I have items like that in my /etc/X11/xinit/xinitrc file, but I tend to sometimes not do things exactly as they are intended to be done, so if you want to do it the 'right' way, read a little bit to see where that *should* go.
Well now a new problem:
when I use the command line:
setxkbmap -rules xorg -model pc104 -layout "us,th" \ -option "grp:alt_shift_toggle"

or
setxkbmap -rules xorg -model logic -layout "us,th" \ -option "grp:alt_shift_toggle"

The arrow keys stop working properly!

Also adding this to any of the initrc files under X11 does not work (script does not initiate for some reason, I will put it somewhere else once it works )
now I am back to square one, unless I find a command that gives me full function (I like using the arrow keys for scrolling) Maybe I will have to buy a new keyboard (new logitech, instead of this no name one), but think this one should work since my wife used it in Windows with dual function capability.

If only I could recover the lost Hard Disk with my old configuration, I might have a clue (I saved backups of my config files since it was hard to remember, but lost the drive due to it being an external and the PS failed).

Any suggestions or places to find more info on my problem would be greatly appreciated.....

Last edited by slackman77; 09-28-2010 at 07:14 AM.
 
Old 09-28-2010, 07:42 AM   #9
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556
I don't have a solution to the bit about the arrow keys not working. But a suggestion maybe, would be to add a -variant option? Perhaps your arrow keys are mapped and working, but they aren't mapped to the right keys.. Pure speculation!
But have a look at section 2.2 and 2.3 at that guide linked to by Druuna above. Also in there, it shows the -layout options in lowercase, so if that document is accurate, you're fine there.

What kind of keyboard is this anyhow? Have you got a make & model of it?


I'm also curious - are the back-slashes necessary in that commandline? Or is it just that you were entering it on a commandline in two lines, rather than a single line?
 
Old 09-28-2010, 09:20 AM   #10
diwljina
Member
 
Registered: Jun 2009
Distribution: Slackware, Debian
Posts: 111

Rep: Reputation: 8
I just put
Code:
setxkbmap -option grp:switch,grp:alt_shift_toggle,grp_led:scroll us,rs,si
in one of my startup scripts (e.g. ~/.config/lxsession/LXDE/autostart in LXDE) and everything works fine. No "-model" or "-rules" entries.
 
1 members found this post helpful.
Old 09-28-2010, 09:25 AM   #11
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556
Nice! I'm sure someone besides yourself will find this helpful - hopefully the OP!.

Best regards!

Last edited by GrapefruiTgirl; 09-29-2010 at 05:10 AM. Reason: I had thought the above post was by the OP - as such my comments didn't quite make sense.
 
Old 09-28-2010, 11:26 PM   #12
slackman77
LQ Newbie
 
Registered: Sep 2010
Posts: 10

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by diwljina View Post
I just put
Code:
setxkbmap -option grp:switch,grp:alt_shift_toggle,grp_led:scroll us,rs,si
in one of my startup scripts (e.g. ~/.config/lxsession/LXDE/autostart in LXDE) and everything works fine. No "-model" or "-rules" entries.

Yep, that seems to work! Was going to remove those options about layout since they were not in my xorg.conf anyway. Thanks for your help!

Now I will mess with some init scripts to get this on auto.
 
Old 09-29-2010, 09:18 AM   #13
slackman77
LQ Newbie
 
Registered: Sep 2010
Posts: 10

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by diwljina View Post
I just put
Code:
setxkbmap -option grp:switch,grp:alt_shift_toggle,grp_led:scroll us,rs,si
in one of my startup scripts (e.g. ~/.config/lxsession/LXDE/autostart in LXDE) and everything works fine. No "-model" or "-rules" entries.
where are your startup scripts? I just created an rc.d script but it only works in regular user mode and not in root for some reason?? Not really a problem but I would much rather things work through the xorg.conf the way they are "supposed to"??

So for now I have a temporary fix (prob. not politically correct):

made rc script I named "rc.thai" in the /etc/rc.d/ directory the rc.thai script calls the "setxkbmap -option grp:switch,grp:alt_shift_toggle,grp_led:scroll us,th" command and then I added the rc.thai script to the end of my rc.M file (my default run level)

This works but like I said it is a bit too much trouble, it would have saved me a whole lot of effort if the xorg.conf file editing actually worked, still puzzled as to why it doesn't....

Anyway thanks for the help everyone. I think we should leave this open to more inputs though as the real root of the problem (xorg.conf) still does not work with this option. I wonder if anyone else running Slackware 13.1 has this problem.....?
 
Old 09-29-2010, 11:54 AM   #14
diwljina
Member
 
Registered: Jun 2009
Distribution: Slackware, Debian
Posts: 111

Rep: Reputation: 8
Well, I guess that your way is just as good as any other. There's more than one way to skin a cat in linux. I personally like to make any customization in my user config files (that way I don't lose it after reinstall), so if I were using KDE (like you probably), I would write that line in some script and put it in ~/.kde/Autostart

As for xorg... This is from my old xorg.conf (slack 12.2 I believe) and that worked for me. As I can see only thing thats different from your is addition of keyboard model and identifier is Keyboard1 instead of Keyboard0.
Code:
Section "InputDevice"

    Identifier  "Keyboard1"
    Driver      "kbd"

    Option "XkbRules"   "xorg"
    Option "XkbModel"   "pc105"
    Option "XkbLayout"  "us,rs,si"
    Option "XkbOptions" "grp:switch,grp:alt_shift_toggle,grp_led:scroll"

EndSection
Don't know if that helps.
 
1 members found this post helpful.
Old 09-29-2010, 12:08 PM   #15
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
@OP
X use hal in Slackware, so you have to use /etc/hal/fdi/policy/10-keymap.fdi for the keyboard configuration. If you don't have that file, copy it from /usr/share/hal/fdi/policy/10osvendor/10-keymap.fdi and edit the varous <merge key=...> tags, to look like:
Code:
      <merge key="input.xkb.rules" type="string">base</merge>
      <merge key="input.xkb.model" type="string">evdev</merge>
      <merge key="input.xkb.layout" type="string">us,th</merge>
      <merge key="input.xkb.options" type="string">grp:ctrl_shift_toggle,grp_led:scroll,compose:ralt,terminate:ctrl_alt_bksp</mer$
      <merge key="input.xkb.variant" type="string" />
Of course you need to exit X and restart hald
Code:
/etc/rc.d/rc.hald restart
If you want to go with the traditional xorg.conf options, you need to add in xorg.conf
Code:
Section "ServerFlags"
     Option "AutoAddDevices" "0"
     Option "AllowEmptyInput" "0"
     Option "AutoEnableDevices" "0"
EndSection
Regards
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Xorg 1.6.5: can't find the xorg.conf file to configure keyboard. dreamwalking Linux - Newbie 16 12-19-2009 08:24 AM
Input Devices not working with xorg.conf multiseat setup ignisuti Linux - Desktop 4 12-09-2009 11:14 PM
Strange keyboard input issue in Xorg kalevionni Linux - Newbie 1 02-24-2009 11:52 PM
help with /dev/input/ & xorg.conf adamruss Linux - Hardware 2 08-13-2007 06:22 PM
Switching input keyboard language in Linux fabianrios Linux - Software 3 09-15-2005 04:46 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 03:42 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration