[xubuntu-users] startup applications in correct order

Chris Green cl at isbd.net
Thu Feb 16 12:46:55 UTC 2012


On Thu, Feb 16, 2012 at 12:12:59PM +0000, Joshua O'Leary wrote:
> On 16/02/12 11:05, Wybo Dekker wrote:
> >Is there a way to have applications start up in a predefined order?
> >For example: devilspie should start earlier than all others, in order to
> >get the others at their correct positions and workspaces.
> >I tried to rename .config/devilspie.desktop to 01-devilspie.desktop,
> >with no success.
> >Or is there a better alternative for using devilspie?
> Hi,
> 
> You could add devilspie.desktop to /etc/xdg/autostart and see if
> that makes it come on earlier. Then it will be system-wide, and
> should come in before programs linked in ~/.config/autostart.
> 
This is an everlasting problem, I've raised it before and not really got
any very useful answers.  I did use devilspie for a while but it doesn't
*really* do what I (and it looks like a few others) want.

What I have done is to use wmctrl and a 'waitFor' script that waits for
a specific command to start so I have a script called from .xprofile
that is as follows:-

    #!/bin/bash
    #
    # Run in the background from .xprofile
    #
    #
    #
    # First wait for xfwm4 to start
    #
    /usr/local/bin/waitFor xfwm4
    #
    #
    # Now start all the terminals
    #
    /usr/bin/xfce4-terminal --title=Windows --geometry=100x32+0+0 \
     --window --title="Dev A" --geometry 100x30+0+0 \
     --window --title="Dev B" --geometry 100x30+0+600 \
     --window --title=Browser --geometry 100x32+0+0 \
     --window --title=General --geometry 160x60+0+0 \
     --window --title=Mail --geometry 100x65+120+0 \
     --window --title=News --geometry 100x65-0+0 &
    #
    #
    # Get the window list using wmctrl and wait until Mail appears
    #
    while true
        do
            string=`wmctrl -l 2>&1`XXX
            echo `date --rfc-3339=ns` >>/home/chris/tmp/log
            echo $string >>/home/chris/tmp/log
            if [[ $string =~ Mail ]];then
                break
            fi
        done

    #
    #
    # Mail is up, move all the others to the right places
    #
    wmctrl -r "Windows" -t 4
    wmctrl -r "Dev A" -t 3
    wmctrl -r "Dev B" -t 3
    wmctrl -r "Browser" -t 2
    wmctrl -r "General" -t 1
    wmctrl -r "News" -t 0
    wmctrl -r "Mail" -t 0
    exit

This is total overkill really but there appears to be no easy way to do
something like this with 'modern' tools.  It's as easy as pie with
something like fvwm2 as your window manager.

What's needed is a 'hook' from xfwm to run a script after the necessary
bits of xfce are working.

-- 
Chris Green




More information about the xubuntu-users mailing list