Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 5 down vote accepted

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

share|improve this answer
    
B-E-A utiful! The actual syntax seems to be 'OnlyShowIn=' instead of ShowOnlyIn, but you certainly pointed me in the right direction. +1 and accepted for that! Thanks! –  wzzrd Oct 15 '10 at 9:28
    
That's strange. I might have changed recently. In 2007 it still was ShowOnlyIn: redhat.com/archives/rhl-devel-list/2007-July/msg01103.html. I updated my answer to correct it. Thanks. –  fschmitt Oct 15 '10 at 10:03

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.