-   Linux - Newbie (
-   -   Xorg 1.6.5: can't find the xorg.conf file to configure keyboard. (

dreamwalking 12-18-2009 10:58 AM

Xorg 1.6.5: can't find the xorg.conf file to configure keyboard.
Hi all,

I would like help to configure xorg to change keyboard layout.

I just did a fresh install of Debian Squeeze (testing) and X 11.0, xorg 1.6.5 is installed. I need to be able to switch keyboard layout and up to now (in my Lenny/Sid I had previously and all previous versions of Debian I've used), I was able to do it by tweaking the /etc/X11/xorg.conf :


Section "InputDevice"
Identifier "Generic Keyboard"
Driver "kbd"
Option "XkbRules" "xorg"
Option "XkbModel" "pc102"
Option "XkbLayout" "us,el" #xkeymap0
Option "XkbOptions" "grp:alt_shift_toggle"
My problem is that there is no xorg.conf file in any of the usual locations. I created a new one by X -configure, which I copied to /etc/X11/xorg.conf and edited the keyboard section. But xorg doesn't seem to read it and I still can't switch my keyboard layout.

I'm sure I'm missing the obvious here, I would appreciate any help.


kofucii 12-18-2009 02:37 PM

I, don't know how is on Debian, but in new Slackware, the new X doesn't need xorg.conf, sot here is no one. You can add "setxkbmap" command into your .xinitrc file:

setxkbmap -model pc102 -layout us,el -option grp:alt_shift_toggle

dreamwalking 12-18-2009 05:43 PM

Thanks for answering me!

Yes, I remember too reading somewhere that the new X doesn't need xorg.conf. I wonder how are people supposed to configure/customize their settings, though.

Well, by trying to implement your suggestion, I noticed two more things:

1) I don't have .xinitrc
2) Control-Alt-Backspace doesn't kill X anymore!

I wrote a .xinitrc but, apparently, it doesn't get read. I also tried to pass setxkbmap into ~/.profile, but doesn't function either: once I exit the session, it stops working.

So, problem remains the same.

damgar 12-18-2009 06:15 PM

I don't know the answer to your question exactly, but at least in the new Slackware with the new xorg, you CAN create an xorg.conf file and it will be used. It's required for my NVIDIA proprietary driver. On my slack, at least, there is xorgsetup I believe will allow for a remap of the keyboard and set up an xorg.conf file for you. I'm not sure how well it will work, but it's worth a try. You can always just "rm xorg.conf" if it fails to work properly with no ill effects. Of course this has been my experience with slackware_current while trying to sort out a driver issue the last few weeks.

dreamwalking 12-18-2009 06:27 PM

Thanks for your answer, unfortunately there's no xorgsetup or xorgcfg in Debian. I finally solved the problem, but I definitively have to get xorg to read a xorg.conf.

BTW, out of curiosity, does Control+Alt+Backspace kill X in Slackware? I wonder why it stopped doing so in Debian.

Anyway, I solved the problem thanks to this page.

Basically, I created a /etc/hal/fdi/policy/x11-input.fdi file:


<?xml version="1.0" encoding="ISO-8859-1"?>
<deviceinfo version="0.2">
<match key="info.capabilities" contains="input.keyboard">
<merge key="input.x11_options.XkbOptions" type="string">terminate:ctrl_alt_bksp</merge>
<merge key="input.x11_options.XkbModel" type="string">pc102</merge>
<merge key="input.x11_options.XkbLayout" type="string">us,el</merge>
<merge key="input.x11_options.XkbOptions" type="string">grp:alt_shift_toggle</merge>
And now I can switch to Greek keyboard at least in X.

BTW, the terminate:ctrl_alt_bksp option doesn't work :(

Anyway, problem solved and thanks those who answered.

damgar 12-18-2009 06:48 PM

Yes CTRl+ALT+BACKSPACE does kill x. It's a version thing I believe from From a console you can't type
PHP Code:


and bring up a curses based program to modify the xserver?

dreamwalking 12-18-2009 07:02 PM


Originally Posted by damgar (Post 3797353)
Yes CTRl+ALT+BACKSPACE does kill x. It's a version thing I believe from

Interesting. From the second post in this thread:

If you do not have an /etc/X11/xorg.conf file, then your X server needs HAL to run.
Which I assume must be my case? That could be why X does not read the xorg.conf I wrote myself but it does read the hal policy file.


Originally Posted by damgar (Post 3797353)
From a console you can't type
PHP Code:


and bring up a curses based program to modify the xserver?

No, this does not work in Debian (I think). I believe in Etch (not sure) there was the equivalent xorgcfg, but now this doesn't work anymore. It's either you manually edit the xorg.conf file, or you reconfigure the package (dpkg-reconfigure xserver-xorg).

But after reading the thread you linked, it seems I should try and modify hal policies instead of xorg.conf.

damgar 12-18-2009 07:38 PM

My machine doesn't require xorg.conf and doesn't have one if I don't create one, it's actually been very handy for me to troubleshoot issues with the nvidia proprietary driver and kernels from 2.6.31 up locking my machine. After the required hard reset I just rename xorg.conf so I startx with an open source driver. Debian (or actually ubuntu) always confuses me

craigevil 12-18-2009 10:48 PM

dpkg-reconfigure console-setup has an option for ctrl+alt+backspace to kill X

Xorg - Debian Wiki

What if I do not have an xorg config file?

If xorg.conf is missing for some reason, Xorg will probe your hardware on every startup. Though this works fine in most cases, some settings remain inaccessible. To create a starting point for customization, do the following:

Switch to a console as root (not a terminal emulator in X), then run:

/etc/init.d/kdm stop
/etc/init.d/gdm stop
/etc/init.d/xdm stop
cd /etc/X11/
Xorg -configure

Alternatively, reboot the machine in single user mode, then run:

cd /etc/X11/
Xorg -configure

Follow the on-screen instructions. This should give you something to work with.

evo2 12-19-2009 01:42 AM


With Debian these days it is best, IMNSHO, to use the "console-setup" package. Yes, I know that sounds strange since you are asking about X, but if you use this package to set your keyboard on the console, X will automatically use the same settings. So just install the package and answer the config questions it asks you.

I think this has been the situation is sid for about 6 months now.



dreamwalking 12-19-2009 06:05 AM

@ damgar:
Yeah, I've heard Slackware is more straight-forward than Debian. I wouldn't mind to have to create my own xorg.conf file (I did already, actually), but I'm puzzled as to why xorg doesn't read it.
I have configured the xdm to iniciate at startup, so I log in directly in X, but even if I go with startx, xorg.conf still doesn't get read.

@ craigevil:
Thanks for your answer!

dpkg-reconfigure console-setup
gives me only 3 options: "Encoding for the console", "Character set to support" and "Font for the console".
As for the Debian wiki entry, I saw it before posting this thread. My problem is, actually, that X seems to ignore my xorg.conf. However, editing the hald seemed to fix the problem (though ctrl+alt+bksp still doesn't kill X).

@ Evo2:
And now I have Greek on the console, too! Thanks!
(I was initially hesitant to change the default encoding, but it works fine, I can switch easily between Latin and Greek characters)

the trooper 12-19-2009 07:07 AM

I found to re-enable ctrl-alt-bkspce to restart X i had to do the following:


dpkg-reconfigure keyboard-configuration
See if that works for you.

dreamwalking 12-19-2009 07:55 AM

@ the trooper:

It doesn't.
However the /etc/default/keyboard is modified:


# The following variables describe your keyboard and can have the same
# values as the XkbModel, XkbLayout, XkbVariant and XkbOptions options
# in /etc/X11/xorg.conf.

I'm more confused now. Does the new X ignores all the configuration files? Should I stick with the advice of this post ( and only try and edit the hald?

the trooper 12-19-2009 07:59 AM

Did dpkg-reconfigure keyboard-configuration give you the option to use ctrl-alt-bkspce?.
You might also have to restart X.

dreamwalking 12-19-2009 08:10 AM

Yes, it did give me the option and I did restart X. It just doesn't work.

Googling a bit more about this, it seems to be a feature of > 1.5, supposedly to prevent new users from accidentally killing X and lose their work? I still don't get why users that do want this functionality are not given an easy and obvious option to get it.

All times are GMT -5. The time now is 05:49 AM.