2

To Clarify:

The last two things do not work. The app does not apear any where, you need to launch manually from the appimage file.

mathtick
  • 589

1 Answers1

4

With the Appimage format, you directly run the application by running the appimage file, without installing it into your system. Because there is no installation, the application typically will not install a launcher in your application menu.

If you want the application to appear in the menu, you will need to create a desktop file for it yourself. A .desktop file is a small text file that provides information to your operating system on how to start an application and display it in the menu. If you place your valid .desktop file in .local/share/applications, your menu system automatically will pick it up so you can launch it from there.

Once your custom application appears in your menu, you can also pin it in the normal way.

Example

For example, this is a file ~/.local/share/applications/com.github.qarmin.czkawka.desktop installed to run the AppImage of the Czkawka, a utility to find duplicate files.

[Desktop Entry]
Name=Czkawa Duplicate File Finder
Exec=/home/ftack/.appimage/linux_czkawka_gui.AppImage
Type=Application
Icon=com.github.qarmin.czkawka
Categories=Utility;

The icon file is ~/.local/share/icons/com.github.qarmin.czkawka.svg. It is sufficient to only provide the file base name if the icon is installed in a proper location, here ~/.local/share/icons/.

Actually, the AppImage usually provides a .desktop file and icons, which you can copy to the appropriate location and adapt. To find these files, run the AppImage. An AppImage file actually contains a file system that will be mounted in a temporary folder when you run the application. Learn where this folder is from the output of the command mount. From the line

/home/vanadium/.appimage/linux_czkawka_gui.AppImage on /tmp/.mount_linux_e898NI type fuse.linux_czkawka_gui.AppImage (ro,nosuid,nodev,relatime,user_id=1000,group_id=1000)

I learn that, this time, my AppImage is mounted on /tmp/.mount_linux_e898NI. Navigate there with your file manager to look for a .desktop and an icon file to use.

If after pinning your launcher you see that a second icon is created after clicking the laucher, then you will also need to add a StartupWMClass= line to the .desktopfile, so the launcher can be connected to the correct icon.

vanadium
  • 88,010
  • 1
    This doesn't work as expected, e.g. running custom desktop shortcut for YouTube Music Desktop App will spawn extra window, i.e. you get two separate items on a dash - your shortcut that started the application and the application itself. – cprn Oct 23 '20 at 12:22
  • 2
    That depends on the application. You may need to set the proper StartupWMClass in the launcher. – vanadium Oct 23 '20 at 19:42
  • It would be great if this answer actually included the example .desktop file. – Kvothe Jun 01 '21 at 15:18
  • @Kvothe You're welcome. I added an example and some instructions on how to take the .desktop file and icon from the AppImage itself. – vanadium Jun 01 '21 at 16:51
  • When I looked in /tmp/.mount... I did not see any .desktop file but I did see one with the name of the application, examining this in a text editor revealed it was the .desktop file. I copied it and the icon found in the same directory and changed the relative execution and icon path to absolute ones. This worked. – Kvothe Jun 02 '21 at 08:59
  • @vanadium: I was about to add a new answer about StartWMClass in order to get the icon to work properly (without spawning an extra window) but then saw your comment. Please add that to your answer because without it you won't be able to add the application to favorites without non-obvious workarounds. –  Apr 26 '22 at 16:35
  • 1
    Agree, I added a link to another answer on this specific matter. – vanadium Apr 26 '22 at 18:17