Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updater symlinked Icon #55

Closed
jimkp opened this issue May 29, 2017 · 18 comments
Closed

Updater symlinked Icon #55

jimkp opened this issue May 29, 2017 · 18 comments
Assignees

Comments

@jimkp
Copy link

jimkp commented May 29, 2017

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 numixproject/numix-core#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
Copy link

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
Copy link
Collaborator

anaselli commented Jun 3, 2017

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
Copy link
Author

jimkp commented Jun 3, 2017

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
Copy link
Collaborator

anaselli commented Jun 4, 2017

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
Copy link
Collaborator

anaselli commented Jun 4, 2017

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
Copy link

jcubic commented Dec 5, 2018

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
Copy link
Collaborator

anaselli commented Dec 6, 2018

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

@jcubic
Copy link

jcubic commented Dec 6, 2018

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
Copy link
Collaborator

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

@serovar
Copy link

serovar commented Jun 3, 2020

@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:

pathname = xdg.IconTheme.getIconPath("dnfdragora", 256)
.

Here is their comment to my request.

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

@anaselli
Copy link
Collaborator

anaselli commented Jun 3, 2020

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
Copy link

@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

icon_path = icon_path + '/dnfdragora.png'

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
Copy link
Collaborator

anaselli commented Jun 3, 2020

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

The line you linked is the default, but after

theme_icon_pathname = icon_path if 'icon-path' in options.keys() else self.__get_theme_icon_pathname() or icon_path
logger.debug("Icon: %s"%(theme_icon_pathname))
#empty icon as last chance
self.__icon = Image.Image()
try:
if theme_icon_pathname.endswith('.svg'):

@SmartFinn
Copy link

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
Copy link
Collaborator

anaselli commented Jun 4, 2020

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
Copy link
Collaborator

anaselli commented Jun 4, 2020

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
Copy link
Collaborator

anaselli commented Jun 6, 2020

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

@anaselli anaselli closed this as completed Jun 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants