21

I want to create desktop entry for Inkscape AppImage. I'm having some issues because I don't have all MIME types or a clear idea about running that kind of app on desktop entry.

Does anyone know how I can achieve such a thing?

Flimm
  • 41,766
AtomX
  • 441

5 Answers5

38

You can do it manually, or you can do it like it's described here: Registering AppImage Files as a desktop app.

Since you want to do it manually, you can do it like this.

  1. Download the official Inkscape AppImage.
  2. Make it executable, run: chmod +x inkscape.AppImage.
  3. Move it to an appropriate path, like ~/.local/bin.
  4. Extract the AppImage, run inkscape.AppImage --appimage-extract; a directory will be created called squashfs-root in the directory where the AppImage was extracted.
  5. Enter the directory squashfs-root and copy the desktop launcher org.inkscape.Inkscape.desktop to ~/.local/share/applications; then edit the desktop launcher to point to the path of the AppImage, i.e., Exec=$HOME/.local/bin/inkscape.AppImage.
  6. Remove the directory squashfs-root.

Note: The AppImage file name doesn't have to have .AppImage; the system will know what it is. If the icon isn't displayed, the icon theme you're using is missing the file org.inkscape.Inkscape. You can also edit the desktop launcher to use whatever icon is provided by the icon theme.

Uri Herrera
  • 14,866
  • 1

    then edit the desktop launcher to point to the path of the AppImage. This is the Exec line you need to edit

    – GMaster Dec 26 '21 at 07:33
  • 1
    Should the ~/.local/share/applications directory be created if it doesn't exist? Does the Icon= path also need updated? Should the icon be copied out of the squashfs-root directory before deleting it? Is there anything I can do to make an arbitrary application expose a right-click "pin to launcher" ? – user643722 Dec 03 '22 at 19:18
  • 1
    @user643722 1) Yes, the directory will exist if you have modified any desktop launcher or have installed software that adds a desktop launcher locally, .i.e, a Chrome web app. 2) Unless the path in Icon= is pointing to a path inside the AppImage, then no. 3) No, unless you want to use whatever PNG image is inside the AppImage and not the image provided by the icon theme you're using. 4) I guess that depends on what desktop you're using. I'm using Plasma and can right-click to pin a desktop launcher. – Uri Herrera Dec 06 '22 at 06:54
  • 1
    I think in the end, you need to run update-desktop-database ~/.local/share/applications/ to update the desktop database. – e3oroush Oct 21 '23 at 11:31
  • I totally don't get it. When you say edit the desktop launcher to point to the path of the appimage, that means the path, not the appimage itself? Right? in my example that would be Exec=/home/apps/ not Exec=/home/apps/ungoogled-chromium.desktop. Following those instructions to the letter, I get an error Failed to add plugin to the panel. GDBus.error:org.Freedesktop.DBus.Error.ServiceUnknown: The name xfce.Panel was not provided by any .service files – Joe Molnar Dec 03 '23 at 23:40
  • correction, the question is should the Exec line be the app image vs the app image path? Would the exec command be like this: Exec=/home/apps/ungoogled-chromium_116.0.5845.140-1.1.AppImage – Joe Molnar Dec 03 '23 at 23:49
  • I had to remove .Appimage from the filename of the executable, otherwise the Xfce app menu would fail with a "not found" error on launch. Xfce 4.18 on Debian. – Douglas Silva Dec 08 '23 at 19:42
  • This worked for me, but after I pinned/favorited the desktop entry, launching it would create a new task bar entry instead of reusing the pin. If you encounter this, it can be solved by checking the name of the new window and making sure the StartupWMClass of the desktop file matches the name of the window it launches. – Seth Falco Mar 21 '24 at 22:09
  • Don't forget to run sudo update-desktop-database to register the new .desktop entry! – Shinebayar G Mar 31 '24 at 07:41
8

First, make sure it is executable: chmod u+x Inkscape.AppImage

Then, you would format your desktop file like this:

