I use both GNOME and KDE SC. In GNOME, I use Docky but I do not use it with KDE. So, I would like Docky to start up only when I login into GNOME not KDE. In KDE, there is an option to make a program autostart only in KDE. But I cannot find any such option in GNOME.

How can I do this?

Thanks in advance.

5 Answers 5


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


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:

if [ $DESKTOP_SESSION == "GNOME" ];then

Hope this answers your question!

  • System -> Preferences -> Sessions -> Startup Programs is not gnome specific.
    – ricky
    Aug 5, 2010 at 17:08

If you cannot find the entry that starts a program, you might also find it in /etc/xdg/autostart instead. I know they finally fixed Nautilus automatically starting in KDE using the OnlyShownIn setting. Changing files in this directory is system wide, so you may want to copy the file of the offending application to ~/.config/autostart/

Instead of using OnlyShownIn, you can also us NotShownIn. This can allow you to not something for the one desktop, but show it for all others. For this example, you can load Docky in all desktop managers except KDE, by using the following:


If you don't want it to start on any desktop, you can change it to OnlyShownIn=; Lines in .desktop files are supposed to end with a semicolon. The semicolon is also used to separate values for settings that take more than one value at the same time.

This trick would mean that you have to list every desktop shell you use to keep something from running at all. So using NotShownIn=Unity would be fine if you only have Unity installed, but it would still start if you later installed KDE or Gnome.

If the desktop file in your user autostart folder does not stop an application from starting, you will need to deal with the desktop file in the xdg directory. For this, I would make a backup copy of the file. Instead of copying it with a bak extension, or something standard that may get overwritten later do this for the imaginary application called badapp for this example.

sudo cp /etc/xdg/autostart/badapp.desktop /etc/xdg/autostart/badapp.desktop.stop

You may then edit the original desktop file. If something breaks and you end up starting in a text boot, you can then rename the file back to the original name.

sudo cp /etc/xdg/autostart/badapp.desktop.stop /etc/xdg/autostart/badapp.desktop

Also, the default user autostart folder for KDE is ~/.kde/Autostart/ because KDE does things the KDE way.


System > Preferences > Startup Applications This is the Gnome alternative to the KDE Startup Manager.

  • What Marco said, it is DM specific I think.
    – invert
    Aug 5, 2010 at 12:57
  • Yes but it is not restricted to GNOME only. Applications in there also starts up in KDE.
    – ricky
    Aug 5, 2010 at 17:09

The other way to edit the autostart file is with a line like:


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .