gusbemacbe / suru-plus

Suru++ 25 — A cyberpunk, elegant, futuristic and Papirus-like third-party icons theme
GNU General Public License v3.0
344 stars 32 forks source link

Okular Icon #38

Closed jcuenod closed 5 years ago

jcuenod commented 5 years ago

Could you add an icon for Okular. Okular is (I think) the standard pdf reading application on KDE:

[Desktop Entry]
Type=Application
Name=Okular
GenericName=Document Viewer
Icon=okular
Categories=Qt;KDE;Graphics;Viewer;
gusbemacbe commented 5 years ago

Hi,

I have already added it before. Here is the https://github.com/gusbemacbe/suru-plus/blob/master/apps/scalable/document/okular.svg.

I will investigate why this icon is not well displayed in Okular.

jcuenod commented 5 years ago

I see that now. Sorry.

Hmm, for me the icon is displaying when I search for Okular in the applications menu but it's not showing up in the alt-tab dialog.

gusbemacbe commented 5 years ago

Hmm, for me the icon is displaying when I search for Okular in the applications menu but it's not showing up in the alt-tab dialog.

Then it must be rendering bug. I will investigate it.

jcuenod commented 5 years ago

Thanks!

gusbemacbe commented 5 years ago

I can not replicate this issue because the icon is well rendered when I pressed alt+tab:

image

I know you are a KDE user, but what distribution of Linux do you use?

jcuenod commented 5 years ago

Actually I'm on gnome 3.30 using Antergos (basically Arch).

gusbemacbe commented 5 years ago

OK, I will test it on Manjaro GNOME.

jcuenod commented 5 years ago

I figured out the reason (I think): https://unix.stackexchange.com/questions/387614/modify-desktop-application-icon-after-progam-opens-e-g-in-alt-tab

Basically Okular's .desktop files are stupid:

okularApplication_chm.desktop        okularApplication_md.desktop
okularApplication_comicbook.desktop  okularApplication_mobi.desktop
okularApplication_djvu.desktop       okularApplication_ooo.desktop
okularApplication_dvi.desktop        okularApplication_pdf.desktop
okularApplication_epub.desktop       okularApplication_plucker.desktop
okularApplication_fax.desktop        okularApplication_tiff.desktop
okularApplication_fb.desktop         okularApplication_txt.desktop
okularApplication_ghostview.desktop  okularApplication_xps.desktop
okularApplication_kimgio.desktop

So gnome-shell doesn't know that the okular window belongs to any of those .desktop files.


Just to confirm, I appended this line to okularApplication_pdf.desktop and now it works:

StartupWMClass=okular
jcuenod commented 5 years ago

Maybe symlinking each of those names to okular.svg would be a decent solution?

okularApplication_pdf.svg -> okular.svg

gusbemacbe commented 5 years ago

Yes, symlink is the solution to keep the size economic.

gusbemacbe commented 5 years ago

I have checked all the Okular desktop files, but almost they use the same icon name. I have solved the bug, it was Gravit Designer metadata with base64 which prevented Okular (symlinked t document.svg) icon from being rendered, in reference to https://github.com/gusbemacbe/suru-plus/pull/34#issuecomment-425668398. Please download and test the unstable branch.

gusbemacbe commented 5 years ago

Hello, @jcuenod!

Please test the unstable branch. If it works, it will be merged into the master branch tomorrow.

jcuenod commented 5 years ago

Hmm, this didn't work for me.

jcuenod commented 5 years ago

Can you point me to the commit that should fix this because I'm not seeing the symlinks (I don't know where to look though - I checked scalable and scalable/document)

gusbemacbe commented 5 years ago

Sorry, I forgot of copying the files. I was in much hurry. I have just uploaded. It is in the branch unstable now.

gusbemacbe commented 5 years ago

You are added in the files AUTHORS and CHANGELG.

gusbemacbe commented 5 years ago

I credited you at my produt pagt at OpenDesktop. Unfortunately OpenDesktop is broken now.

jcuenod commented 5 years ago

For some reason I'm still having trouble. I see all the symlinks but the icon is not changing for the alt-tab dialog. I tried regenerating the cache but it didn't help. Any suggestions?

gusbemacbe commented 5 years ago

It can be KDE rendering bug or issue. I will check if there is something dirty in Okular icon.

jcuenod commented 5 years ago

It does show up in the applications overview, just not the alt-tab dialog. So it still seems like a window class issue.

gusbemacbe commented 5 years ago

It works on Manjaro KDE:

image

Then it must be KDE bug (because Okular is written in KDE).

But I will install Antergos with GNOME to investigate the cause.

gusbemacbe commented 5 years ago

In Antergos, I have noticed that using NUmix as efaut theme, the icon is having bad quality. You can see how the icon got a bit pixelated:

image

I set my icons theme. It still uses Numix icon instead of my icon. I understood what happened... As they are written in KDE, all the okular desktop files do not have StartupWMClass entrance, therefore, the KDE apps do not fit well on GNOME.

gusbemacbe commented 5 years ago

With StartupWMClass added in the desktop file, the icon returned to the normal, here:

image

It is why the KDE apps deskto files do not have StartupWMClass.

gusbemacbe commented 5 years ago

Hey @palob and @Foggalong, I do not know if you are working with Antergos.

Due the lack of StartupWMClass, Numix icons get pixelated in KDE apps on GNOME. And in addition, if somebody changes the icons theme, the icon will not be well displayed.

If adding StartupWMCClass, Numix icons will get unpixelated and return to the normal.

palob commented 5 years ago

We are not currently officially affiliated with the Antergos project. Since it is an issue we've got no leverage on I only can direct you to https://github.com/bilelmoussaoui/StartupWMClassFixer.

jcuenod commented 5 years ago

Surely there's a better way than modifying the .desktop files? Why do the Numix icons work (even if they're showing some sort of pixelated version)?

gusbemacbe commented 5 years ago

Hey @jcuenod

It is the default theme of Antergos. I did not install Numix. It came with Numix as default.

You can try to install StartupWMClassFixer.

Or maybe ask @bilelmoussaoui. He may know.

bilelmoussaoui commented 5 years ago

Hey, the startupwmclass is used to match the desktop file with the running processes. It's an issue with either the application itself or the window manager you're using. The only way to fix it here without any source code patches is using the startupwmclass script mentioned before or by adding it manually.

jcuenod commented 5 years ago

This doesn't make sense to me. Whether or not I define StartupWMClass=okular in the .desktop file, when I run xprop WM_CLASS against Okular I get:

WM_CLASS(STRING) = "okular", "okular"

But, when I define StartupWMClass the icon is displayed correctly; when I don't, it's wrong.

@gusbemacbe, I realise that Numix is the default (I'm also on Antergos) but that doesn't explain how Antergos correctly manages to figure out which Numix icon to use: it doesn't show a question mark icon or something, it shows a Numix Okular icon.

It may be legitimate to file a bug report against Okular though. I found this bug on Konsole: https://bugs.kde.org/show_bug.cgi?id=372441 (I don't have a KDE account though and I am loathe to create one just for this bug report).

gusbemacbe commented 5 years ago

@jcuenod, I suspect it be a KDE cache bug which prevented the update of StartupWMClass. Check if you have still icon-cache.kcache.

jcuenod commented 5 years ago

@gusbemacbe maybe I'm wrong but I don't think I have a icon-cache.kcache file. I use gnome.

[Update]: Nope, I was wrong. It's in ~/.cache/. But now I'm not sure how deleting it would help. I deleted it for the heck of it but it's not clear to me what you think the problem is @gusbemacbe. I'm not trying to fix the icon for myself. I'm trying to fix what icon all Okular users on Gnome see when they use suru++.

gusbemacbe commented 5 years ago

@jcuenod

Finally, the problem is the icons cache. I recommend you to use Stacer which will clear the cache and refresh the icons theme. Then log out and log in.