Manually edit the Xfce menu

July 12, 2006 at 9:43 am | In tips and tricks, xubuntu | 15 Comments

Let’s face it, the built-in Xfce menu editor sucks. It leaves invalid XML and crashes at the oddest moments. If you’re feeling adventurous, you can manually edit the menu yourself. If you’re familiar with XML, this will be easy.

1) Copy Xfce’s default menu into your home folder:

cp /etc/xdg/xfce4/desktop/menu.xml ~/.config/xfce4/desktop/menu.xml

Here’s an overview of how the code works:

<xfdesktop-menu></xfdesktop-menu>: You need these! Otherwise, the menu is not loaded.

<app name="Name in menu" cmd="Command to run" term="false" icon="iconfile" snotify="false" visible="true" />:

To add a shortcut to an application, use <app>.

name tells the menu what the name of your shortcut is.

cmd says what is launched when you click the shortcut.

If you want a shortcut icon, put the full filename of the icon under iconfile.

snotify sets whether or not the program supports startup notification. (You can probably leave this to false.)

visibility tells the menu whether you want to see this shortcut or not. You should leave it to true.

<separator /> : Adds a separator between shortcut items.

<menu name="Name in menu" icon="iconfile" visible="true"></menu> :

This acts the same as app. However, this creates a menu, where you can put more shortcut items within. Make sure that you put </menu> afterwards when you are done!

<title name="Name in menu" icon="iconfile" visible="true" /> : Adds a title to the top of your menu (Where it currently says “Desktop Menu”).

<include type="file" src="menu2.xml" visible="true" /> : Allows you to add another menu file within a menu file. Under src, put the filename of this menu. This can serve as a backup in case one goes corrupt.

<include type="system" style="simple" unique="true" visible="true" /> : This code allows you to put in the system-generated menu. Use this if you want your menu file to be automatically updated when you install a new program.

<!-- 'comment' --> :
Use this to add comments within your menu. This will not show up in the menu. Obviously, replace ‘comment’ with your own comments.

2) Edit the menu:

mousepad ~/.config/xfce4/desktop/menu.xml

The rest is self-explanatory. Scroll down to <xfdesktop-menu>, where the menu starts, and change whatever you see fit. It’s very easy once you get used to it!

15 Comments »

RSS feed for comments on this post. TrackBack URI

  1. Thanks for the useful hints, but having a nice how-to that explains also how to edit the auto-generated menu (Graphics, Multimedia, Network, and so on) would be very handy.

    Thank you!

  2. Programs that require root password cant be accessed for some reason, i dont know how to make it ask for the password. I get the error message: “You must run this program as the root user” when i tried to add Boot Up Manager (BUM)

  3. Oh wait i accidently found the answer whilst browsing /usr/share/menu. If you look in files like synaptic, they will have the command “/usr/bin/gksu /usr/sbin/synaptic” so i think the “/usr/bin/gksu” followed by the command of the program will make it ask for the root password.

  4. Go to the terminal and do “su” to get root and then do “mousepad filename.desktop” or do “sudo mousepad filename.desktop”

  5. Is there any way to resize the icons (make bigger) inside the menu?

  6. Freedom is nothing else but a chance to be better, taste your freedom and be better.

  7. Thank you for the nice post,
    if you ever need to see the cached menu,
    you can look under $HOME/.config/xfce4/desktop/.

  8. I’m sorry, the cached menu should be located under $HOME/.cache/xfce4/desktop/ not the previously mentioned directory.

  9. [...] Teh Post: Xubuntu : XFCE Menu Items Manually edit the Xfce menu « Xubuntu Blog [...]

  10. copy the cache menu from
    $HOME/.cache/xfce4/desktop/
    to
    $HOME/.config/xfce4/desktop/
    rename the cache menu to
    menu.xml
    then use the menu editor from the settings tab, edit the menu and save :)

  11. http://xfce.wikia.com/wiki/Frequently_Asked_Questions#How_to_edit_the_auto_generated_menu_with_the_menu_editor.3F

    I think that’s pretty much the same as what the previous commenter said… In a bit more detail though.

  12. I’ve seen many good tips about how to edit xfce4 men manually, my problem is that my freshly installed xubuntu system didn’t add any applications to the xfce menu. I have all .desektop files available in the proper places, but actually I want to find a way to add all those .desktop items to xfce menu so that won’t waste 2 hours trying to add all apps 1by1 to the menu. Any idea how to do it? TIA..

  13. Follow my guide at

    http://ubuntuforums.org/showthread.php?t=1079363

    This will help you “fix” the Menu Editor app, and so you can EASILY add and remove what you want. I only ask that you give credit to nano_ext3 from Ubuntu Forums (degmic71) is my old name, having issues replying to threads so I tried making a new one, no good. lol.

    Spread this around the net!

    Cheers!

    Nano_ext3


Leave a comment

XHTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Blog at WordPress.com. | Theme: Pool by Borja Fernandez.
Entries and comments feeds.