You are not logged in.
Hi,
I'm trying to make a second applications menu in my panel to launch a couple shell scripts, but no matter what I try the menu stays empty.
This is under Xfce 4.8 (Arch Linux.)
Here's what I did:
- Add a new applications menu in the panel.
- Set it to "Use custom menu file" /home/olivier/.config/menus/fanlimit.menu
- fanlimit.menu:
<!DOCTYPE Menu PUBLIC "-//freedesktop//DTD Menu 1.0//EN"
"http://www.freedesktop.org/standards/menu-spec/1.0/menu.dtd">
<Menu>
<Name>FanLimit</Name>
<DefaultAppDirs/>
<Layout>
<Filename>fanlimit-silent.desktop</Filename>
</Layout>
</Menu>
- Created fanlimit-silent.desktop in /home/olivier/.local/share/applications/
[Desktop Entry]
Version=1.0
Type=Application
Exec=/home/olivier/tools/fanlimit.sh -q -k -m 1600
StartupNotify=false
Terminal=false
Name=Silent
After this, my custom menu always shows "No applications found".
The normal Xfce menu does show "Silent" in the "Other" submenu, so the desktop file is probably ok...
I have read http://wiki.xfce.org/howto/customize-menu and http://standards.freedesktop.org/menu-s … op-file-id but that didn't help very much.
Does someone know what I'm doing wrong?
Offline
IIRC you need to add a node <MergeFile type="parent" /> in <Menu>.
Offline
Thanks for the suggestion. That's not the solution, but it led me to http://developer.gnome.org/menu-spec/ which explains how menu files work and states:
The <Layout> element defines a suggested layout for the menu starting from top to bottom. References to desktop entries that are not contained in this menu as defined by the <Include> and <Exclude> elements should be ignored.
So I was missing an <Include> block!
My new menu:
<!DOCTYPE Menu PUBLIC "-//freedesktop//DTD Menu 1.0//EN"
"http://www.freedesktop.org/standards/menu-spec/1.0/menu.dtd">
<Menu>
<Name>FanLimit</Name>
<AppDir>/home/olivier/.local/share/fanlimit/</AppDir>
<Include>
<Filename>fanlimit-quiet-night.desktop</Filename>
<Filename>fanlimit-noisy.desktop</Filename>
<Filename>fanlimit-quiet.desktop</Filename>
<Filename>fanlimit-silent.desktop</Filename>
</Include>
<!--Layout-->
<!--/Layout-->
</Menu>
I currently don't need a <Layout> block since the alphabetical order is fine. I also changed the AppDir so that my custom desktop entries don't show up in the "Other" submenu of the main applications menu.
Solved
Edit: since I have a special directory for my .desktop files now, I can also use <All /> instead of manually listing all .desktop files.
I have also added another entry that makes alphabetical order not perfect, so here is my latest version of the menu with a <Layout> block that forces a specific order:
<!DOCTYPE Menu PUBLIC "-//freedesktop//DTD Menu 1.0//EN"
"http://www.freedesktop.org/standards/menu-spec/1.0/menu.dtd">
<Menu>
<Name>FanLimit</Name>
<AppDir>/home/olivier/.local/share/fanlimit/</AppDir>
<Include>
<All />
</Include>
<Layout>
<Filename>fanlimit-off.desktop</Filename>
<Filename>fanlimit-quiet-night.desktop</Filename>
<Filename>fanlimit-noisy.desktop</Filename>
<Filename>fanlimit-quiet.desktop</Filename>
<Filename>fanlimit-silent.desktop</Filename>
</Layout>
</Menu>
Last edited by stqn (2011-06-26 19:55:10)
Offline
Thanks, I have been trying to get a custom menu to display for some time now and couldn't figure it out. I was able to merge it with Xfce's application menu, but not as a separate menu. I will now be able to have my Firefox's bookmarks on the panel.
Offline
[ Generated in 0.007 seconds, 8 queries executed - Memory usage: 534.41 KiB (Peak: 535.25 KiB) ]