[nSLUG] Launching various x-clients as part of Xwindows startup (was: nSLUG as incubator for personal project ideas)

Jack Warkentin jwark at bellaliant.net
Fri Dec 21 17:28:37 AST 2012

Hi Cliff

The Xwindows system already has customization mechanisms in place by 
which any number of x-clients may be started up as part of the login 
process. For an overview, see man 7 X, man 1 xinit and man 5 Xsession. 
In Debian, man 7 X comes as part of the xorg-docs-core package, man 1 
xinit come in the xinit package, and man 5 Xsession comes as part of the 
x11-common package.

Man 7 X talks about 2 ways of starting up X. I have used the xinit 
method myself, many years ago, to successfully start up several 
x-clients followed by the window manager. When starting by a display 
manager (eg xdm, gdm3, kdm, lightdm) there can be complications, 
resulting from the different ways that the combination of display 
manager and desktop environment choose to handle startup.

In my case, I use lightdm and Xfce. In this particular combination, I 
had to do two things in order to successfully accomplish what you want. 
First, instead of choosing Xfce as the environment to log into, I had to 
choose default. Second, I had to start Xfce from my .Xsession file, 
which consisted of the following.

#! /bin/bash
# Test
gkrellm &
xeyes &
xfe -iconic &
exec /usr/bin/x-session-manager

This successfully started the 3 x-clients gkrellm, xeyes and xfe, and 
then invoked the x-session-manager, which, as the following show, simply 
starts up Xfce.

$ ll /usr/bin/x-session-manager
lrwxrwxrwx 1 root root 35 2011-05-01 15:19 /usr/bin/x-session-manager -> 
$ ll /etc/alternatives/x-session-manager
lrwxrwxrwx 1 root root 19 2011-05-01 15:19 
/etc/alternatives/x-session-manager -> /usr/bin/startxfce4*

In fact, this looks very much like how one would code the starting up by 

By checking up on the above man pages and investigating how your own 
combination of display manager/desktop environment work together, I hope 
you can come up with a solution to your problem.

I hope this helps. Just ask if you need any clarification.



Cliff Cameron wrote:
> My goofy little mini project that may or may not have started the
> conversation rolling (I can't remember exactly who brought what up first):
> Environment:
> Desktop, Debian or other
> Software:
> Python, preferably 3.x +
> Scope:
> A single script, run at startup, that, when configured correctly, will
> launch and place various programs at specific points across multiple
> monitors (extended desktop).
> Example:
> Dual monitor setup; when the script runs, a browser window opens on
> monitor 0 (preferably "maximized" or resized to fullscreen); a second
> browser opens on monitor 1 (preferably "maximized" or resized to
> fullscreen); contents of browsers' tabs are different in each case, but
> modifying that may not be (easily) possible via python script.
> Desired End Result:
> Turn on computer at beginning of day and have the script launch the
> programs (that are specified in the script) that I use regularly,
> instead of manually launching them individually.
> I got as far as being able to make the script launch browser windows on
> monitor 0 OR monitor 1, but wasn't able to get it to launch a browser
> window on each one at the same time. I'll take a look and see if I can
> find the script, but I believe it was lost to hard drive crash a while back.
> If this could be written in such a way as to make it easy to expand on
> later on (LOTS of comments! I'm an idiot when it comes to programming,
> make no mistake) to include other tasks to launch at startup, that would
> be a bonus.
> Progressing beyond that, I'd like to be able to modify it, and have a
> separate cron job run it for tasks that maybe need to be done every
> other day, or few days, or once  a week or once a month, etc.
> If I'm reinventing the wheel here, and something like this already
> exists, someone let me know!
> On Mon, Dec 3, 2012 at 9:19 PM, Douglas Guptill <dguptill at accesswave.ca
> <mailto:dguptill at accesswave.ca>> wrote:
>     On Mon, Dec 03, 2012 at 08:53:43PM -0400, Ben Armstrong wrote:
>      > We talked at the meeting a lot about the joys and frustrations of
>      > personal projects. We've all had little things on the side, and
>     some of
>      > us slightly bigger things, that have been kicking around as ideas and
>      > have not yet come to fruition. I'd love to hear more about people's
>      > personal projects. If your project has run aground on lack of
>      > inspiration or some intractible technical problem, or just needs
>     a fresh
>      > set of eyes, and you've got the guts to share your (perhaps
>     half-baked)
>      > ideas with the group, don't be shy! Share with us, and maybe we
>     can help
>      > encourage you to continue.
>     I have one.
>     filerunner was discontinued in debian squeeze.  For the lack of a
>     maintainer, and because 'there are many equivalents' - not my comment.
>     I have tried all the equivalents I can find, and found none to my
>     liking.
>     I use filerunner in place of a 'desktop'.
>     So my project would be to re-introduce filerunner into debian.  The
>     problems I see are that I have failed to grasp the intricacies of how
>     to interact with the debian masters.  The technical (programming)
>     issues I could do, easily.  So if, maybe, Ben could help with that
>     high level stuff, I could once again have filerunner on my systems
>     without having to manually install filerunner_2.5.1.orig.tar.gz
>     Regards,
>     Douglas.
>     --
>     Bold character derived from stubborn patience and adversity.
>     _______________________________________________
>     nSLUG mailing list
>     nSLUG at nslug.ns.ca <mailto:nSLUG at nslug.ns.ca>
>     http://nslug.ns.ca/mailman/listinfo/nslug
> --
> "Stat rosa pristina nomine, nomina nuda tenemus."
> +++
> "Carpe Noctem."
> _______________________________________________
> nSLUG mailing list
> nSLUG at nslug.ns.ca
> http://nslug.ns.ca/mailman/listinfo/nslug

Jack Warkentin, phone 902-404-0457, email jwark at bellaliant.net
39 Inverness Avenue, Halifax, Nova Scotia, Canada, B3P 1X6

More information about the nSLUG mailing list