# HAL french keyboard



## Endoril (Oct 1, 2015)

Hi all,

I have an issue to set my keyboard layout in French with X (out of X everything is fine since iI've chosen my layout during installation).

iI have configured .xinitrc, xorg.conf, .login.conf and x11-input.fdi - as described in the handbook  - without success :


```
# 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">fr</merge>
  </match>
  </device>
</deviceinfo>
```


```
# cat .xinitrc
export LANG="fr_FR.ISO8859-1"
export LC_ALL="fr_FR.ISO8859-1"
export LC_MESSAGES="fr_FR.ISO8859-1"
exec mate-session
```


```
# cat .login_conf
me:\
:charset=ISO-8859-1:\
:lang=fr_FR.ISO8859-1:
```

xorg.conf (relevant section):


```
Section "InputDevice"
  Identifier  "Keyboard0"
  Driver  "kbd"
  Option "XkbLayout" "fr"
  Option "XkbModel" "pc105"
  Option "XkbVariant" "pc105"
  Option "XkbOptions" "grp:rctrl_toggle,grp_led:scroll"
EndSection
```

In Xorg logs, iI see Xorg enabling my keyboard, but a few lines later :


```
[  14.873] (WW) Hotplugging is on, devices using drivers 'kbd', 'mouse' or 'vmmouse' will be disabled.
[  14.873] (WW) Disabling Mouse0
[  14.873] (WW) Disabling Keyboard0
```

OK, since I'm using the kbd driver, HAL is disabling keyboard0, but my layout is not configured as described in my x11-input.fdi (_I don't want to disable hotplug, if possible_).

By the way, it is *probably* the same issue described in this thread (marked as solved):

https://forums.freebsd.org/threads/hal-swiss-french-keyboard.50041/

P.S : iI hope that is the good section to post this.

Thanks for answering ! =)


----------



## Endoril (Oct 1, 2015)

Sorry the thread title is not accurate, maybe "hal french keyboard" should be better  (edited) :s


----------



## hukadan (Oct 1, 2015)

Have you tried to put this line in your .xinitrc ?

```
setxkbmap fr
```

---- Edit ----

I do not use Mate so there is maybe a dedicated setting for what you are trying to achieve.


----------



## Endoril (Oct 1, 2015)

Yes iI have tested it too and it does not works (when iI execute this command in root shell the layout is changed, but iI have to login with us layout and `setxkbmap fr` after every re/boot).

iI was thinking this setup was wrong since iI have not see it in documentation.
here is my current .xinitrc:


```
export LANG="fr_FR.ISO8859-1"
export LC_ALL="fr_FR.ISO8859-1"
export LC_MESSAGES="fr_FR.ISO8859-1"
exec mate-session
setxkbmap fr
```


----------



## hukadan (Oct 1, 2015)

Well, you should put the exec(1) command in last position. Also, I guess you came across this Thread mate-desktop-forgets-or-does-not-store-permanently-the-desired-keyboard-layout-howto.53222.

From your .xinitrc file, I assume you launch Mate with startx(1). So unless Mate overwrites this setting, the keymap defined in your .xinitrc file should be used.


----------



## Endoril (Oct 1, 2015)

Adding exec does not change anything. I have not search threads related to MATE cause when starting X (with `startx` command) alone, the issue persists, but iI'll give it a try and came back.


----------



## hukadan (Oct 1, 2015)

Endoril said:


> adding exec does not change anything



I am not sure about what you mean here. Did you try with the following .xinitrc file and it did not work ?

```
export LANG="fr_FR.ISO8859-1"
export LC_ALL="fr_FR.ISO8859-1"
export LC_MESSAGES="fr_FR.ISO8859-1"
setxkbmap fr
exec mate-session
```


----------



## Endoril (Oct 1, 2015)

From Thread mate-desktop-forgets-or-does-not-store-permanently-the-desired-keyboard-layout-howto.53222 i have done the first part :

1. In System-Preferences-Keyboard-Layouts, delete the English Layout and add the desired Language!

But for the second part:

2. Press ALT+F2 and insert "ibus-setup" into the "Run Application" Window, then
move to "Input Method" and delete the English Keyboard-Layout, and:
Add -> Your Favorite Language! Then REBOOT!

Inserting "ibus-setup" give me the following error : Impossible d'ouvrir l'emplacement « file:///home/#USERNAME/ibus-setup »
I can translate this with : Impossible to open location « file:///home/#USERNAME/ibus-setup »

After a reboot:

During login (with slim), keyboard is in us layout (the issue persist)

In MATE, keyboard is in french (so no need to `setxkbmap fr` from now =))
At this point: oh ! you're right, I have modified my .xinitrc in the wrong way (_sorry I have misunderstand you !_).

So, I modify my .xinitrc...


```
$ cat .xinitrc
export LANG="fr_FR.ISO8859-1"
export LC_ALL="fr_FR.ISO8859-1"
export LC_MESSAGES="fr_FR.ISO8859-1"
setxkbmap fr
exec mate-session
```

...and I reboot : same behaviour, login (slim) in us and MATE in fr.

I display the current layout (_I have not tested this command before_):


```
$ setxkbmap -print | grep xkb_symbols
   xkb_symbols  { include "pc+fr+inet(pc105)"   };
```

It seems to be good, but the login part remains problematic.

-- edit --

It's seems you're right from the beginning, MATE was overriding my settings, after configuring it, it is OK. So the real problem (if a real problem exist) is slim.


----------



## hukadan (Oct 1, 2015)

Well, this is not the best solution but the following might work for you until you get a better answer. In the *Section "ServerLayout" *of your xorg.conf add the following line.

```
Option "AutoAddDevices" "Off"
```
Then, if you are using Slim to login, you might want to modify your .xinitrc that way.

```
export LANG="fr_FR.ISO8859-1"
export LC_ALL="fr_FR.ISO8859-1"
export LC_MESSAGES="fr_FR.ISO8859-1"
setxkbmap fr
exec $1
```
So you can choose your windows manager from Slim.


----------



## Endoril (Oct 1, 2015)

Yes disable hotplug can be a workaround (_I have seen this_).

Thanks, I have modified my .xinitrc following your advice.

I have test to add this line in /usr/local/etc/slim.conf as described here https://bbs.archlinux.org/viewtopic.php?pid=756340#p756340


```
xserver_arguments -layout fr
```

But after that X is not working anymore.

From the same thread : https://bbs.archlinux.org/viewtopic.php?pid=780185#p780185

Do you think that modifying my xorg.conf like this can be an option ?


```
Section "InputDevice"
Identifier "Keyboard0"
Driver "devd"
Option "XkbLayout" "fr"
Option "XkbModel" "pc105"
Option "XkbVariant" "pc105"
Option "XkbOptions" "grp:rctrl_toggle,grp_led:scroll"
EndSection
```

I am scared to loose keyboard input (_since the driver is not "kbd", HAL will not disable it, so if this setting is not correct it will break keyboard input_ ?) , so I prefer to ask you first, does it seems to be a good idea (_or absolutely not_)?


----------

