# Turkish Keyboard



## Majorix (Apr 15, 2012)

I have set this line in /etc/rc.conf:

```
keymap=tr.iso9.q
```

Layout is fine when not in X. However, starting with the call to SLiM, GDM or XDM, I am reset to US keyboard layout.

Using LXDE but this is also the case in Gnome.

What can I do?


----------



## Beeblebrox (Apr 15, 2012)

Desktop environments keep their own settings as opposed to xorg (X11).
One solution is to place in .xinitrc of the user:

```
setxkbmap -layout tr
```

Gnome also has its own GUI under System -> Preferences -> Keyboard -> Layouts -> Add


----------



## Majorix (Apr 16, 2012)

Well, if I set this in .xinitrc and reboot, the problem persists. However if I write this in a terminal GUI after I am in X, the layout changes back to Turkish and everything is fine.

So, is there maybe a way to add a command to be executed automatically AFTER I am on X? I always run in single-user mode, if you need to know.

Thanks!


----------



## Beeblebrox (Apr 16, 2012)

Can you please clarify what you mean by:


> I always run in single-user mode


There's no way you could go graphical while in "single user mode" as expressed in FreeBSD terminology.


----------



## Majorix (Apr 16, 2012)

You see, I am still new to FreeBSD and the terms  Just ignore that part of the post, sorry for the confusion.


----------



## Beeblebrox (Apr 17, 2012)

Sure thing.
When you modified .xinitrc it was the one in your user's home folder (~/), right?
`$ vi /home/majorix/.xinitrc`
Not /root or some other user's home (which there are none as you are the only "user")


----------



## Majorix (Apr 17, 2012)

Yes, it is in MY home folder, not root's. I believe SLiM (which I am currently using) needs it to be in the user's home folder, otherwise it wouldn't run.


----------



## kpa (Apr 17, 2012)

I believe the commands should go to ~/.xsession if you log in with xdm(1) or any other similar X session manager.


----------



## Majorix (Apr 17, 2012)

I don't know, I have used this page and it gave me the idea that I needed to edit .xinitrc.


----------



## Beeblebrox (Apr 17, 2012)

That page has several things all mixed-up for optimal confusion.

1. FreeBSD uses sh / csh / tcsh family of shells which uses setenv whereas,
`$ export VARIABLE=value`
is for or bourne, bash, and related shells. Bash is not installed by default it's in the ports if you want to use it. However, you will also have to set your shell as bash for the "export=" command to work.
2. Both ~/.xinitrc and ~/.xsession override environment settings - that's why they don't carry over to graphical window. The syntax of either one does not use setenv or export. You just place the command similar to xorg.conf syntax. Therefore in ~/.xinitrc:

```
setxkbmap -layout tr
```
and NOT

```
export setxkbmap layout=tr
```
Also, Handbook Verse 24.3.6


----------



## Majorix (Apr 17, 2012)

I did NOT use export or setenv. What I have in .xinitrc is identical to what you wrote in your first post.

I still don't have a solution to this


----------



## Beeblebrox (Apr 17, 2012)

You're not providing much info so I'm just shooting in the dark...

1. You did place in /etc/X11/xorg.conf such entry, right?

```
Section "InputDevice"
	Identifier  "Keyboard0"
	Driver      "kbd"
	Option      "XkbModel" "pc105"
        Option      "XkbLayout" "tr"
EndSection
```

2. Have you tried the gnome GUI [Keyboard -> Layouts -> Add] from post #2?


----------



## Majorix (Apr 21, 2012)

@Beeblebrox:
I had no xorg.conf, so I just created one and filled in the values in your post. However this only restricted X from starting.

I decided to try another idea. I found this to work:

```
% cat /usr/local/etc/hal/fdi/policy/x11-input.fdi
<?xml version="1.0" encoding="ISO-8859-1"?>
<deviceinfo version="0.2">
  <device>
    <match key="info.capabilities" contains="input.keyboard">
	  <merge key="input.x11_options.XkbModel" type="string">pc105</merge>
	  <merge key="input.x11_options.XkbLayout" type="string">tr</merge>
    </match>
  </device>
</deviceinfo>
```
Hope this helps others who have the same problem.


----------

