XFree Local Multi-User HOWTO – GDM,KDM,XDM Settings

  • Post author:
  • Post category:Sem categoria

Artigo em ingl?s.
Artigo original: http://www.linux.com/howtos/XFree-Local-multi-user-HOWTO/dyn_switch_num_x_serv.shtml

XFree Local Multi-User HOWTO
Prev Chapter 7. Tweaking it Next
7.2. Customising the login screen
7.2.1. Using xdm

Copy /etc/X11/xdm/Xsetup_0 to /etc/X11/xdm/Xsetup_1. For additional X servers, create the file(s) /etc/X11/xdm/Xsetup_[n], where n is the number of the X server starting from 0.

1.

Modify the line containing the background image, to adjust the path to your image for the 2nd X server:

….
if [ -r /usr/share/mdk/backgrounds/default.png -a -x /usr/bin/qiv ]; then
/usr/bin/qiv -z /usr/share/mdk/backgrounds/default.png
else
/usr/X11R6/bin/xsetroot -solid “#21449C”
fi
….

Modified:

….
if [ -r /usr/share/mdk/backgrounds/flower.jpg -a -x /usr/bin/qiv ]; then
/usr/bin/qiv -z /usr/share/mdk/backgrounds/flower.jpg
else
/usr/X11R6/bin/xsetroot -solid “#21449C”
fi
….

You can also specify a different background color, with:

….
#if [ -r /usr/share/mdk/backgrounds/flower.jpg -a -x /usr/bin/qiv ]; then
# /usr/bin/qiv -z /usr/share/mdk/backgrounds/flower.jpg
#else
/usr/X11R6/bin/xsetroot -solid “[your color]”
#fi
….

2.

Comment out the lines which may affect the primary X server, from:

….
if [ -x /etc/X11/xinit.d/numlock ]; then
/etc/X11/xinit.d/numlock &
fi
….

to

….
#if [ -x /etc/X11/xinit.d/numlock ]; then
# /etc/X11/xinit.d/numlock &
#fi
….

3.

Inform xdm about the existence of Xsetup_1 by modifying /etc/X11/xdm/xdm-config:

……
! The following three resources set up display :0 as the console.
DisplayManager._0.setup: /etc/X11/xdm/Xsetup_0
DisplayManager._0.startup: /etc/X11/xdm/GiveConsole
DisplayManager._0.reset: /etc/X11/xdm/TakeConsole
DisplayManager._0.startAttempts: 1
!
……

Modified:

……
! The following three resources set up display :0 as the console.
DisplayManager._1.setup: /etc/X11/xdm/Xsetup_1
DisplayManager._0.setup: /etc/X11/xdm/Xsetup_0
DisplayManager._0.startup: /etc/X11/xdm/GiveConsole
DisplayManager._0.reset: /etc/X11/xdm/TakeConsole
DisplayManager._0.startAttempts: 1
!
……

4.

Repeat the procedure for each additional X server.
5.

Check here for additional customising options: Linux-Journal Issue 68: Linux Apprentice: Customising the XDM Login Screen.

7.2.2. Using kdm

*

I’m not really sure. This area requires feedback.

Modify /usr/share/config/kdm/kdmrc, from:

……
[X-:0-Core]
Authorize=true
AutoLogin1st=true
AutoLoginEnable=false
Reset=/etc/X11/xdm/TakeConsole
Setup=/etc/X11/xdm/Xsetup_0
Startup=/etc/X11/xdm/GiveConsole

[X-:1-Core]
Authorize=true
……

to

……
[X-:0-Core]
Authorize=true
AutoLogin1st=true
AutoLoginEnable=false
Reset=/etc/X11/xdm/TakeConsole
Setup=/etc/X11/xdm/Xsetup_0
Startup=/etc/X11/xdm/GiveConsole

[X-:1-Core]
Authorize=true
#AutoLogin1st=true
#AutoLoginEnable=false
#Reset=/etc/X11/xdm/TakeConsole
Setup=/etc/X11/xdm/Xsetup_1
#Startup=/etc/X11/xdm/GiveConsole

#[X-:1-Core]
#Authorize=true
……

*

Check for additional customising options at the KDE Help Center.

7.2.3. Using gdm

This requires gdmlogin to be used instead of gdmgreater, because using different themes for different displays is not yet implemented in gdm. In case you want to use gdm themes you’ll have the same theme on all displays.

1.

Switch to gdmlogin by making this changes in /etc/X11/gdm/gdm.conf

From:

…..
# Greeter for local (non-xdmcp) logins. Change gdmlogin to gdmgreeter to
# get the new graphical greeter.
Greeter=/usr/bin/gdmgreeter
…..

to

…..
# Greeter for local (non-xdmcp) logins. Change gdmlogin to gdmgreeter to
# get the new graphical greeter.
Greeter=/usr/bin/gdmlogin
…..

2.

Copy the file /etc/X11/gdm/Init/Default to /etc/X11/gdm/Init/:0, and /etc/X11/gdm/Init/:1
3.

Add these lines to use the background that kdm uses (you can use another image file as well, just change the full path to it):

if [ -r /usr/share/mdk/backgrounds/default.png -a -x /usr/bin/qiv ]; then
/usr/bin/qiv -z /usr/share/mdk/backgrounds/default.png
else
/usr/X11R6/bin/xsetroot -solid “#21449C”
fi

