Inspirated

 
 

July 2, 2009

Workaround for autostarting applications in a particular order on Xfce/GNOME/KDE

Filed under: Blog — krkhan @ 11:04 pm

Among many of freedesktop.org’s vital contributions to GUI computing on POSIX platforms, a divine one has been the uniform specification for automatically launching programs at initiation of a desktop session. Informally put (or theoretically at least), it means that you can add programs to startup in the appropriate settings, and they will be launched automatically at initiation of your session regardless of which desktop environment you use.

It’s been about 4 years since I migrated to Xfce for everyday work and it does come with a basic tool for managing startup entries (accessed through Application Menu > Preferences > Session and Startup). Still, if you need anything more than rudimentary addition/deletion of the entries you’re pretty much out of luck. For example, I wanted to start the applications in a particular order. I don’t know whether GNOME or KDE have the feature yet, but Xfce lacked the support for maintaining any such arrangement. The proper way to deal with the issue would have been to code the feature in the session manager myself, but since I barely get time to even read fortune-mod these days I instead had to rely on an ugly workaround. If you’re in the same sticky situation, here it is: Go to the autostart directory (usually ~/.config/autostart), open the startup script you’re concerned with, and edit the Exec line like this:

Before:
Exec=awn-autostart

After:
Exec=bash -c "sleep 3 && awn-autostart"

The ugliness arises from the fact that the new Exec line is merely launching the program with a delay of 3 seconds. Now, you can add another program with a delay of 4 and it will almost be guaranteed to start after the 3 seconds’ one across all desktop environments. I really hope that the specification itself would be revised soon to provide a uniform way of setting the startup order. But until that gets done, I can thank sleep for making my life simpler.

Tags: , , , , , ,

1 Comment

  1. […] to the easiest — and not perhaps the prettiest — way of launching Fusion Icon with the desktop autostart files. The problem with this method lied in the fact that Xfwm was launched before Fusion, and the […]

    Pingback by HOWTO: Integrate Compiz Fusion with Xfce the right way | Inspirated — October 17, 2009 @ 10:03 pm

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.