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.

I want certain applications (such as indicator-multiload) to run at startup only if I sign into Unity, not GNOME-shell. I also want some other applications to only start in GNOME-shell (like Shutter).

Is there, say, something I can add before the command in "Startup Applications" that does this for me? Or do I need to install some sort of extension?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

This can be a starting point for your question. You can place a conditional statement withing the command to execute field in the Startup Application. This command will check what is the current desktop session and will act based on that. E.g.

if [ "$DESKTOP_SESSION" == "ubuntu" ]; then (echo "Unity"); else (echo "Gnome") ; fi

The condition checks if it is Unity session and prints Unity if true. Otherwise, it will print Gnome.
You can replace the echo commands with any command you wish to execute or omit the else part.
Another example:

if [ "$DESKTOP_SESSION" == "ubuntu" ]; then (shutter); fi

This will run Shutter application only in Unity.

share|improve this answer
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.