Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

How would you control the order of startup items in Gnome?

For example on my system I have a program called Tilda that requires that Compiz be loaded so that transparency will work, otherwise if it isn't I have to manually close and reopen the program once it is loaded for the transparency to work.

I have tried using the startup applications, and editing the launcher to add sleep 3 && tilda but this doesn't seem to work.

So is there anyway to control the order of startup items so that programs that require compiz or some other feature like the notification area(for dock only setups not using the gnome-panel)?

share|improve this question
add comment

2 Answers

Open gedit (or any other text editor you might like) and paste in the following

#!/bin/bash

while [ -z `pgrep compiz` ]; do
    sleep 5
done

tilda

Save it as .tildastart.sh in your homefolder. Make the script executable (in a terminal you would issue chmod +x .tildastart.sh).

Go to startup applications (System -> Preferences) and add the script.

share|improve this answer
    
You can do this inline with bash -c 'while ...'too. Saves on writing a whole script. Nice idea though. –  Oli Jan 23 '11 at 0:18
add comment

You have the right idea using the command sleep 3 && tilda, but that doesn't work.
If you look in ~/.xsession-errors you probably find the following error message:

sleep: invalid time interval `&&'
sleep: invalid time interval `tilda'
Try `sleep --help' for more information.

This is because the command is not executed like it would be if you ran it from a terminal.
The workaround for this is to change the command to bash -c "sleep 3 && tilda".

More detailed information on session startup ordering: http://ubuntuforums.org/showthread.php?t=1119945.

share|improve this answer
1  
Doesnt that have something to do with runlevels? Cant he tell the Tilda script to start on a particular runlevel ie after Compiz has loaded? –  theTuxRacer Jan 19 '11 at 5:29
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.