:0 A local /usr/X11R6/bin/X :0 :1 B local /usr/X11R6/bin/X :1 :2 C local /usr/X11R6/bin/X :2 :3 D local /usr/X11R6/bin/X :3
In theory, most of configurations here should work for any Linux distribution. This is configured for RedHat 6.0 though. RedHat 6.0 uses gdm instead of xdm when it starts its graphical login screen. However, I haven't got gdm to work in the exact way I want it, even though it seems much better than xdm. Once I figure out a few things, I will write a brief article on gdm also.
Here are some things to note ,
Here is the goal, I want to change xdm to make it so it has xeyes, santa, a clock, a graphics image, and my choice of background color on the desktop before someone logs in. After they log in, I want santa to die. Cruel huh?
Okay, let us do this in order:
#!/usr/bin/perl @Files = </etc/X11/xdm/graphics/*.gif>; #print @Files; $Length = @Files; $Seconds = `date +%S`; chomp $Second; $Frac = $Seconds/60; if (!($Frac > 0)) {$Frac=1} $Random = $Frac*$Length; ($Random,$Junk) = split(/\./, $Random,2); if (($Random < 1) || ($Random > $Length -1)) {$Random = 1} $File = $Files[$Random]; $Rand2 = rand $Length; ($Rand2,$Junk) = split(/\./, $Rand2,2); $Random = $Random + $Rand2; if ($Random > $Length - 1) {$Random = $Random - $Length + 1;} #print "$Length $Random $File\n"; if (-e "/etc/X11/xdm/xdm_front.gif") {system "rm /etc/X11/xdm/xdm_front.gif"} if (@Files < 1) { ## Some sort of error messege should be here. } else {system "ln -s $File /etc/X11/xdm/xdm_front.gif";}
#!/usr/bin/perl ### I had to add the -a option between RH 5.2 and 6.0 @Temp = `cd /proc; grep -a ^/usr/X11R6/bin/xsnow /proc/[0-9]*/cmdline`; if (@Temp > 0) { $Xsnow = shift @Temp; ($Junk,$ProcJunk,$No,$RestOfJunk) = split(?/?,$Xsnow); ## I am really paranoid that I want to kill the right pid if (($No > 0) && ($Xsnow =~ ?^/proc/$No/cmdline:/usr/X11R6/bin/xsnow?)) { # system "echo \"Killing pid $No for Xsnow.\n\" > /tmp/1.txt\n"; system "kill $No"; } }
#!/bin/sh # $XConsortium: Xsetup_0,v 1.3 93/09/28 14:30:31 gildea Exp $ /usr/X11R6/bin/xconsole -geometry 480x130-0-0 -daemon -notify -verbose -fn fixed -exitOnFail #/usr/X11R6/bin/xbanner ### Santa and snowflakes ### On some installs, I am missing xsnow for some reason. /usr/X11R6/bin/xsnow -snowflakes 50 -santa 2 -unsmooth & ### Load the random image /usr/bin/X11/xloadimage -onroot -at 1,210 /etc/X11/xdm/xdm_front.gif -border brown & ### A clock would be nice to see /usr/X11R6/bin/xclock -digital -update 1 -fn -adobe-times-medium-i-normal--34-240-100-100-p-168-iso8859-1 -geometry +410+1 & ### Let us turn on xeyes /usr/X11R6/bin/xeyes -geometry +410+100 &
! $XConsortium: Xresources /main/8 1996/11/11 09:24:46 swick $ xlogin*login.translations: #override\ CtrlR: abort-display()\n\ F1: set-session-argument(failsafe) finish-field()\n\ Ctrl Return: set-session-argument(failsafe) finish-field()\n\ Return: set-session-argument() finish-field() xlogin*borderWidth: 3 xlogin*geometry: 400x200+1+1 xlogin*greeting: CLIENTHOST xlogin*namePrompt: login:\040 xlogin*fail: Login incorrect #ifdef COLOR xlogin*greetColor: CadetBlue xlogin*failColor: red *Foreground: black *Background: #fffff0 #else xlogin*Foreground: black xlogin*Background: white #endif XConsole.text.geometry: 480x130 XConsole.verbose: true XConsole*iconic: true XConsole*font: fixed Chooser*geometry: 700x500+100+100 Chooser*allowShellResize: false Chooser*viewport.forceBars: true Chooser*label.font: *-new century schoolbook-bold-i-normal-*-240-* Chooser*label.label: XDMCP Host Menu from CLIENTHOST Chooser*list.font: -*-*-medium-r-normal-*-*-230-*-*-c-*-iso8859-1 Chooser*Command.font: *-new century schoolbook-bold-r-normal-*-180-*
All you have to do is add "/etc/X11/xdm/KillXsnow & " as the first command in the file. Mine looks like this,
#!/bin/sh # Assign ownership of the console to the invoking user # $XConsortium: GiveConsole,v 1.2 93/09/28 14:29:20 gildea Exp $ # By convention, both xconsole and xterm -C check that the # console is owned by the invoking user and is readable before attaching # the console output. This way a random user can invoke xterm -C without # causing serious grief. /etc/rc.d/rc.change_graphic & /etc/X11/xdm/KillXsnow & chown $USER /dev/console /usr/X11R6/bin/sessreg -a -w "/var/log/wtmp" -u "/var/run/utmp" \ -x "/etc/X11/xdm/Xservers" -l $DISPLAY -h "" $USER
/etc/rc.d/rc.change_graphic
I will explain GDM next time. Gdm has the nice capability of letting you choose which desktop environment you want. In RedHat 6.0, you can choose KDE, GNOME, or other desktop environments when you login, which is pretty cool. Overall, I give gdm a B+, and if it becomes better documented, an A. Again, I hope to make an article about gdm for the August issue.