Desktop-file-install did not copy .desktop file

I have an application that is shipped as a tar.gz file which is installed like this:

	amonra@styx:/opt$ sudo rm -rf DeepSkyStacker/
	amonra@styx:/opt$ sudo mkdir DeepSkyStacker
	amonra@styx:/opt$ cd DeepSkyStacker/
	amonra@styx:/opt/DeepSkyStacker$ sudo tar -zxvf ~/Downloads/DeepSkyStacker.tar.gz

The user is then asked to run a script called install-DSS-Desktop-Files w/r

#!/bin/bash
#
# install by default to the user local applications directory
#
desktop-file-install --dir=~/.local/share/applications /opt/DeepSkyStacker/DeepSkyStacker.desktop
update-desktop-database ~/.local/share/applications
#
# to install to /usr/local/share comment the above lines and un-comment the lines below and then run
#
#sudo desktop-file-install --dir=/usr/local/share/applications /opt/DeepSkyStacker/DeepSkyStacker.desktop
#update-desktop-database /usr/local/share/applications

But while it all runs without errors, nothing gets created in the ~/local/share/applications directory.

The .desktop file looks like:

[Desktop Entry]
Type=Application
Exec=/opt/DeepSkyStacker/DeepSkyStacker
Name=DeepSkyStacker
GenericName=The preferred application for stacking astronomical images
Icon=/opt/DeepSkyStacker/DeepSkyStacker.icns

What if anything am I doing wrong here?

How can I get something added to the “start” menu:
image

Not all DE/WM reload the complete .desktop files every time when anyone calls the xdg menu.

Some DE/WM need to be restarted to reload them

Edit: It is all described in the Freedesktop Desktop Entry Specification

Also note that apps may not be showing up in the top level of the menu, typically they go into their respective category instead … i.e. for your app I’d check if it shows up under “Graphics”

Still, if the desktop-file-install command in the script did not give an error message, it should have created a copy in ~/.local/share/applications.

For the time being, you can manually copy the file to make it work. On the standard Ubuntu desktop, the menu item will be picked up within seconds after copying the file, and certainly if you log out then back in.

Hmmm. The desktop file was not copied, and no entry was made in any section of the “start menu”. I changed the file to add Categories:

[Desktop Entry]
Type=Application
Exec=/opt/DeepSkyStacker/DeepSkyStacker
Name=DeepSkyStacker
GenericName=The preferred application for stacking astronomical images
Icon=/opt/DeepSkyStacker/DeepSkyStacker.icns
Categories=Astronomy;Graphics

I logged off and back on after running the shell script, but there’s still nothing in ~/.local/share/applications, and no entry in the start menu.

I repeat my question about adding entries in the start menu - is desktop-file-install supposed to create those?

Similarly adding an item to the “desktop” - just copy/pasting the .desktop file there seems rather “clumsy”?

Looks like specifying a location doesn’t work too well. What did work was this:


#!/bin/bash
#
# install desktop files to the default location
#
sudo desktop-file-install /opt/DeepSkyStacker/DeepSkyStacker.desktop
sudo update-desktop-database /usr/share/applications

It placed DeepSkyStacker in the Graphics part of the start menu - I’d have preferred if it had used “Astronomy” - is it possible to force that?

D.