runelite / launcher

Launcher for RuneLite
https://runelite.net
BSD 2-Clause "Simplified" License
67 stars 96 forks source link

[Linux] AppImage Icon doesn't get set with programs like AppImageLauncher #93

Open dginovker opened 3 years ago

dginovker commented 3 years ago

When using AppImageLauncher, the AppImage Icon doesn't get set when you "Run and Integrate" the .AppImage into your system.

Error log:

./RuneLite.AppImage 
WARNING: No icons found at "usr/share/icons"
WARNING: Using .DirIcon as default app icon
ERROR: Unable to load image.
ERROR: No icon was generated for: /home/dr_bracket/Applications/RuneLite_a89cceadeb287b5371332a93cb025628.AppImage
WARNING: Unable to resize the application icon into a 128x128 image: "Unable to load image.". It will be written unchanged.
WARNING: Unable to resize the application icon into a 256x256 image: "Unable to load image.". It will be written unchanged.

Then the installation looks like this: image

Instead of this: image

I'm not entirely sure why, during my debugging of build-linux.sh, the .DirIcon in the warning shows up in the native-linux folder as it should.

Only tested on Arch Linux - Will test on KUbuntu shortly.

dginovker commented 3 years ago

On KUbuntu I get effectively the same warning, but no error:

** (process:4784): WARNING **: 17:13:57.693: No icons found in AppDir/usr/share/icons. Using .DirIcon as fallback

It'd be great if the .DirIcon worked :thinking:

Adam- commented 3 years ago

Judging by https://docs.appimage.org/reference/appdir.html, I think you would just have to copy an icon into the appdir right around here: https://github.com/runelite/launcher/blob/master/build-linux.sh#L62 ?

dginovker commented 3 years ago

Unless I'm doing the copying wrong, I can't seem to get it to work. That said, someone smarter should probably look at it rather than trusting me :smile:

Adam- commented 3 years ago

I think it's cp ../../appimage/RuneLite.png .DirIcon

dginovker commented 3 years ago

The .DirIcon has always been there, it's just not getting read for some reason. Maybe it's a bug in AppImageLauncher? (Although it's been this way for as long as I can remember)

Adam- commented 3 years ago

are you sure? I don't think so

root@3b39d070b593:/launcher# ls -ahl native-linux/RuneLite.AppDir/
total 2.6M
drwxr-xr-x 3 root root 4.0K Dec  1 13:41 .
drwxr-xr-x 3 root root 4.0K Dec  1 13:41 ..
lrwxrwxrwx 1 root root    8 Dec  1 13:41 AppRun -> RuneLite
-rwxr--r-- 1 root root  85K Dec  1 13:41 RuneLite
-rw-r--r-- 1 root root 2.4M Dec  1 13:41 RuneLite.jar
-rw-r--r-- 1 root root  235 Dec  1 13:41 config.json
drwxr-xr-x 7 root root 4.0K Dec  1 13:41 jre
-rw-r--r-- 1 root root  144 Dec  1 13:40 runelite.desktop
-rw-r--r-- 1 root root  35K Dec  1 13:28 runelite.png

Could probably just symlink it to runelite.png actually.

kmarius commented 3 years ago

I think this might be a bug in AppImageLauncher. libappimage tries to detect .DirIcon as png (or an svg, alternatively) but fails. None of the pngs I tried worked, but an svg did. What also worked was putting a copy of the icon in usr/share/icons; files in there just get copied to ~/.local/icons from what I can tell.