You can also specify a different background color, with:

/usr/X11R6/bin/xsetroot -solid “[your color]”

Modified:

/etc/X11/gdm/Init/:0

#!/bin/sh

if [ -r /usr/share/mdk/backgrounds/default.png -a -x /usr/bin/qiv ]; then
/usr/bin/qiv -z /usr/share/mdk/backgrounds/default.png
else
/usr/X11R6/bin/xsetroot -solid “#21449C”
fi
if [ -x /etc/X11/xinit/fixkeyboard ]; then
/etc/X11/xinit/fixkeyboard
fi

exit 0

/etc/X11/gdm/Init/:1

#!/bin/sh

if [ -r /usr/share/mdk/backgrounds/flower.jpg -a -x /usr/bin/qiv ]; then
/usr/bin/qiv -z /usr/share/mdk/backgrounds/flower.jpg
else
/usr/X11R6/bin/xsetroot -solid “#21449C”
fi

if [ -x /etc/X11/xinit/fixkeyboard ]; then
/etc/X11/xinit/fixkeyboard
fi

exit 0

4.

Repeat the procedure for each additional X server, using file(s) /etc/X11/gdm/Init/:[n], where n is the number of the display.
5.

Check here for additional customising options: Gnome Display Manager Reference Manual

7.3. 1st X server configuration file

A small part of the Mandrake init scripts /etc/rc.d/rc.sysinit (you can append it to yours if you are missing something similar):

———————————————————————————–
# (pixel) a kind of profile for XF86Config
# if no XFree=XXX given on kernel command-line, restore XF86Config.standard
for i in XF86Config XF86Config-4; do
if [ -L “/etc/X11/$i” ]; then
XFree=`sed -n ‘s/.*XFree=\(\w*\).*/\1/p’ /proc/cmdline`
[ -n “$XFree” ] || XFree=standard
[ -r “/etc/X11/$i.$XFree” ] && ln -sf “$i.$XFree” “/etc/X11/$i”
fi
done
———————————————————————————–

Move your XF86Config-4 file (the one for standard kernel) to XF86Config-4.standard, create a symbolic link from it to XF86Config-4, and move the XF86Config-4 file (the one for Backstreet Ruby) to XF86Config-4.bruby. For Ruby/Backstreet Ruby kernels, add to the append line in /etc/lilo.conf, or on boot prompt “XFree=bruby”, leave the standard kernel as is.

Results:

Booting with “XFree=standard” or without “XFree=” (boot prompt or lilo.conf) will result in linking XF86Config-4.standard to XF86Config-4; booting with “XFree=bruby” will link XF86Config-4.bruby to XF86Config-4, so in both scenarios XFree can be started with the proper configuration file for the first X server.

And what about the other X servers?

Under a standard kernel you cannot use several independent X servers, so you should use the other XFree configuration files only under Ruby/Backstreet Ruby – there is no need for different configuration files under standard & bruby kernels.

7.4. Number X servers started by Display managers

Here is a modified version of the previous approach. Add this to your init scripts (I bet it’s missing!):

—————————————————————————————
#
#the same like XF86Config but for gdm.conf & Xservers
#
for i in xdm/Xservers gdm/gdm.conf; do
if [ -L “/etc/X11/$i” ]; then
DumbCon=`sed -n ‘s/.*dumbcon=\([0-9]*\).*/\1/p’ /proc/cmdline`
[ -n “$DumbCon” ] || DumbCon=0
[ -r “/etc/X11/$i.$DumbCon” ] && ln -sf “/etc/X11/$i.$DumbCon” “/etc/X11/$i”
fi
done
echo “Setting up display managers for `expr $DumbCon + 1` Xservers”
—————————————————————————————

This will adjust the proper /etc/X11/xdm/Xservers and /etc/X11/gdm/gdm.config according to the boot line argument dumbcon=n (remember n+1= number of X users/sessions).

You have to create the configuration files following these assumptions:

“i” only stands for /etc/X11/xdm/Xserver and /etc/X11/gdm/gdm.conf.

*

“i.0” is used for a single X server, when dumbcon=n is not specified, or dumbcon=0.
*

“i.1” is used by the display manager when dumbcon=1 is specified.
*

“i.2” is used by the display manager when dumbcon=2 is specified.
*

“i.3” is used by the display manager when dumbcon=3 is specified.

…and so on.

Therefore:

*

“i.0” should contain the definition only of your original standard X server.
*

“i.1” should contain the definitions for 2 X servers.
*

“i.2” should contain the definitions for 3 X servers.
*

…and so on.

If you boot without dumbcon=n or with dumbcon=0 (for example a standard kernel), your display manager will start a single X server with the corresponding XF86Config file.

If you start with dumbcon=1 the display manager will automatically start 2 X servers.

If you start with dumbcon=2, when booting is finished you’ll get 3 login prompts on your 3 displays.

Keep in mind that each X server should have it’s own configuration file, and it should be specified in the display manager configuration file properly. Take a look at the configuration files before restarting with an activated display manager and this addition to your init scripts.

This can also be used if you have a single XFree configuration file (see Section 4.6, “For graphic cards without DRI”). In this case you will have to specify the correct layout instead of the correct XFree configuration file.