Startup/shutdown script - xfce *does* have a reasonable way of doing it

Chris G cl at
Tue Feb 24 11:45:49 CET 2009

On Tue, Feb 24, 2009 at 02:31:34AM -0800, Brian J. Tarricone wrote:
> On Tue, 24 Feb 2009 09:59:22 +0000 Chris G wrote:
> > Well I've found the answer, in fact the answer to this and many of my
> > other 'problems' with xfce.
> > 
> > If you put a file called xinitrc in $HOME/.config/xfce4 it is
> > executed in preference to the default /etc/xdg/xfce4/xinitrc.
> [..]
> > Why didn't anyone tell me about this - it's satisfied nearly all my
> > problems with xfce4.
> Because it's ugly and problematic, and most of how that works will
> drastically change (if not disappear) for 4.8.  (I had hoped to change
> it for 4.6, but ran out of time.)
OK, but presumably there will be *some* sort of similar mechanism in
place won't there?  I very much hope there will as it's something
which is incredibly useful.

In my particular case the requirement was to start up and shut down
VirtualBox automatically, one really can't do this from the session
manager, it's possible to start it up but not shut it down.  From
xinitrc (or something similar) it's trivial.

I agree that the detail of the mechanism is messy, all that copying
around of xinitrc because of places that it *might* have been once. In
addition the user's xinitrc is run *instead* of the system default one
which isn't really the ideal approach.  What one really wants is
simple hooks before and after calling the session manager which call
user scripts (in .config/xfce4) if and only if they exist.

As it is I will just use the existing mechanism by adding a call to my
'start things up after X has come up' script before the session
manager is started and a call to my 'stop things before exiting from
X' script on return from the session manager.  Then if/when the
mechanism changes I can move to the new layout quite painlessly.

As 4.6 hasn't changed I should be alright for quite a while anyway! :-)

Chris Green

More information about the Xfce mailing list