jjk-jacky / kalu

Keep Arch Linux Up-to-date -- an upgrade notifier for Arch Linux
Other
60 stars 15 forks source link

Allow custom icons for all statuses #68

Open Tank-Missile opened 5 years ago

Tank-Missile commented 5 years ago

This means an icon for no updates, updating, and pausing. Perhaps supporting the system theme could also be an option? I'm not sure if there's a standard for themed update icons.

jjk-jacky commented 5 years ago

But it is already possible -- You can already tweak (any and all of) the four icons used by kalu, as indicated in the man page, for all possible states (with the "blinking" to indicate that checks are being run).

Tank-Missile commented 5 years ago

It appears that it doesn't work exactly as intended. Just to clarify, the icons I'm using are 22x22 svgs. The paused icon scales correctly, but the main icon doesn't. Attempting to replace "kalu-gray" causes the system tray to not show either the normal "kalu" or "kalu-gray", but instead just the default icon. Desktop environment is KDE Plasma.

jjk-jacky commented 5 years ago

It appears that it doesn't work exactly as intended. Just to clarify, the icons I'm using are 22x22 svgs. The paused icon scales correctly, but the main icon doesn't.

How did you do it? Because this whole "loading icon from theme" thing is done by GTK, and I'm not sure if it's just done weirdly, or is bugged, but it always seemed to me a bit odd.

Specificaly, it seems that unlike the usual way where stuff in $HOME override those in /usr/local which themselves override /usr, it works the other way around in this case. So to actually override kalu's icon you need not to put it in ~/.local/share/icons/hicolor but e.g. ~/.local/share/icons/gnome else the icon from /usr/share/icons/hicolor will take precedence.

Other than that though, I just tried putting a 22x22 icon as ~/.local/share/icons/gnome/22x22/apps/kalu.png and everything worked as expected (Well, I noticed some "glitches" that I'll address soon, but mostly dealing with icon size in menu, so unrelated.).

Attempting to replace "kalu-gray" causes the system tray to not show either the normal "kalu" or "kalu-gray", but instead just the default icon. Desktop environment is KDE Plasma.

Does that mean you're using kalu with statusnotifier, or still regular systray/statusicon interface?

Tank-Missile commented 5 years ago

I'm using kalu-kde, which depends on statusnotifier.

jjk-jacky commented 5 years ago

Alright so I managed to try it under KDE a bit, and it seems to mostly work, sometimes....

From what I can tell, it can work fine. For instance when I put a 22x22 kalu.svg under $HOME/.local/share/icons/breeze/22x22/apps it worked as expected: the new icon was used as SN icon, in notifications, in menus, etc and the alternatives (kalu-gray, etc) where all based off of it as well.

However, when e.g. renaming it to kalu-gray.svg it didn't realy work, that is the (kalu-gray) icon was just missing on the SN. This is an issue with the StatusNotifierHost however, since kalu does tell it to use "kalu-gray" as icon, but for some reason it doesn't. (Maybe the size isn't good enough for it, I don't know?)

I've pushed some changes on branch next in github, including a small fix re: statusnotifier, though I don't that it had any real consequences (other that some warnings in kalu's stderr).

I've also pushed a branch snforceicons that you should try. With it, you can add a new tweak SnForceIcons=1 in your kalu.conf so that kalu will load icons from the theme itself and send them to the host, instead of simply sending the icon name to use. From the tests I've done, this seems to "fix" the issue, and everything works fine then.

So, please try again from branch next, and if you still have issues try from branch snforceicons -- making sure to add SnForceIcons=1 in your kalu.conf before running it.

Hopefully things should work fine then,

Tank-Missile commented 5 years ago

For the sake of convenience when trying out the latest git on KDE, could you create a kalu-kde-git aur package? I'm pretty sure using kalu-git doesn't provide as much compatibility. The icons also look blurry, but they are being replaced correctly.

jjk-jacky commented 5 years ago

Afraid not, I'm not really looking for more maintenance work at the moment. (And in fact, I'm not even maintaining the kalu-kde package either.)

Tank-Missile commented 5 years ago

I see. I made a custom PKGBUILD myself for it anyway. Might upload it at some point. One strange problem I encountered was that the "kalu" icon would be replaced, but removing the icon would not set it back to default. Might have something to do with a "cache"? I'm not entirely sure. Also, the icon shows up blurry in the notification window. This occurs in the next branch. I'm not sure about snforceicons.

jjk-jacky commented 5 years ago

You mean removing the icon you added in your $HOME, but without restarting kalu? If so that's probably a cache indeed.

Was that using the SnForceIcons=1 tweak? Because with it, icons are indeed loaded and cached when kalu starts, and not updated after that. So until you restart kalu any changes when it comes to those icons will not be applied.

So the tweak does "fix" things/work as expected?

Tank-Missile commented 5 years ago

I removed the icon and restarted kalu. The icon in the tray did not switch back to the default. Logging out and in again yielded the same result.

jjk-jacky commented 5 years ago

If you removed the icon & restarted kalu, it should get back to normal. If it doesn't, then it can only be a cache of sorts from your StatusNotifierHost, i.e. the application handling/showing the icon.

Tank-Missile commented 5 years ago

I built kalu from the snforceicons branch and set SnForceIcons=1 in kalu.conf. The result is that kalu-gray and kalu show up correctly and are not blurred in the system tray! However, the kalu icon still shows up blurry in the notification window.

jjk-jacky commented 5 years ago

Well, that might be due to some resizing. Check kalu's preferences and maybe either change the size to use in notifications so it matches that of your icon, or provide a specific icon to be used in notifications.

Tank-Missile commented 5 years ago

Quite right. Adjusting the notification icon size to 48 did the trick. Maybe the icon being an svg has something to do with it not adjusting, or knotifications doesn't make the same adjustment the system tray does? I'll have to fiddle with it more. Will snforceicons make it into a release, or is it just a hacky workaround for now?

jjk-jacky commented 5 years ago

Alright, glad it's working. For the notifications, you can always try and specify the icon it use directly (instead of kalu's icon) in kalu's preferences, maybe that can help.

As for the tweak, no I'll have to document it but it will be included in the next release.

fabianski7 commented 3 years ago

maybe this problem has arisen again? I tried three different icons and they are not being displayed like the others.

These two are 22x22 and are from the breeze-dark theme itself 2 4

This one is much bigger and also has the same problem 3

fabianski7 commented 3 years ago

another example, both are using the same icon, but the kalu (right) has an icon too far from the original quality

5