manatools / dnfdragora

dnfdragora is a dnf frontend based on libyui abstraction
GNU General Public License v3.0
132 stars 41 forks source link

Updater symlinked Icon #55

Closed jimkp closed 4 years ago

jimkp commented 7 years ago

As Korora uses Numix-Circle as the default icon theme the developers of the theme were approached to provide a suitable icon. They decided to do as they have done for other package managers and use a symlink to their package manager icon, see https://github.com/numixproject/numix-core/issues/3716 for details.

This works fine for menus and launchers etc.however it breaks the Notifier that appears in the systray area. When the symlink is in place the updated doesn't start. If the symlink is removed and the original icon used the updater will start and will appear in the systray area.

Tested on Korora 25 Xfce with dnfdragora version 1.0.1-5.git20170505.2a3b056.fc25

AdmiralAsshat commented 7 years ago

Confirmed on Korora 25 Cinnamon with dndragora version 1.0.1-5.git20170505.2a3b056.fc25. Screenshots attached below to illustrate.

It looks correct in the Plank dock:

dnfdragora in dock

But still displays the original icon in the panel and system tray:

dnfdragora in panel

And when switching apps via alt+tab:

dnfdragora in alt tab switcher

anaselli commented 7 years ago

Well one thing is changing a desktop file icon another is the application one, i don't know what libyui does when we use setApplicationIcon but as you can see we left an escape solution to add custom icons or test application during developing here. So you if you don't like our icons you can change the path into configuration file dnfdragora.yaml as below:

settings:
    path:
        images: your_theme_path_with_same_icon_names

But I personally prefer you to provide new icons if they are really better, or however allowing us to add them as theme subdir so that someone else can use them changing the path..

As far as I can say we cannot do more, except if I misunderstood the report

jimkp commented 7 years ago

I don't understand your response. Are you saying dnfdragora doesn't honour the system icon theme? It is not that the new icon is better but that it fits the system theme.

The original report is that changing the icon stops the updater working in Xfce. It is more than the aesthetics,

anaselli commented 7 years ago

Are you saying dnfdragora doesn't honour the system icon theme?

Yes I think it doesn't, since it does not load the icon from a stock or from icon dir but from an absolute path. I will check if libyui allows something different for that or not.

The original report is that changing the icon stops the updater working in Xfce. It is more than the aesthetics,

So i misunderstood as I thought :) The notifier author is @besser82 and i cannot run notifier on my system atm. I'll install a korora vm as soon as i finished my current task

anaselli commented 7 years ago

I don't know that much of how theme icons are chosen, anyway libyui (not the libyui-bindings atm though) offers a findIcon() method to get an icon pathname from its name with size path e.g. "32x32/apps/dnfdragora.png" (fall back is 22x22/apps otherwise), and offers also a push method to add additional paths. Default ones are /usr/share/YaST2/theme/current/icons/ and /usr/share/icons/hicolor/. YaST2 one is not the right one, i believe :D could the latter ok for default theme icon? or is there something to get the right path to default theme that works for any desktop? In the case i could fix the bug in libyui-bindings and port findIcon() to python bindings and if no pathname is found our default path would be used.

jcubic commented 5 years ago

Similar issue, I'm working on GTK+ Icon theme on XFce Desktop and best way to view icons is to use panel activator icon picker that have search feature. I've created symlink from gdeb.svg and icon disappear from icon picker (when I switch icon themes). If I replaced symlink with a copy it works.

anaselli commented 5 years ago

Just a shot in the dark, does a hard link work instead?

jcubic commented 5 years ago

Also I'm not sure if something broke and I need to reboot because 5 more icons that I've symlinked after dnfdragora also disappeared and I've needed to create a copy (maybe something locked for all icons that disabled symlinks). Hard link probably will work because from OS perspective it's same file like a copy (same inode) but I've didn't tested this.

Will try to reboot and see if my last copies can be symlinks, I have file with list of symlinks and copies that's created on build so this is not much of a problem for me.

anaselli commented 4 years ago

@pontaoski is changing dnfdragora icon management, at the moment new logo and icon has been released.

serovar commented 4 years ago

@anaselli, sorry if this is a stupid question, I am not a programmer and I am not sure if this issue is related to what I am about to say. I asked the Papirus devs to add a tray icon for dnfdragora-updater to their icon pack, but they told me that even if they added it, the icon couldn't be changed (even using tools like hardcode-tray), and to report to you that the issue is caused by this: https://github.com/manatools/dnfdragora/blob/71aebe34a275ee692139b69715c3be2ed3f09cf2/dnfdragora/updater.py#L131.

Here is their comment to my request.

My question is, does @pontaoski changes to icon management solve this issue?

varlesh commented 4 years ago

image

https://github.com/PapirusDevelopmentTeam/papirus-icon-theme/blob/master/Papirus/22x22/apps/dnfdragora.svg https://github.com/PapirusDevelopmentTeam/papirus-icon-theme/blob/master/Papirus/22x22/apps/system-software-install.svg

anaselli commented 4 years ago

dnfdragora has not the same code as dnfdragora-update for icons, i need to port it there too. I'm not sure i understood what is wrong and which can be the suggestion instead of using xdg.IconTheme.getIconPath() since they say that the problem is there. Anyway i just made a test here where i linked our new svg to system icon path from source code:

$ ll /usr/share/icons/hicolor/256x256/apps/dnfdragora.svg
lrwxrwxrwx 1 root root 65 giu  3 18:49 /usr/share/icons/hicolor/256x256/apps/dnfdragora.svg -> /home/angelo/src/manatools/dnfdragora/share/images/dnfdragora.svg
$ python3
Python 3.7.6 (default, Jan 21 2020, 20:43:18) 
[GCC 8.3.1 20190524] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import xdg.IconTheme
>>> print(xdg.IconTheme.getIconPath("dnfdragora", 256))
/usr/share/icons/hicolor/256x256/apps/dnfdragora.svg

Now from my virtualenv

$ dnfdragora-updater
Try reading configuration file
From ./dnfdragora.yaml
Skipped exception: <[Errno 2] File o directory non esistente: './dnfdragora.yaml'> 
From /etc/dnfdragora/dnfdragora.yaml
Finally read user settings from /home/angelo/.config/dnfdragora.yaml
Logging into /home/angelo/logs, debug mode is enabled

and icon seems the new one: immagine

From dnfdragora-updated.log I see:

2020-06-03 19:16:00,760 [dnfdragora.updater]{updater.py:67}(INFO) dnfdragora-updater started
2020-06-03 19:16:00,790 [dnfdragora.updater]{updater.py:83}(DEBUG) Icon: /usr/share/icons/hicolor/256x256/apps/dnfdragora.svg

I don't know if it is really fixed but i seem it works here

SmartFinn commented 4 years ago

@anaselli

I don't know if it is really fixed but i seem it works here

There is no fix. At first, it looking for an icon in hicolor icon theme, not in Breeze that you use. Secondly, it looking for 256px icon, not 16px/22px/24px that use in the tray. Thirdly, the workaround looking for png files only https://github.com/manatools/dnfdragora/blob/71aebe34a275ee692139b69715c3be2ed3f09cf2/dnfdragora/updater.py#L79

In the end, we have only default, blurred, and colored icon alongside the monochrome icon on the panel.

Sorry if that sounds rude. It should not be :)

anaselli commented 4 years ago

I'm not graphic expert, i'm always ready to get helped ;)

The line you linked is the default, but after https://github.com/manatools/dnfdragora/blob/71aebe34a275ee692139b69715c3be2ed3f09cf2/dnfdragora/updater.py#L81-L87

SmartFinn commented 4 years ago

It may be I don't understand something, but the theme_icon_pathname will never end on .svg if 'icon-path' in options.keys() returns true. This screenshot confirmed that.

anaselli commented 4 years ago

ok so what is the main aim, having the option path working and winning on theme or having the theme working to honour user setting? You are right icon_path does not load an svg icon. This issue was open for symlink, It would be better to follow problems by problems to avoid confusion in my opinion :) Let's understand if this issue is closed at least on system, and open a new bug for icon-path, is that really a problem? i added that option for testing purpose not for daily use :D

anaselli commented 4 years ago

now dnfdragora-updater --icon-path /home/angelo/src/manatools/dnfdragora/share/images/ will produce the following log

2020-06-04 21:15:19,881 [dnfdragora.updater]{updater.py:67}(INFO) dnfdragora-updater started
2020-06-04 21:15:19,910 [dnfdragora.updater]{updater.py:83}(DEBUG) Icon: /usr/share/icons/hicolor/256x256/apps/dnfdragora.svg

Now svg wins over png, let's hope is the right way to go :p

anaselli commented 4 years ago

From the test i made on new release 2.0.3 link and svg should work for dnfdragora-update either on system or with icon-path parameter. I'll close this issue, fill free to open a new one if you experienced problems