2

I want to run an appimage available in a particular directory irrespective of its name. I tried this way without success,

[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Name=application
Icon=application.png
Path=/path/to/application/
Exec=/path/to/application/*.AppImage
StartupNotify=false
StartupWMClass=application
OnlyShowIn=Unity;
X-BAMFGenerated=true

How can I run an application with specific file extension using .desktop file?

1

2 Answers 2

5
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Terminal=false
Exec=sh -c "/home/theWu/Downloads/*.AppImage"
Name=colontracee
Icon=/home/theWu/Pictures/tracee1.jpg
Categories=Application

...worked for me, the way the OP requested... But if I was doing this I would be concerned if there was multiple .AppImage in the directory. It grabbed the first one based on alphabetical order.

.... but the wildcard does work.

3

You cannot use wildcards in a .desktop file. You need to be specific in what you want to run and provide at least the name of the AppImage file if it resides in a folder that is included in your search path, or the full pathname if it does not.

Perhaps you are asking this question because you do not want to change the .desktop each time you upgrade the AppImage. In that case, there are some possibilities:

  • Rename your .AppImage so it has a generic name, e.g. Shotcut-200628.glibc2.14-x86_64.AppImage -> shotcut, so you can reference the appimage as <path>/shotcut in your .desktopfile. Drawback: you do not readily see anymore which version you have from the file name.

Alternatively:

  • Create a symlink to the .AppImage file in a folder that is in your search path, e.g. ~/bin/shotcut -> <path>/Shotcut-200628.glibc2.14-x86_64.AppImage, then refer to the symbolic link in your desktop file.

Advantages:

  • You keep the AppImage name, thus immediately can see the version.
  • In the .desktop file, it is sufficient to provide the name of the executable, shotcut, because that is in your search path.
  • You can also launch the AppImage from the terminal or the run dialog Alt+F2 with the command shotcut.

Drawback:

  • When updating the appimage, you need to update the symbolic link.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .