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

modular /etc/X11/Xsession?

While working on my machine, I got annoyed with wdm -- namely that every
time I picked wmaker from the menu (fvwm95 being the default, because my
wife likes it), the next time I logged in, I had to pick it again, and
again, ad nauseum, until I either moved wmaker to the top of
/etc/X11/window-managers (which would stick my wife with wmaker, which
she hates) or created my own .xsession file.

So, I hacked up a replacement Xsession that uses a variation on the
scheme that gnome-session uses (~/.gnome/wm or something like that).

But of course, next time xfree86-common gets updated, I'd have to make
that choice and scan for new stuff. Plus there's that problem with
utilities that would be useful, but difficult for a package to install in
the Xsession file automatically. Why not do a modular Xsession file that
works similar to /etc/init.d/rcS, sourcing files that needed access to
variables, and running those that didn't?

so I did, and strangely enough, it works.

I stripped out all unnecessary stuff from /etc/X11/Xsession (the core
script is now 36 lines long), moved it into scripts in
/etc/X11/Xsession.d, and snagged some of the logic from /etc/init.d/rcS
to do my dirty work.

The result is a modular X startup that has knowledge of the last session
type/window manager the user last used (recorded in ~/.window-manager),
regardless of the login manager.

I also hacked in support for a user app-defaults directory using the
XAPPLRESDIR environment variable, so users can use demand-loaded
.Xdefaults-style configuration for well-behaved apps.

Now, obviously, it works better with a menu-based login manager like wdm,
but it doesn't require it -- S20session.sh will read
/etc/X11/window-managers to find a manager, falls back to twm, and
finally xterm if it can't find anything. Of course, then xterm becomes
the default login session, but that's another kettle of fish. just delete
~/.window-manager or echo another filename there, and it'll work.

Questions? Suggestions? Flames? Should I forward my mods to the X

| Jeff Teunissen -- President, Dusk To Dawn Computing -- d2deek@pmail.net
| Disclaimer: I am my employer, so anything I say goes for me too.     :)
| dusknet.ddns.org is a black hole for email.    Use my Reply-To address.
| Specializing in Debian GNU/Linux	   http://dusknet.ddns.org/~deek/

Reply to: