How to add a second item in .desktop file

i have 2 apps that i want to add to my menu
when i write them with this format

[Desktop Entry]
Version=1.0
Type=Application
Name=
Exec=
Icon=
Categories=<list-of-;-separated-categories>

the menu only shows the second one ( i think it’s overwriting the values)
how can i fix this ?

Hello @Null_Nerd :wink:

You can do it like this:

[Desktop Entry]
Version=1.0
Type=Application
Name=
Exec=
Path=
Icon=
Categories=<list-of-;-separated-categories>
Actions=First;Second;

[Desktop Action First]
Name=
Exec=
Path=

[Desktop Action Second]
Name=
Exec=
Path=

https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html

1 Like

@megavolt i writed it like this and it doesn’t show any of the applications
[Desktop Entry]
Version=1.0
Type=Application
Name=Alacritty
Exec=Path
Icon=Path
Actions=First;

[Desktop Action First]
Name=Name
Exec=Path
Icon=Path

does it require a restart ? (when i added only one of them the menu changed right away )

Maybe you need to run:

sudo update-desktop-database /usr/share/applications  

Well, change the path if it is somewhere else.

1 Like

The databases in [/home/user/.local/share/applications/.desktop] could not be updated.
i found out that the first app is in the menu but not the second one .

I hope the name is really not .desktop, but have a name like firefox.desktop :smiley:

“Actions” are rather a “submenu” of the desktop file. Should be visible by right-clicking.

1 Like

thanks now i see it is there any way that i can add the second one to the actual menu ?

Create a second desktop file?!

1 Like

i thought every thing should be in 1 file :grinning_face_with_smiling_eyes:
thanks for the support .

1 Like

In addition to manually creating a desktop file, you can also do:

  1. Right-click the XFCE desktop and select “Create Launcher”

  2. Or, right-click the Whisker Menu and select “Edit Applications”
    a. On the toolbar click the plus-sign and select “Add Launcher”, fill in the rest as needed.
    b. On the toolbar there is also a “Save Launcher”, “Test Launcher” and “Delete Launcher”.

With option 1 or 2 above, if you want to see where the file was stored (so you can view it or move it), on the command line type find $HOME newermt "1 minute ago". Change the time span as needed.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.