Xfce Forum

Sub domains
 

You are not logged in.

#1 2011-06-26 16:53:19

stqn
Member
Registered: 2010-10-11
Posts: 174

[Solved] How to make a second custom applications menu?

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

#2 2011-06-26 17:02:28

Nick
Dev
From: ~
Registered: 2005-02-17
Posts: 1,144
Website

Re: [Solved] How to make a second custom applications menu?

IIRC you need to add a node <MergeFile type="parent" /> in <Menu>.

Offline

#3 2011-06-26 19:24:49

stqn
Member
Registered: 2010-10-11
Posts: 174

Re: [Solved] How to make a second custom applications menu?

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 smile

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

#4 2012-01-23 19:59:37

Slighooker
Member
Registered: 2012-01-23
Posts: 9

Re: [Solved] How to make a second custom applications menu?

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

Board footer

Powered by FluxBB