[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Choosing the layout of server X in GDM



Hello !

I have written a snippet of code which could be useful to some of
you. It aims at allowing to choose a server layout at GDM prompt. It
is useful if you want to be able to switch between a single headed
config and a dual headed one.

Your /etc/X11/XF86Config-4 needs to have layout sections like this :

,----
| Section "ServerLayout"
|         Identifier      "Single"
|         Screen          "Screen Alone On DFP"
|         InputDevice     "Laptop Keyboard"
|         InputDevice     "Configured Mouse"
| EndSection
`----

Then, your /etc/gdm/gdm.conf needs to contain one line like this one :

,----
| command=/usr/X11R6/bin/X -layout "Single" -deferglyphs 16 -nolisten tcp
`----

The parameter layout must be present and must be enclosed by quotes.

The script is here :
 <URL:http://www.crans.org/~bernat/layoutchooser.py>

It needs Python and python-gtk2.

The code is commented in French, sorry, mail me if you want some hints
on how it works. The paths are hard coded into the code, look at it
before using the script.

I have put the following lines in /etc/gdm/Init/:0 (which must be set
executable) :

,----
| #! /bin/sh                          
|  
| xautolock -cornerdelay 1 -cornerredelay 3599 -secure -time 3599 \
|           -locker "/etc/gdm/layoutchooser.py" -cornersize 10 \
|           -corners ++++ &
| 
| exec /etc/gdm/Init/Default $*
`----

The script is then launched when you leave the mouse for one second
into one of the corners.

Please, save your /etc/gdm/gdm.conf before testing (the script saves
it but, in doubt...). Oh, and the script is licensed under artistic
license, if such a tiny script can be licensed.
-- 
I WILL NOT BRIBE PRINCIPAL SKINNER
I WILL NOT BRIBE PRINCIPAL SKINNER
I WILL NOT BRIBE PRINCIPAL SKINNER
-+- Bart Simpson on chalkboard in episode 8F03



Reply to: