-
-
Notifications
You must be signed in to change notification settings - Fork 104
Description
Looking at the AppDir spec there is a file named .DirIcon and can be used by thumbnailers to show an icon of the app, notably this is being used by KDE Dolphin's thumbnailer to display app icons, it is also used by tools like AppImageLauncher and at this time, AIL refuses to integrate appimages that do not contain this file
$ ail-cli integrate osu.AppImage.1
Processing /home/ravener/Downloads/osu.AppImage.1
Moving AppImage to integration directory
WARNING: No icons found at "usr/share/icons"
WARNING: Using .DirIcon as default app icon
ERROR: Entry doesn't exists: .DirIcon
ERROR: No icon was generated for: /home/ravener/Applications/osu.AppImage_7407d56675f47f882228974a84b820a4.1
ERROR: appimage_register_in_system : Entry doesn't exists: .DirIcon
Error: Failed to register AppImage in system via libappimage
since osu! had moved to Velopack a while ago, issues like ppy/osu#30759 ppy/osu#30466 popped up, and after investigating, I realized the .DirIcon is currently missing with the Velopack setup whereas before with the AppImagetool build process it was being included, appimagetool apparently automatically picks up the root icon and creates a .DirIcon symlink pointing to the root icon (the one mentioned in the .desktop file)
Mounting an old appimage with ./osu.AppImage --appimage-mount and navigating to the temp mounted directory
ravener@aster:/tmp/.mount_osu.ApoEzVed$ ls -a
AppRun .DirIcon 'osu!.desktop' 'osu!.png' usr
ravener@aster:/tmp/.mount_osu.ApoEzVed$ file .DirIcon
.DirIcon: symbolic link to osu!.png
ravener@aster:/tmp/.mount_osu.ApoEzVed$
This was an old one built with appimagetool, but the new velopack based ones are missing this file.
AppImageLint can also be used to check compliance:
./appimagelint-x86_64.AppImage --check icons_check ~/Downloads/osu.AppImage.bak
QSocketNotifier: Can only be used with threads started with QThread
appimagelint.cli[181276] [INFO] Checking AppImage /home/ravener/Downloads/osu.AppImage.bak
appimagelint.cli[181276] [INFO] Running check "Icons validity and location check"
appimagelint.icons_check[181276] [INFO] Extracting icon name from desktop file: /tmp/.mount_osu.ApNYIqXs/osu!.desktop
appimagelint.icons_check[181276] [INFO] Checking resolution of icon: /tmp/.mount_osu.ApNYIqXs/osu!.png
appimagelint.icons_check[181276] [WARNING] icon X resolution 1024 is unknown, icon will most likely not be used and just wastes space
appimagelint.icons_check[181276] [WARNING] icon Y resolution 1024 is unknown, icon will most likely not be used and just wastes space
appimagelint.icons_check[181276] [INFO] [✔] Valid icon in AppDir root
appimagelint.icons_check[181276] [INFO] Checking resolution of icon: /tmp/.mount_osu.ApNYIqXs/.DirIcon
Traceback (most recent call last):
File "/tmp/.mount_appimagGe0at/usr/conda/lib/python3.9/runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/tmp/.mount_appimagGe0at/usr/conda/lib/python3.9/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/tmp/.mount_appimagGe0at/usr/conda/lib/python3.9/site-packages/appimagelint/__main__.py", line 4, in <module>
run()
File "/tmp/.mount_appimagGe0at/usr/conda/lib/python3.9/site-packages/appimagelint/cli.py", line 142, in run
for testres in check.run():
File "/tmp/.mount_appimagGe0at/usr/conda/lib/python3.9/site-packages/appimagelint/checks/icons.py", line 106, in run
dotdiricon_valid = self._check_icon_for_valid_resolution(op.join(mountpoint, ".DirIcon"))
File "/tmp/.mount_appimagGe0at/usr/conda/lib/python3.9/site-packages/appimagelint/checks/icons.py", line 279, in _check_icon_for_valid_resolution
res = self._get_icon_res(icon_path)
File "/tmp/.mount_appimagGe0at/usr/conda/lib/python3.9/site-packages/appimagelint/checks/icons.py", line 245, in _get_icon_res
is_svg = self._is_svg(icon_path)
File "/tmp/.mount_appimagGe0at/usr/conda/lib/python3.9/site-packages/appimagelint/checks/icons.py", line 222, in _is_svg
with open(icon_path) as f:
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/.mount_osu.ApNYIqXs/.DirIcon'
Here is the relevant source code that handles this in appimagetool
Because Velopack does not use appimagetool and builds the app image in a custom way, this will probably need to be handled here, too, to prevent incompatibilities and confusion.