How to make program autostart only in GNOME

You can edit the startup object in ~/.config/autostart and add this to the end:

OnlyShowIn=GNOME

It's a poorly named option, but it will cause KDE not to start the application.


I don't have kde installed to verify this but I believe adding the application here: System -> Preferences -> Sessions -> Startup Programs is gnome specific.

If that doesn't work you can always put the program in a wrapper script that checks the value of the environment variable $DESKTOP_SESSION. Something like this:

#!/bin/bash
if [ $DESKTOP_SESSION == "GNOME" ];then
        myApplication
fi

Hope this answers your question!