[TAG] 2-cent tip: Experimenting with window managers
Thomas Adam
thomas_adam at bonbon.net
Thu Jul 15 18:15:42 MSD 2004
On Thu, 15 Jul 2004 09:29:17 -0400
Ben Okopnik <ben at callahans.org> wrote:
> trying to actually change (or add) a WM to the [xkg]dm system is a
> bloody nightmare, for which I hope some evil bastard rots in hell.
That's why defining a ~/.xsession removes the need to order a toupee.
> There are no instructions anywhere that I could find; the X startup
> mechanism itself involves *at least* twenty different shell scripts
> and sourced files, scattered through /etc/X11 and /usr/lib (I gave up
> after parsing the arcane syntax of that many); neither
> "/etc/alternatives/x-window-manager" nor
> "/etc/X11/default-display-manager" have any actual use or meaning;
Actually, they do. If we take xdm as the example here (although all DMs
go through the same process), what happens is as soon as you press enter
to login, the file /etc/X11/xdm/Xsession is sourced (sourced, for
obvious reasons, as you are fully aware, Ben :))). This actually calls
the main file /etc/X11/Xsession. The job of this file is to kickstart X,
and sources the files in /etc/X11/Xsession.d
The files in this directory are structured similarly to how init files
are -- they have a number prefix which denotes the order that they're to
be sourced. Now, the debian bit that comes into play here (and which
confuses many) is the part about "update-alternatives". Since it is at
this point, that the alternative "x-termianl-emulator" is looked for,
and launched. By default, this is an xterm.
Next to run, is a script that sets up ones xrdb database, so that any
xresources that might have been defined for applications are sourced.
Following that, is the wrapper script that looks for a user-defined
configuration file (~/.xsession), or whether we have to default back to
a global one. They key to note here is that user-defined is looked for
before global. If it is found, then a variable (STARTUP) is set
accordingly, else the default is used.
When that has been done (I'll skip the boring stuff such as Xprint
server running), the last scriot to run is an exec call is made to
$STARTUP.
As to how "x-window-manager" is used, that is defaulted to for $STARTUP
when a user config file is not found.
> Oh, nice! That sounds even simpler, since there's no need to disable
> the DM. Wanna combine tips, then? All you'd need to do is stick that
> chooser mechanism of mine in place of the 'exec WM' bit in yours.
Ok. :)
-- Thomas Adam
--
"Programming in Ruby is like being hugged." -- Greg McIntyre, Ruby
programmer.
More information about the TAG
mailing list