Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am new to Linux. I installed kubuntu-desktop and xubuntu-desktop over the default Ubuntu 10.10.

I want to unclutter the menu, so that applications related to a particular desktop appear in menu only during their respective sessions. (i.e., No KDE and XFCE apps in menu during Ubuntu GNOME session. Similarly in KDE and XFCE sessions.)

How can this be done via command line? (I want to learn things the command-line way.)
Should I backup anything before I do this?

Extra Information:
I googled and found this and other solutions in forums, but these address only the KDE on GNOME scenario. Perhaps this can be modified to include XFCE as well, but since I am a newbie, I couldn't figure out how to do it.

I have also cross-posted at askubuntu.

Gracias! Thanks!

share|improve this question

The code to show something only in XFCE follows the same idea:


Unfortunately, as far as I know, the way XFCE stores it's .desktop files is the same as the GNOME stores them, whereas KDE stores them in a separate folder (within /usr/share/applications). This is why the separation of KDE/GNOME, as described in the post you link to, is much easier to do en-mass.

All the files are stored in /usr/share/applications. The format of them is very simple, and you can copy any one of them to /home/you/.local/share/applications and it will override that menu entry for that user so you can more easily edit them without needing root privileges.

There is no simple way to separate XFCE apps from GNOME, especially since it's often a matter of opinion what you want to see. This also goes for KDE, since as long as you have the KDE libraries Dolphin or Konqueror will run in GNOME. I suppose if you're intent on using the cmd line you could come up with some grep/sed junk to selectively find and replace text inside certain .desktop files, but I thnk the easiest way would be to copy the files to ~/.local/share/applications so they don't get overwritten by updates and edit them by hand. Unless you've got a gazillion things installed it shouldn't be too difficult.

The menu works under the freedektop.org specification, which you can learn more about here:


share|improve this answer

For Ubuntu 10.10 and older releases

All your preferences will be saved inside the .gconf folder in xml files; you can manually edit those, or use the GUI interface, gconf-editor. The proper way to remove is to use System -> Preferences -> Main menu or the command alacarte

share|improve this answer
GNOME now uses gsettings and dconf to handle such preferences. As such, gconf has been deprecated since 2014 or earlier. More details: Gconf to GSettings migration. – clearkimura Nov 10 '15 at 17:42
The answer was written 5 years ago and may be useful at that time – balki Dec 30 '15 at 5:45
@clearkimura this answer was posted in 2010 when such a warning would have made no sense. Remember that the SE sites are designed to allow editing. Why not suggest the edit instead of leaving a comment to that effect? – terdon Dec 30 '15 at 13:16
@terdon Suggested edit as per advised. From my finding, dconf-tools is made available since Ubuntu 11.04. So I assumed gconf is valid until Ubuntu 10.10 release only. – clearkimura Dec 30 '15 at 15:54

Your Answer


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.