Electron-builder: Can I set AppImage's icon on linux platforms

Created on 12 Jan 2019  ·  31Comments  ·  Source: electron-userland/electron-builder

AppImage could only show the default icon although i set the icon in package.json

backlog

Most helpful comment

Not doing anything is never a good reason to close tickets in my humble opinion. So I don't know what good this bot is supposed to be doing.

All 31 comments

@probonopd thank you.i can show icon in linux dock.what i mean is that the appimage file icon can't be set

Have you installed the optional appimaged daemon? Which desktop are you using?

ubuntu and fedora. i am new to linux gnome

Are you sure the optional appimaged daemon is installed and running? Otherwise you will see no icons on the AppImage files.

Does optional appimaged daemon need to be downloaded separately?
can electron-builder integrate it in the dist?

image

i mean this one

For that one your user needs to have the optional appimaged daemon installed. It will generate the necessary thumbnail files, among other things.

@probonopd Do you mean optional appimaged daemon is not in the electron-builder's dist?

Exactly, appimaged is not part of each application AppImage but is installed system-wide. It's optional.

@probonopd what a pity, bu thank you very much

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Not doing anything is never a good reason to close tickets in my humble opinion. So I don't know what good this bot is supposed to be doing.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Not doing anything is never a good reason to close tickets in my humble opinion. So I don't know what good this bot is supposed to be doing.

=(

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

I am facing exactly the same issue. I tried everything suggested in this thread but unfortunately, nothing worked. App icon only works with deb but not with AppImage. Is anyone able to point me in the right direction?

electron-builder: 21.2.0
electron: 3.1.13

As explained above, for the icon in the filesystem to be the correct one the user needs to have the optional appimaged daemon installed. It will generate the necessary thumbnail files, among other things. Does this solve your issue @dvuvne?

I'm facing the same issue. The icon shows correctly on Windows and MacOS but on Linux we do not have any icon both when looking at the app.AppImage file as well as after running it. The solution provided here https://github.com/AppImage/AppImageKit/wiki/Bundling-Electron-apps is wrong, as it allows us to "override" the window icon, but the icon is still not available system-wide (e.g. on the .AppImage file)

To get an icon when looking at the app.AppImagefile in the file manager, you need a desktop integration software such as the optional appimaged daemon running in the system that integrates the application (and its icon) with the system.

To get the icon when running the application, the application needs to set the icon for the main window.

@probonopd I will double check the desktop-integration, thanks for the hint. By the way, we've been distributing AppImage application in the past and it had a desktop icon without requiring the users to install daemon (I'm 100% sure as you can even test it right now - http://luna-lang.org). So there should be a way to do it without this daemon right? Requiring the users to install daemon is rather a big no-go for us regarding AppImage then :(

Regarding the application needs to set the icon for the main window. - I understand this is not required on MacOS and Windows, right? If so, why Linux is a special case here?

The root cause may be that the the XDG specifications are flawed in this regard. They assumed every application to be _installed_, along with a desktop file and an icon file (that are separate from the application itself). macOS, Windows, and Haiku all have some concept of _resources_ (such as icons) embedded _inside_ the application. I have written an article about it: https://medium.com/@probonopd/my-sixth-day-with-haiku-under-the-hood-of-resources-icons-and-packages-abec8d0e4ec6

in the past and it had a desktop icon without requiring the users to install daemon

In the past I had written a bash script that placed the required icon and desktop file into the system when the AppImage was first launched. Maybe your AppImage still uses that.

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

Has this been resolved?

This ticket has been closed -- if the issue has been resolve then what is the procedure for adding an icon to the AppImage?

My package.json contains:

 "linux": {
      "target": [
        {
          "target": "AppImage",
          "arch": [
            "x64"
          ]
        }
      ],
      "icon": "./assets/icon-1024x1024",
      "category": "Utility"
    }

I'm sure the icon file exists, in fact it's in both /assets/ and /public/assets, but my appimage file has no icon.

my appimage file has no icon

Do you mean something like this in the file manager:

image

Unless desktop environments start to actively support this out-of-the-box, you need an AppImage thumbnailer in your system, or something like the optional appimaged daemon for this to work.

I am using Xubuntu with https://github.com/probonopd/go-appimage/blob/master/src/appimaged/README.md.

I'm not fully understanding what appimaged does and how it fits in here.

When I run appimaged-x86-64.AppImage it's looking for certain directories:

Watching ~/.local/bin
ERROR: appimage_register_in_system : The AppImage explicitly request not to be integrated
Watching ~/Downloads
Watching /opt
Watching /usr/local/bin

My AppImage file is not in any of these locations. I haven't even installed it, It is in the /dist directory of my project. When I run it, it works, but has no icon in the Ubuntu taskbar menu - I was expecting at least that to work.

appimaged is responsible for putting icon and desktop files into the system (as long as you put the AppImage into one of the "watched" locations), which in turn makes it possible for the file manager to show icons like in my screenshot, and is sometimes needed for the menu/taskbar of some desktops to appear correctly.

If you are just concerned about the taskbar and not about the icons in the file manager:
For the taskbars of _some_ desktops it may be sufficient to set an icon for the main window in the source code of your application (in which case you don't need appimaged). Something (roughly) along the lines of

  mainWindow = new BrowserWindow({width: 900,  
  height: 600,  
  show: false,  
  icon: path.join(__dirname, 'assets', 'icons', 'png', 'icon.png')  
  });  

I hope distros ship with a default AppImage thumbnailer soon. That'd be nice and I'm sure the package would be tiny.

According to https://github.com/AppImage/AppImageKit/issues/346, thumbnailer support was merged a while back (which I assume means we don't need appimaged). I wonder why I don't see a thumbnail.

I have both

flatpak 1.7.2-1
flatpak-builder 1.0.10-1

installed in my Arch (Manjaro) Linux (though I'm using electron-forge). I see the default gear cog icon for the AppImage file that I generate.

Could it be that electron-forge forgot to embed the icon in the file?

Was this page helpful?
0 / 5 - 0 ratings