Xfce Forum

Sub domains
 

You are not logged in.

#1 2026-05-01 16:36:56

duxy
Member
Registered: 2026-05-01
Posts: 5
Windows 10Firefox 150.0

Launcher submenu?

Hi. Could I have some help with a custom launcher (ie, a non-application Launcher) menu? I've been trying to add a submenu to it for the past few days, and I'm about ready to start climbing the walls. Somebody put me out of my misery. Please?

For demonstration, I'm trying to show an item bar in sub menu foo. I have the following files :

~/.local/share/desktop-directories/foo.directory
[Desktop Entry]
Version=1.0
Type=Directory
Icon=file-manager
Name=Foo



~/.config/xfce4/panel/launcher-19/bar.desktop

(I have verified launcher-19 as correct)

[Desktop Entry]
Type=Application
Name=bar
Icon=ssh
Exec=xfce4-terminal --tab --hold --command="echo bar"
Categories=X-Foo;



~/.config/menus/foo.menu
<!DOCTYPE Menu PUBLIC "-//freedesktop//DTD Menu 1.0//EN" "http://www.freedesktop.org/standards/menu-spec/menu-1.0.dtd">
<Menu>
        <Name>Foo</Name>
        <Directory>/home/<me>/.local/share/desktop-directories/foo.directory</Directory>
        <Include>
                <Category>X-Foo</Category>
        </Include>
</Menu>

but the menu only shows the bar application in the top level. How do I get the menu to show the foo submenu?


Additional questions for the pure of spirit.

  • For a launcher menu, where should per-user .directory files go?

  • And per-user .desktop files?

  • The specifications state that <Directory> should contain a relative path. Is this strict, or can I use an absolute path here? Relative would mean a pile of ../

  • How can I validate .menu files? I know of desktop-file-validate, but it doesn't like XML.



Many thanks for any assistance.

Offline

#2 2026-05-01 19:45:37

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 12,591
LinuxFirefox 150.0

Re: Launcher submenu?

Hello and welcome.

Have a read through this post. The .desktop file needs to exist in ~/.local/share/applications or /usr/share/applications (or /usr/local/share/applications for the BSDs).

For a launcher menu, where should per-user .directory files go?

~/.local/share/desktop-directories

And per-user .desktop files?

~/.local/share/applications

The specifications state that <Directory> should contain a relative path. Is this strict, or can I use an absolute path here? Relative would mean a pile of ../

It shouldn't contain a path - it will search for all relevant directories (~/.local/share/desktop-directories, /usr/share/desktop-directories, /usr/local/share/desktop-directories).

How can I validate .menu files? I know of desktop-file-validate, but it doesn't like XML.

I'm unaware of a tool that can do that.


Mark solved threads as [SOLVED] to make it easier for others to find solutions.
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#3 2026-05-02 09:03:48

duxy
Member
Registered: 2026-05-01
Posts: 5
Windows 10Firefox 150.0

Re: Launcher submenu?

Hello! Thank you for your help. Your prior posts on here have helped me ease into XFCE more than you could know.


Unfortunately using the above paths results in the submenu showing in the main Application menu. I'm trying to get it to show in the non-Application menu ('Launcher - Program launcher with optional menu' when adding it to a panel). Apologies, but I'm fairly new to XFCE, so I'm not familiar with the correct names.

Is this possible?

Offline

#4 2026-05-02 09:09:11

peter.48
Member
From: France, sud-ouest
Registered: 2017-01-31
Posts: 172
LinuxFirefox 145.0

Re: Launcher submenu?

I'm not sure if I'm understanding you correctly, but why don't you try doing it in a graphical way? Just place an empty launcher on the panel, then right-click the launcher, select “Properties,” and configure the launcher however you like (icon, items, etc.).
That's how I create “submenus,” for example, with multiple text documents, templates or directories.
There's no shame in using a graphical interface, and your launcher won't work worse because of it. wink


The main defect of the linuxers is lack of memory - they don't remember how their knowledge was when they started with the linux

Offline

#5 2026-05-02 09:31:58

duxy
Member
Registered: 2026-05-01
Posts: 5
Windows 10Firefox 150.0

Re: Launcher submenu?

peter.48 wrote:

