Manually edit the Xfce menu
July 12, 2006 at 9:43 am | In tips and tricks, xubuntu |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!
14 Comments »
RSS feed for comments on this post. TrackBack URI
Leave a comment
Blog at WordPress.com. | Theme: Pool by Borja Fernandez.
Entries and comments feeds.
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!
Comment by finferflu — August 15, 2006 #
https://xubuntu.wordpress.com/2006/08/04/howto-remove-menu-entries-from-the-system-menu/
Comment by xubuntu — August 15, 2006 #
http://tehpost.blogspot.com/2006/09/xubuntu-xfce-menu-items.html
Comment by Rory — September 22, 2006 #
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)
Comment by Wing — September 22, 2006 #
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.
Comment by Wing — September 23, 2006 #
Go to the terminal and do “su” to get root and then do “mousepad filename.desktop” or do “sudo mousepad filename.desktop”
Comment by Rory — September 24, 2006 #
Is there any way to resize the icons (make bigger) inside the menu?
Comment by Jonathan — December 21, 2006 #
Freedom is nothing else but a chance to be better, taste your freedom and be better.
Comment by Jame — January 3, 2007 #
Thank you for the nice post,
if you ever need to see the cached menu,
you can look under $HOME/.config/xfce4/desktop/.
Comment by slashdotfx — January 24, 2008 #
I’m sorry, the cached menu should be located under $HOME/.cache/xfce4/desktop/ not the previously mentioned directory.
Comment by slashdotfx — January 24, 2008 #
[...] Teh Post: Xubuntu : XFCE Menu Items Manually edit the Xfce menu « Xubuntu Blog [...]
Pingback by hahaha.rootbox.or.id » Blog Archive » Kustomisasi menu XFCE — January 24, 2008 #
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
Comment by gianni — February 15, 2008 #
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.
Comment by Simon — April 22, 2008 #
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..
Comment by Sefa Denizoğlu — May 2, 2008 #