[Desktop Entry]
Name=InkScape
Exec=/path/to/appimage.AppImage
Icon=Inkscape
Type=Application
Categories=GTK;GNOME;Utility;
  • Thanks, I'll try. But what about mime type? – AtomX Mar 30 '21 at 14:53
  • And the Icon isn't displayed in app bar. – AtomX Mar 30 '21 at 15:01
  • 2
    To display the application in the app bar, place the .desktop file in /usr/share/applications. I'm not entirely sure about the mime type. – Zany_Zachary1 Mar 30 '21 at 15:16
  • No, I meant the Inkscape official icon, I think the script has some trouble to find the real icon for the app. And instead, it is showing default icon for unknown app. – AtomX Mar 30 '21 at 15:22
  • try to find the inkscape official icon, and set the path manually. If you can't do that, you can always download the picture off the internet. – Zany_Zachary1 Mar 30 '21 at 15:28
  • Yout can put an icon into the ~/.local/share/icons/hicolor/256x256/my_icon.png and then set a relative path to this icon: Icon=my_icon – James Bond Feb 12 '23 at 20:00
1

This is what worked for me.

  1. Download Inkscape-xxx.AppImage from inkscape.org.

  2. Copy it to /opt/inkscape/ folder and rename it to Inkscape.AppImage

  3. Make it executable chmod u+x Inkscape.AppImage

  4. Download inkscape-logo.svg file and copy it to /opt/inkscape/

  5. Create a a new file ~/.local/share/application/inkscape.desktop

with the following entries.

[Desktop Entry]
Name=Inkscape
Exec=/opt/inkscape/Inkscape.AppImage %u
Icon=/opt/inkscape/inkscape-logo.svg
Comment=Draw Freely
Type=Application
Terminal=false
Encoding=UTF-8
Categories=Utility;
StartupNotify=true
StartupWMClass=org.inkscape.Inkscape

Note: StartupWMClass=org.inkscape.Inkscape is very important to associate the running instance to the .desktop launcher. Also %u parameter at the end of Exec field is to list the application in the open with applications list.

To find the StartupWMClass entry of your application use

  1. for wayland use looking-glass
  2. for xorg run xprop | grep WM_CLASS in terminal and click on your application's window
resuser
  • 21
  • This worked for me, with the addition from the comment above https://askubuntu.com/questions/1328196/how-can-i-create-a-desktop-entry-for-an-appimage#comment2609764_1328529 – Chuck Claunch Mar 04 '24 at 14:22
1

Using other answers I created a bash script that automatically extracts PNG icon from appimage and creates a .desktop file.

https://github.com/un1t/appimage-desktop-entry

Usage:

./appimage-desktop-entry.sh /path/to/Example.AppImage
un1t
  • 111
  • Interesting but as the script is not very large, maybe you could copy it here so that your answer remains valid even if the link breaks. – Marc Vanhoomissen Dec 27 '23 at 08:20
0

This is the answer that the AppImage documentation gives:

Integrating AppImages into the desktop

AppImages are standalone bundles, and do not need to be installed. However, some users may want their AppImages to be available like distribution provided applications. This primarily involves being able to launch desktop applications from their desktop environments’ launchers. This concept is called desktop integration.

appimaged

appimaged is a daemon that monitors the system and integrates AppImages. It monitors a predefined set of directories on the user’s system searching for AppImages, and integrates them into the system using libappimage.

See also: More information on appimaged can be found in appimaged.

AppImageLauncher

AppImageLauncher is a helper application for Linux distributions serving as a kind of “entry point” for running and integrating AppImages. It makes a user’s system AppImage-ready™.

AppImageLauncher must be installed into the system to be able to integrate into the system properly. It uses technologies that are independent from any desktop environment features, and therefore should be able to run on most distributions.

After install AppImageLauncher, you can simply double-click AppImages in file managers, browsers etc. You will be prompted whether to integrate the AppImage, or run it just once. When you choose to integrate your AppImage, the file will be moved into the directory ~/Applications. This helps reducing the mess of AppImages on your file system and prevents you from having to search for the actual AppImage file if you want to e.g., remove it.

To provide a complete solution for managing AppImages on the system, AppImageLauncher furthermore provides solutions for updating and removing AppImages from the system. These functions can be found in the context menus of the entries in the desktop’s launcher.

See also: More information about AppImageLauncher can be found in AppImageLauncher.

Flimm
  • 41,766