Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AppImage is missing the icon in file managers #30759

Open
TechniKris opened this issue Nov 18, 2024 · 8 comments
Open

AppImage is missing the icon in file managers #30759

TechniKris opened this issue Nov 18, 2024 · 8 comments

Comments

@TechniKris
Copy link

Type

Cosmetic

Bug description

The AppImage file doesn't show its icon in Linux file managers (on some desktops?), which seems like a regression introduced in 2024.906.1 (assuming correctly set up thumbnailers).

I encountered the discrepancy on KDE Plasma desktop, in Dolphin file manager, and confirmed the same behavior in Thunar.
I tried downloading randomly selected old osu! AppImages (2023.326.1, 2021.212.0, 2020.408.1) and they all displayed correctly. A screenshot below presents many more examples of versions neighboring the 2024.906.1 release, where that specific release seems to be the cutoff point where the icons broke.

The issue doesn't seem to affect icons in Plasma's taskbar.

AppImageLint seems to freak out on the .DirIcon inside of the AppImage mountpoint of builds 2024.906.1 and newer. It seems to align with what's being reported in #30466 on 2024.1009.1 that "the icon on the application is gone".
I included logs from it, as well as a diff file with a relevant change of behavior, in the Logs section.

Possible culprit: #29783 mentions icon.png missing from .nupkgs since 2024.906.1.
I presume the regression might've been introduced by the transition from Squirrel to Velopack.

I started up a Fedora VM with Gnome desktop to see if the behavior is the same on other desktops, but the thumbnail generation was very inconsistent, most of the time refusing to generate thumbnails for any version, so I mostly ignored it in my testing.
It is worth mentioning though that after a reboot the 2024.1115.3 did finally get an icon, but not any other version (although that was with a checkerboard instead of transparency, so something's broken on the Gnome side as well).

Screenshots or videos

Icons in Dolphin on Plasma:
Missing icon on KDE

Version

From 2024.906.1 up to 2024.1115.3 (current release)

Logs

Game logs, the newest run being on 2024.1115.3:

AppImageLint logs:

@peppy
Copy link
Member

peppy commented Nov 18, 2024

Probably fixed in next release? (see ppy/osu-deploy#181)

@ravener
Copy link

ravener commented Nov 18, 2024

AppImages aren't really supposed to have icons by default, unless some thumbnailer plugin handles them on your system/file manager but that varies.

osu! however has had this line in the code https://github.com/ppy/osu-deploy/blob/master/templates/osu!.AppDir/AppRun#L3

on launch it'd attempt to copy its icon into the thumbnail cache, have you run those files at least once? since the thumbnail cache uses checksums and differs for each appimage

honestly this feels too hacky and I would've suggested its removal at some point, appimages shouldn't touch the thumbnail cache like that, that's for the file manager and thumbnailer programs to handle, and by default app images are simply portable executables, Linux has no concept of .exe icons like on windows either, so they are just files as far as the system is concerned, if you need the menu entry on your desktop you should 'integrate' the app image which something like AppImageLauncher or Gear Lever can do

@ravener
Copy link

ravener commented Nov 18, 2024

(although that was with a checkerboard instead of transparency, so something's broken on the Gnome side as well).

GNOME's file manager just does that, with a checkboard, it's normal since the thumbnail generation feature was meant for media previews like images and videos.

Thumbnailers are installed at /usr/share/thumbnailers/ these programs generate the icons usually, someone could technically develop a universal thumbnailer for all appimages, but osu! has had that line of code I mentioned which thumbnailed itself on purpose, so normally it wouldn't happen with other appimages.

@ravener
Copy link

ravener commented Nov 18, 2024

I did a bit more reading and it's interesting, apparently KDE Dolphin handles thumbnailers differently and they also thumbnail appimages it seems, I've heard things like having to install the libappimage package for it to work though so maybe look into that.

I don't have a lot of experience with KDE though, gnome user here and appimages aren't supposed to have icons by default here

@ravener
Copy link

ravener commented Nov 18, 2024

Oh I just found more interesting stuff, apparently appimages can contain a .DirIcon (see spec) file that can be used for thumbnailers, I guess kde dolphin picks up that file.

This existed in old osu! app images but no longer in newer ones. I'm guessing this is about the migration to Velopack, since they have their custom logic for building appimages, where as the old ones relied on the standard appimagetool that probably automatically generated a .DirIcon file.

This probably belongs to an upstream issue to Velopack to handle that since it should be standard, I'll look more into it soon

@7deok7
Copy link

7deok7 commented Nov 18, 2024

Yes, the logs I provided in #30466 show .DirIcon is missing (FileNotFoundError: [Errno 2] No such file or directory: '/tmp/.mount_osu.ApxLzii3/.DirIcon'). I think looking into the full output of appimagelint is a good idea.
Also just for clarification, the bug occurs on I’m pretty sure all DEs. I’ve tried it on KDE and Cinnamon myself and the error is the same. Also also, yes some AppImages are meant to carry icon files (Modrinth app, Lunar Client, such and such).

@TechniKris
Copy link
Author

TechniKris commented Nov 18, 2024

have you run those files at least once? since the thumbnail cache uses checksums and differs for each appimage

Yes, I have, although Dolphin on Plasma seems to pick up on these immediately, without even needing to launch. Case in point: the randomly picked AppImages I downloaded got their thumbnails almost instantly after opening the directory that contained them.

on launch it'd attempt to copy its icon into the thumbnail cache

Yeah, osu! even throws a message in the terminal if the directory doesn't exist (e.g. on freshly installed systems), instead of just creating it... Yeah, I forgot to report that bug since it's such a miniscule thing. 😅 I guess it doesn't matter at this point considering you're removing the functionality altogether.

if you need the menu entry on your desktop you should 'integrate' the app image which something like AppImageLauncher or Gear Lever can do

Yeah, I myself don't really have a need for those - I'm using the AUR package, which provides the icon of its own for the application launcher to use. I made this issue mostly with the standalone AppImages in mind.

apparently KDE Dolphin handles thumbnailers differently and they also thumbnail appimages it seems

Yup.

obraz

@ravener
Copy link

ravener commented Nov 19, 2024

Yeah everything is clear now, so in summary:

  • appimage thumbnails are generated from a file called .DirIcon this existed in old versions but no longer after moving to Velopack, therefore I opened Generate .DirIcon for Linux AppImages velopack/velopack#367 so they can implement this, we'll see what they have to say on this, we could also add the file ourselves but I figured it'd be better if Velopack supported it directly like appimagetool handled it before.
  • The .DirIcon missing is also making AppImageLint fail, and AppImageLauncher unable to integrate it.
  • PR remove linux thumbnailing osu-deploy#185 removes osu's own self-thumbnailing capability since that should be up to file managers and not apps themselves

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants