laurent22 / joplin

Joplin - the privacy-focused note taking app with sync capabilities for Windows, macOS, Linux, Android and iOS.
https://joplinapp.org
Other
44.99k stars 4.89k forks source link

Hard coded path for the Joplin icon #1611

Closed tylerelias closed 5 years ago

tylerelias commented 5 years ago

Hi, I'm on Arch and I use Joplin for taking notes. I noticed that with icon themes the icon for Joplin doesn't change like the rest of them. I posed this issue on another repo, the creator of the icons a currently use here: https://github.com/gusbemacbe/suru-plus-aspromauros/issues/9 He did some digging around and pointed it out that the path to the icon itself is hardcoded and that any changes done to that get reverted (check his explaination in the link above)

I thought I should raise this issue and see what you guys have to say. Also, thanks for this program, and all the hard work.

See image for a visual representation. out_of_place_icon

tessus commented 5 years ago

Here's the comment from the other ticket as a reference:

I have just investigated.

Did you install JOplin, using the command line, right? So it created an desktop file and it uses an AppImage. Here is its desktop file:

[Desktop Entry]
Encoding=UTF-8
Name=Joplin
Comment=Joplin for Desktop
Exec=/home/gusbemacbe/.joplin/Joplin.AppImage
Icon=/home/gusbemacbe/.joplin/Icon512.png
StartupWMClass=Joplin
Type=Application
Categories=Application;
X-AppImage-BuildId=1LpSDS79QxkAP8oaIYEmKvLumiN

You can see as the Icon=/home/gusbemacbe/.joplin/Icon512.png is hardcoded. We have to change to softcoded path like:

Icon=joplin

The problem is that, as X-AppImage-BuildId=1LpSDS79QxkAP8oaIYEmKvLumiN is present, it will update the AppImage and reverts the icon path to the original.

tessus commented 5 years ago

Unfortunately I'm not familiar with the build process of the AppImage on Linux. Maybe @laurent22 has an idea.

CalebJohn commented 5 years ago

I started looking at where an appropriate location to store the icon would be. This gnome article says /usr/share/icons/hicolor/48x48/apps/ and I think ~/.local/share/icons/hicolor/48x48/apps. Can you test if this would work on your arch system?

gusbemacbe commented 5 years ago

@CalebJohn

I was going to say and explain it. The name Icon512.png should be renamed to joplin.png and Icon=/home/gusbemacbe/.joplin/Icon512.png for simply Icon=joplin in the .desktop file.

gusbemacbe commented 5 years ago
  1. Change from:

https://github.com/laurent22/joplin/blob/159dc44f6c2e618473c0acd3f8a3c5cd515f2dfc/Joplin_install_and_update.sh#L59

to:

mkdir -p ~/.local/share/icons/hicolor/48x48/apps
wget -nv -O ~/.local/share/icons/hicolor/48x48/apps/joplin.png https://joplinapp.org/images/Icon512.png 
  1. Change from:

https://github.com/laurent22/joplin/blob/159dc44f6c2e618473c0acd3f8a3c5cd515f2dfc/Joplin_install_and_update.sh#L86

to:

 echo -e "[Desktop Entry]\nEncoding=UTF-8\nName=Joplin\nComment=Joplin for Desktop\nExec=/home/$USER/.joplin/Joplin.AppImage\nIcon=joplin\nStartupWMClass=Joplin\nType=Application\nCategories=Application;\n$APPIMAGE_VERSION" >> ~/.local/share/applications/appimagekit-joplin.desktop 
CalebJohn commented 5 years ago

Looks good! Why don't you make a pull request? That way you get credit for the work you've put in! I think this section could be changed though to reflect to size of the icon

mkdir -p ~/.local/share/icons/hicolor/512x512/apps
wget -nv -O ~/.local/share/icons/hicolor/512x512/apps/joplin.png https://joplinapp.org/images/Icon512.png 
gusbemacbe commented 5 years ago

@CalebJohn, done.