# xorg wont find my correct keyboard layout.-



## Cmay (Dec 10, 2011)

I installed freeBSD FreeBSD and wanted to have twm as window manager in a minimalistic install that does have a WM so I counted on after install when everything works without X, I thought mouse and keyboard working without X in console that it should also give me the right keyboard layout when I startx but it does not do that. 

I would be very happy if someone could help me sort this problem out. I followed no guides as such but done some installs in the past that did work but on standard computers and no laptops before. I tried putting the line danish.is in my .xinitrc but that does nothing after starting X on an xterm, tried *setxkbmap dk* but that does not work either. 

Can anyone help me get this working?

thanksÂ·


----------



## wblock@ (Dec 10, 2011)

The Handbook X11 Configuration chapter talks about layout.  It looks like you're close, just need to specify that it's the layout being changed:
`$ setxkbmap -layout dk`
Might need the keyboard model also.


----------



## Cmay (Dec 10, 2011)

wblock@ said:
			
		

> The Handbook X11 Configuration chapter talks about layout.  It looks like you're close, just need to specify that it's the layout being changed:
> `$ setxkbmap -layout dk`
> Might need the keyboard model also.



Thanks. that worked   Shall I have to make the settings system-wide by using the root's .xinitrc or will I have to set up a .xinitrc for every user I might add on the system? So far only me but I am thinking about making some extra accounts for family members. 

I am really happy now.  I've been using DesktopBSD and PC-BSD in the past and also had a couple of working FreeBSD 6.1 installations, but I honestly did not remember all the configurations I had to make. Usually I've been using Openbox but twm seems more easy to use, though not as pretty  

I found a  guide for setting up KDE and just excluded the KDE desktop, might use openbox later. http://www.rhyous.com/2009/12/18/how-to-install-and-configure-a-freebsd-8-desktop-with-xorg-and-kde/

Anyway it works perfectly with the keyboard now, so I can move on getting some sound and get automounting to work.

Thanks a lot


----------



## wblock@ (Dec 10, 2011)

There is a global xinitrc (which I haven't used).  But a better way would be to include the option in xorg.conf keyboard InputDevice section:

```
Option "XkbLayout" "dk"
```

(Untested, I have been lucky enough to hit the jackpot as far as default keyboard layouts are concerned.)


----------



## Cmay (Dec 10, 2011)

wblock@ said:
			
		

> There is a global xinitrc (which I haven't used).  But a better way would be to include the option in xorg.conf keyboard InputDevice section:
> 
> ```
> Option "XkbLayout" "dk"
> ...



I tried both but none saves the layout for everytime I *startx*.  It should work with the option 
	
	



```
"xkblayout" " dk "
```
 as it's the way it looks on my Debian install. Never had to manually configure the layout on linux but the screen though.

What I am maybe able to do is copy the settings from a PC-BSD install, as far as how the keybboard layout is concerned, and try to see what happens when I write that to the options.

Also last resort is to install Openbox and write it in its autostart, as I usually have to do. That's the way I get keyboard layouts working properly in Openbox in the past but recent versions seem to work without that added line to the autostart file.   I was just not so keen on installing any window manager but twm. It's simple and I will need for educational purpose to use the terminal the most anyway.  

Thanks for the help


----------

