I have the following maestral-maestral.desktop
file:
[Desktop Entry]
Version=1.0
Type=Application
Name=Maestral
Exec=/usr/bin/python3 -m maestral_qt -c maestral
Icon=maestral
GenericName=File Synchronizer
Comment=Sync your files with Dropbox
X-GNOME-Autostart-enabled=true
If I open a terminal and call dex maestral-maestral.desktop
, the application runs.
However, if I double click on the desktop file on Nautilus, the following window appears:
If I click on "Run" or "Run in terminal", nothing happens.
I have opened a terminal, run nautilus, double click on that desktop file and click on "Run", the following error appears in the terminal:
/home/raffaele/.config/autostart/maestral-maestral.desktop: 1: [Desktop: not found
/home/raffaele/.config/autostart/maestral-maestral.desktop: 5: -m: not found
/home/raffaele/.config/autostart/maestral-maestral.desktop: 7: Synchronizer: not found
/home/raffaele/.config/autostart/maestral-maestral.desktop: 8: your: not found
/home/raffaele/.config/autostart/maestral-maestral.desktop: 9: X-GNOME-Autostart-enabled=true: not found
I have Kubuntu 20.10, but I have installed the GNOME desktop and uninstalled Plasma.
.desktop
files are as such not executable files. In recent versions of Ubuntu, you cannot anymore run them by double-clicking in the file manager.Place
.desktop
files in~/.local/share/applications
. That way, they will appear in the application menu, and you can run them from there. You could pin them to the Dock for quick access.You can also place
.desktop
files on the Desktop. There, they can be run by double clicking.Edit 2021-05-21: as nautilus does not anymore support running executables by double-clicking on them, the following section may not work anymore
If you need to run them from the file manager, you could add a shebang,
#!/usr/bin/dex
, as the first line of the file. This indicates to the shell with which interpreter the script should be run when the user attempts to execute it. For this to work, the executable bit of the file should be set.If you do not want to edit all .desktop files, you can set up a file association yourself. You would need to create a
.desktop
file fordex
in~/.local/share/applications
. It will then be picked up in the list of installed applications in the file properties dialog in Files, "Open With" tab, where you can set the association.