Prevent KDE and Gnome from showing eachothers icons in the menu

gnomeiconskdemenu

Often, I have both KDE4 and Gnome installed on my machines. What really bothers me when I do this, is that the Gnome menu will show all kinds of things that I will hardly ever use in Gnome, like Konqueror, KMail and Konversation. (Just to name a few, the list is obviously much longer.)

I hate this.

I would love a way (an easy way) to make sure Gnome only shows Gnome related icons and KDE only shows KDE related icons. Of course, you can manually hide all the KDE icons from the Gnome menu, but that sucks **, so I'd rather not go that way.

Does any have a solution for this? A script maybe?

Best Answer

The menu entries are created from .desktop-files. There you can specify if the icon shall be only shown in Gnome, only in KDE or in both with e.g. a OnlyShowIn=KDE line.

To hide all KDE-apps, you might do as root

cd /usr/share/applications/kde4/
for i in *.desktop; do echo “OnlyShowIn=KDE” >> $i; done

To hide Gnome-Apps in KDE, echo “OnlyShowIn=GNOME” into the Gnome .desktop-files.

However, when an update to a package arrives, this could override this, so you might to have to repeat it, e.g. with a cron job. Make a backup of /usr/share/applications/kde4/ before doing this to be safe if something goes wrong.

For a list of all information which can be included in a .desktop-file, see http://standards.freedesktop.org/desktop-entry-spec/latest/ar01s05.html

Related Question