My new xorg.conf
~$ [ -s /etc/X11/xorg.conf ] ; echo $? 1
Yes, it is an empty file! I have just upgraded xorg to the experimental packages. hal does its job, and all devices are automatically detected and configured.
This is actually a great improvement, especially for those who had to fight against the XFree86 configuration file just to get a graphical session working, back in the late 90′s.
The only thing I had to do is creating an /etc/hal/fdi/policy/10-keymap.fdi file with the following contents, so that GDM has a correct keyboard layout (French in my case):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | <?xml version="1.0" encoding="ISO-8859-1"?> <!-- -*- SGML -*- -->
<deviceinfo version="0.2">
<device>
<match key="info.capabilities" contains="input.keymap">
<append key="info.callouts.add" type="strlist">hal-setup-keymap</append>
</match>
<match key="info.capabilities" contains="input.keys">
<merge key="input.xkb.rules" type="string">base</merge>
<!-- If we're using Linux, we use evdev by default (falling back to
keyboard otherwise). -->
<merge key="input.xkb.model" type="string">keyboard</merge>
<match key="/org/freedesktop/Hal/devices/computer:system.kernel.name"
string="Linux">
<merge key="input.xkb.model" type="string">evdev</merge>
</match>
<merge key="input.xkb.layout" type="string">fr</merge>
<merge key="input.xkb.variant" type="string">latin9</merge>
<merge key="input.xkb.options" type="string">compose:lwin</merge>
</match>
</device>
</deviceinfo> |
Well, actually, I had to add:
to my xorg.conf to enable the Ctrl+Alt+Backspace combination again (it is now disabled by default upstream to avoid unwanted behaviour).
You may also get DontZap off by passing -retro to X on the command line. /etc/X11/xinit/xserverrc could be a good place.
By the way, most of your fdi file is probably useless since /usr/share/hal/fdi/policy/20thirdparty/10-x11-evdev.fdi already does everything but setting the layout/variant/options. Only your last 3 merge lines should be needed for now. See http://bgoglin.livejournal.com/16734.html
Indeed, the fdi file only needs:
<?xml version="1.0" encoding="ISO-8859-1"?> <!-- -*- SGML -*- --> <deviceinfo version="0.2"> <device> <match key="info.capabilities" contains="input.keys"> <merge key="input.xkb.layout" type="string">fr</merge> <merge key="input.xkb.variant" type="string">latin9</merge> <merge key="input.xkb.options" type="string">compose:lwin</merge> </match> </device> </deviceinfo>As for disabling DontZap, I think it is easier for me to set it in xorg.conf to be able to switch back to easily the default behaviour.
Cheers,
Julien
Yeah and basically you end up with unreadable XML config instead of readable xorg.conf config. Sure, it’s a progress…
In this case, you only need to change the keyboard layout and the variant. Everything else is working out of the box. I am even able to run a compositing manager (compiz fusion or metacity with compositing enable) without needing to find the good parameters for my intel video card driver.
I guess the next step would be to auto-detect the keyboard layout or change it on the fly (I don’t know if hal paramters can be changed that easily, but as display managers are usually configured in a local language, it would be great that they also set the corresponding default keyboard layout when starting).
Cheers,
Julien
Yeah but that was the case before hal stuff too. Since some time (lenny) it does a good job autodetecting stuff, and you only have to add in xorg.conf what’s missing.
For the dynamic stuff, use libxklavier. At least GNOME and Xfce (4.6) do that, I guess KDE 4 too.
My problem was essentially with gdm, the GNOME sessions were ok.
gdm is quite outdated in Debian, maybe a newer release will be built against libxklavier and fix this issue?
In my case, I still have to have a Virtual line in xorg.conf, because xrandr still can’t resize the initial framebuffer, and Xorg defaults the framebuffer size to the initial resolution.
You can also edit the xorg.conf file directly to include information about keymap.
I did it like this instead of editing a XML file (which i wasn’t aware of…)
Something like:
Section "InputDevice"
Identifier "Generic Keyboard"
Driver "kbd"
Option "XkbRules" "xorg"
Option "XkbModel" "pc105"
Option "XkbLayout" "fr"
Option "XkbVariant" "latin9"
EndSection
And for managing a big virtual screen (2 22″ wide)
Section "Screen"
Identifier "Default Screen"
Monitor "Configured Monitor"
SubSection "Display"
Depth 24
Virtual 3360 1050
EndSubSection
EndSection
er:k, that is the old way to configure it, and it doesn’t work if you are using the default hotplugging/hal/evdev setup of newer X servers.
The thing that really bugs me about this is that the web is full of explicitly conflicting advice on whether to use “input.xkb.layout” style or “input.x11_options.XkbLayout” style. Well, that, and the fact that I can’t get it to work right either way. I have to run setxkbmap.
Note that the input.xkb.options keys are now depreciated.
Use input.x11_options.XkbdXXX instead, as follows:
<?xml version="1.0" encoding="ISO-8859-1"?> <!-- -*- SGML -*- --> <deviceinfo version="0.2"> <device> <match key="info.capabilities" contains="input.keys"> <merge key="input.x11_options.XkbLayout" type="string">fr</merge> <merge key="input.x11_options.XkbVvariant" type="string">latin9</merge> <merge key="input.x11_options.XkbOptions" type="string">compose:lwin</merge> </match> </device> </deviceinfo>