I'm not sure if I'm understanding you correctly, but why don't you try doing it in a graphical way? Just place an empty launcher on the panel, then right-click the launcher, select “Properties,” and configure the launcher however you like (icon, items, etc.).
That's how I create “submenus,” for example, with multiple text documents, templates or directories.

Er... I don't see an option for any submenu or subdirectory in the 'Add new items' window. (Fedora 43, if that helps).


peter.48 wrote:

There's no shame in using a graphical interface, and your launcher won't work worse because of it. wink

The menu is being dynamically rebuilt at boot, so it has to be bashable.

Offline

#6 2026-05-03 10:20:53

peter.48
Member
From: France, sud-ouest
Registered: 2017-01-31
Posts: 172
LinuxFirefox 145.0

Re: Launcher submenu?

I still don't understand what you want to do – a launcher with several custom items?
Or one or more items that are menus, which would mean creating a menu, not a launcher?


The main defect of the linuxers is lack of memory - they don't remember how their knowledge was when they started with the linux

Offline

#7 2026-05-03 12:13:41

duxy
Member
Registered: 2026-05-01
Posts: 5
Windows 10Firefox 150.0

Re: Launcher submenu?

peter.48 wrote:

I still don't understand what you want to do – a launcher with several custom items?
Or one or more items that are menus, which would mean creating a menu, not a launcher?

Sorry for not being clear.

Take the Applications menu. Duplicate it, and place it somewhere in the panel. Now imagine each leaf item, instead of being used to launch a program, might be a URL, or a shell command, or a link to a text file. This menu will be rebuilt each time the user logs in, or the computer boots.

That's what I'm trying to achieve.


However, I think I might have found my answer. I add a new Applications Menu to the panel, and use a custom menu file, and build that when I need to. I think my hurdle was that I didn't understand the Applications Menu could display any menu file - I thought it was linked to one single file.

So far I'm making progress, and it looks like this might be my solution.

Offline

#8 2026-05-03 19:51:22

peter.48
Member
From: France, sud-ouest
Registered: 2017-01-31
Posts: 172
LinuxFirefox 145.0

Re: Launcher submenu?

You can easily do what you're describing using a launcher.

duxy wrote:

This menu will be rebuilt each time the user logs in

This is what I don't understand...

Added later 14 min 43 s:
Here are some screenshots. Using a Fedora 43 live USB, I’ve created a launcher with three items; you can add as many as you like, as well as hyperlinks etc.

https://zupimages.net/viewer.php?id=26/18/0mdi.png
https://zupimages.net/viewer.php?id=26/18/t3bc.png
https://zupimages.net/viewer.php?id=26/18/7key.png
https://zupimages.net/viewer.php?id=26/18/lxny.png
https://zupimages.net/viewer.php?id=26/18/doyz.png
https://zupimages.net/viewer.php?id=26/18/1gmh.png
https://zupimages.net/viewer.php?id=26/18/8and.png
https://zupimages.net/viewer.php?id=26/18/q94t.png

Last edited by peter.48 (2026-05-03 20:10:01)


The main defect of the linuxers is lack of memory - they don't remember how their knowledge was when they started with the linux

Offline

#9 2026-05-03 20:40:47

duxy
Member
Registered: 2026-05-01
Posts: 5
Windows 10Firefox 150.0

Re: Launcher submenu?

peter.48 wrote:

You can easily do what you're describing using a launcher.

When the user logs in, my script scans the network, discovers which hosts are up, and what services they're offering, and builds URLs or ssh's or sftp's or whatever for each of those services, and presents those .desktop files in a menu. Each host can offer multiple services, so I needed to nest items.

Anyway, after a really really stupid error, I've got everything working now.

Offline

#10 2026-05-04 07:00:49

peter.48
Member
From: France, sud-ouest
Registered: 2017-01-31
Posts: 172
LinuxFirefox 145.0

Re: Launcher submenu?

Aaa... now everything is clear.

duxy wrote:

...everything working now.

Super smile


The main defect of the linuxers is lack of memory - they don't remember how their knowledge was when they started with the linux

Offline

Registered users online in this topic: 0, guests: 0

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.019 seconds, 7 queries executed - Memory usage: 575.76 KiB (Peak: 593.17 KiB) ]