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

Icons are too small, and not crisp -- Plasma #300

Closed
AndydeCleyre opened this issue Jan 17, 2017 · 63 comments
Closed

Icons are too small, and not crisp -- Plasma #300

AndydeCleyre opened this issue Jan 17, 2017 · 63 comments
Assignees
Milestone

Comments

@AndydeCleyre
Copy link

Specifications

  • Hardcode-Tray version : 3.6.5
  • Distribution : Arch
  • Gtk version : 3.22.6
  • Inkscape version : 0.92.0
  • Cairo version : 1.14.8
  • Sni-qt version: None
  • Application name : hexchat, telegram, slack
  • Application version : 2.12.4, 1.0.0, 2.3.4

Expected behavior and actual behavior

Expected icons that match the other panel icons in size and quality.

Actual results: image

Steps to reproduce the problem

  1. In .config/plasma-org.kde.plasma.desktop-appletsrc I have
[Containments][6][General]
iconSize=2
hardcode-tray --theme Papirus-Dark --size 24
@varlesh
Copy link
Collaborator

varlesh commented Jan 17, 2017

on plasma used only 22px for tray

@AndydeCleyre
Copy link
Author

@varlesh are you acknowledging a part of the problem that needs fixing, or stating that the behavior is as intended?

@bilelmoussaoui
Copy link
Owner

@AndydeCleyre You just need to use hardcode-tray --size 22 instead of 24

@bilelmoussaoui
Copy link
Owner

Ping?

@AndydeCleyre
Copy link
Author

@bil-elmoussaoui This is what it looks like after

hardcode-tray --theme Papirus-Dark --size 22 -a

image

@bilelmoussaoui
Copy link
Owner

As i've never used KDE before, what does this

[Containments][6][General]
iconSize=2

?
Is it for scaling the icons ?

@AndydeCleyre
Copy link
Author

Yes, it changes the size of tray icons; see https://www.reddit.com/r/kde/comments/55yyia/kde_58_system_tray_icons_small/

@bilelmoussaoui
Copy link
Owner

Ah so you have a high DPI screen? If it's case, I think that you should try with a much higher size like 48 or something like that ;) anyway it's not supported at the moment as I've limited the sizes to 16, 22, 24! I would like to implement a proper support for that if you can test it :) I will create a test branch just for you . Are you Okey with that ?

@AndydeCleyre
Copy link
Author

I don't have any high dpi screens, just 1920x1080. I'm happy to test anything.

@bilelmoussaoui
Copy link
Owner

Ok, i will need you to estimate the size of the other icons that looks correctly on your screen. Is the Iconsize=2 means that you should double the icon size? If it's the case, i think i should also support the scaling on Gnome

@AndydeCleyre
Copy link
Author

I'm not sure, I'll see if I can find out later. In my own scripts to replace the telegram icons, I just rendered an svg as 256x256 pngs, and that looked fine to me.

@bilelmoussaoui
Copy link
Owner

I can't just render 256x256 pngs for everyone ;) I will have to get this done only when needed! For now, i'm quite busy! i will give it a shot (i will install KDE for the first time on my life!). Should be done by the end of this month 👍
For now, if you wish to fix that by yourself. Just go to /opt/Hardcode-Tray and open script.py using your default text editor, go here and add 256 https://github.com/bil-elmoussaoui/Hardcode-Tray/blob/master/script.py#L61
and after that just run the script using hardcode-tray --size 256 and it should work ;)

@AndydeCleyre
Copy link
Author

Here's the result of

hardcode-tray --theme Papirus-Dark --size 256 --change-color "#d3dae3 #c2b790" -a

image

Maybe related to the comment from @varlesh , still waiting to hear back from him on the 22px business.

@varlesh
Copy link
Collaborator

varlesh commented Jan 20, 2017

Papirus svg-based icon theme. SVG - vector image. What you want from me?
Report bug on KDE

@varlesh
Copy link
Collaborator

varlesh commented Jan 20, 2017

@AndydeCleyre Tray icons on Plasma used only 22px, see sources on Breeze. More icons contained on plasmashell theme - volume, klipper, network and etc...
If you want use not blurred icons on panel > reduce panel size for 22px icons... yes, apps icons will be tiny, but tray not blurred...
Also for app you can use dock or another panel

@varlesh
Copy link
Collaborator

varlesh commented Jan 20, 2017

For non-blurred icons need reduce panel size, because on Papirus available only icons for 22px and 24px.
But icons - vector you can change panel size for use another size > 44px, 48px, 96pz, 192px and etc...
and not forgot some apps converted to png - telegram use png-icons for tray.

@bilelmoussaoui
Copy link
Owner

@AndydeCleyre Ok, I just did some research and it seems that KDE will scale whatever icons you're using to a different size. So if you're using Png icons with the right size that should be used, they will be scaled up/down whatever it's original size which makes them look blurry...
Just disable the scaling and use =1, report this upstream and hope to see this fixed soon! the same issue happens with electron applications (they use png icons too)

@AndydeCleyre
Copy link
Author

Well I don't want to disable the scaling, because I want to control the size of the icons (and have them big). I don't think it's a bug that you can control the icon size in a plasma panel.

@bilelmoussaoui
Copy link
Owner

No, it's not a bug! it's just i don't have a screen that i can scale correctly to debug this. Anyway, normally it should look good with 44px as the normal size on KDE is 22px, can you try doing that ? are this configuration stored somewhere else ?

@bilelmoussaoui
Copy link
Owner

I've added scaling factor detection on the latest version on master. Please check this out, thanks!

@AndydeCleyre
Copy link
Author

With 3.6.5.r15.g4e733b6, running hardcode-tray -a --change-color "#d3dae3 #c2b790" --theme Papirus-Dark:

image

The hexchat and slack icons still look small to me, but it's not a big deal. If I want them to be unpixelated, though, is that dependent on hardcode-tray at all at this point, or is it a papirus issue?

@bilelmoussaoui
Copy link
Owner

Can you add this line of code print(default_icon_size) just after this one ? https://github.com/bil-elmoussaoui/Hardcode-Tray/blob/master/script.py#L267
So i can know if the scaling works as expected in your case? I will add some logs later. And can you try with an other theme? like Numix for example and see if you still have the same issue

@AndydeCleyre
Copy link
Author

Sure, it reports 22.

When I leave out the theme argument and it picks Adwaita, the results are identical.

When I specify the theme Oranchelo, it also reports 22 but says there are no icons to change.

When I specify Numix-Circle, it also reports 22, but then the icons look like:

image

Specifying Numix is the same.

@bilelmoussaoui
Copy link
Owner

Alright it seems that the scaling factor is not detected correctly :( I will investigate this. I will submit a patch pretty soon. I will need just one last information, can you add after this line https://github.com/bil-elmoussaoui/Hardcode-Tray/blob/master/modules/utils.py#L95 this line of code print(scaling_factor) This way i can know if it's detected or not. Thanks!

@AndydeCleyre
Copy link
Author

I've found that this line sets the scaling factor to 0, so it becomes 1 by the end of the method, and the print line you suggested is never encountered.

@bilelmoussaoui
Copy link
Owner

I see thanks for the help! i will get this done in few minutes.

@bilelmoussaoui bilelmoussaoui added this to the v3.7 milestone Jan 31, 2017
@AndydeCleyre
Copy link
Author

@bil-elmoussaoui I notice:

$ echo $DESKTOP_SESSION
/usr/share/xsessions/plasma

But that's probably different for a wayland user, at least.

$ echo $XDG_CURRENT_DESKTOP
KDE

$ echo $KDE_SESSION_VERSION
5

So it looks to me like checking XDG_CURRENT_DESKTOP is a good choice.

@bilelmoussaoui
Copy link
Owner

@AndydeCleyre I will take care of that this week ;)

@bilelmoussaoui
Copy link
Owner

@AndydeCleyre I've implemented the desktop session check on the beta branch. Would you mind testing it so i can be sure that everything works as expected? A new version will be released by the end of the week. I would be really thankful if you can test this feature :)

@AndydeCleyre
Copy link
Author

@bil-elmoussaoui Thanks. With the beta branch @ gaddd4e4, no matter how big I make the panel, or change the iconSize value in that config file, running

hardcode-tray -a --change-color "#d3dae3 #c2b790" --theme Papirus-Dark

reports

Your indicator icon size is : 22

The size actually looks ok in the panel (just not the resolution).

@bilelmoussaoui
Copy link
Owner

@AndydeCleyre Does Hardcode-Tray report the current desktop env? it should be shown in the output too! A screenshot would be great too so i can take a look at it 👍

@AndydeCleyre
Copy link
Author

@bil-elmoussaoui Ah, yes, the desktop is correctly identified:

image

image

@bilelmoussaoui
Copy link
Owner

Ok that's pretty great :) can you send me a log file, it's under /tmp/Hardcode-Tray/ just paste it here, it might help me debug why the icon size is not detected correctly

@AndydeCleyre
Copy link
Author

Here's the latest log file in that folder (ah, that first line is interesting):

[DEBUG] - 2017-02-20 13:18:25,238 - KDE not detected.
[DEBUG] - 2017-02-20 13:18:25,239 - new application Bitcoin path : /home/andy/.local/share/sni-qt/icons/bitcoin-qt/22/
[DEBUG] - 2017-02-20 13:18:25,248 - new application Clementine path : /home/andy/.local/share/sni-qt/icons/clementine/22/
[DEBUG] - 2017-02-20 13:18:25,350 - new application Flarget path : /home/andy/.local/share/sni-qt/icons/flareget/22/
[DEBUG] - 2017-02-20 13:18:25,351 - new application Google Music Manager path : /home/andy/.local/share/sni-qt/icons/MusicManager/22/
[DEBUG] - 2017-02-20 13:18:25,717 - new application Hexchat path : /home/andy/.config/hexchat/icons/
[DEBUG] - 2017-02-20 13:18:25,718 - new application HP Printer path : /home/andy/.local/share/sni-qt/icons/python2.7/22/
[DEBUG] - 2017-02-20 13:18:25,719 - new application Megasync path : /home/andy/.local/share/sni-qt/icons/megasync/22/
[DEBUG] - 2017-02-20 13:18:25,719 - new application Mumble path : /home/andy/.local/share/sni-qt/icons/mumble/22/
[DEBUG] - 2017-02-20 13:18:25,720 - new application Museeq path : /home/andy/.local/share/sni-qt/icons/museeq/22/
[DEBUG] - 2017-02-20 13:18:25,720 - new application OwnCloud path : /home/andy/.local/share/sni-qt/icons/owncloud/22/
[DEBUG] - 2017-02-20 13:18:25,721 - new application QElectroTech path : /home/andy/.local/share/sni-qt/icons/qelectrotech/22/
[DEBUG] - 2017-02-20 13:18:25,721 - new application RescueTime path : /home/andy/.local/share/sni-qt/icons/rescuetime/22/
[DEBUG] - 2017-02-20 13:18:25,722 - new application ScreenCloud path : /home/andy/.local/share/sni-qt/icons/screencloud/22/
[DEBUG] - 2017-02-20 13:18:25,722 - new application Seafile path : /home/andy/.local/share/sni-qt/icons/seafile-applet/22/
[DEBUG] - 2017-02-20 13:18:25,722 - new application Skype path : /home/andy/.local/share/sni-qt/icons/skype/22/
[DEBUG] - 2017-02-20 13:18:25,723 - new application Steam path : /home/andy/.steam/
[DEBUG] - 2017-02-20 13:18:25,724 - new application Teamviewer path : /home/andy/.local/share/sni-qt/icons/TVGuiDelegate/22/
[DEBUG] - 2017-02-20 13:18:25,725 - new application Telegram path : /home/andy/.TelegramDesktop/Telegram
[DEBUG] - 2017-02-20 13:18:25,725 - new application Telegram path : /home/andy/.local/share/TelegramDesktop/Telegram
[DEBUG] - 2017-02-20 13:18:25,725 - new application Telegram path : /home/andy/.TelegramDesktop/tdata/ticons/
[DEBUG] - 2017-02-20 13:18:25,725 - new application Telegram path : /home/andy/.local/share/TelegramDesktop/tdata/ticons/
[DEBUG] - 2017-02-20 13:18:25,729 - new application Tomahawk path : /home/andy/.local/share/sni-qt/icons/tomahawk/22/
[DEBUG] - 2017-02-20 13:18:25,730 - new application WizNote path : /home/andy/.local/share/sni-qt/icons/WizNote/22/
[DEBUG] - 2017-02-20 13:18:25,731 - Backup current file /usr/lib/chromium/resources.pak to /home/andy/.config/Hardcode-Tray/Chromium/20-02-2017_13-18-25/resources.pak.bak
[DEBUG] - 2017-02-20 13:18:29,906 - Backup current file /usr/lib/slack/resources/app.asar.unpacked/src/static/slack-taskbar-highlight.png to /home/andy/.config/Hardcode-Tray/Slack/20-02-2017_13-18-29/slack-taskbar-highlight.png.bak
[DEBUG] - 2017-02-20 13:18:30,137 - Backup current file /usr/lib/slack/resources/app.asar.unpacked/src/static/slack-taskbar-rest.png to /home/andy/.config/Hardcode-Tray/Slack/20-02-2017_13-18-29/slack-taskbar-rest.png.bak
[DEBUG] - 2017-02-20 13:18:30,366 - Backup current file /usr/lib/slack/resources/app.asar.unpacked/src/static/slack-taskbar-unread.png to /home/andy/.config/Hardcode-Tray/Slack/20-02-2017_13-18-29/slack-taskbar-unread.png.bak
[DEBUG] - 2017-02-20 13:18:30,840 - Backup current file /home/andy/.TelegramDesktop/tdata/ticons/icomute_22_0.png to /home/andy/.config/Hardcode-Tray/Telegram/20-02-2017_13-18-30/icomute_22_0.png.bak
[DEBUG] - 2017-02-20 13:18:31,071 - Backup current file /home/andy/.TelegramDesktop/tdata/ticons/icomute_22_1.png to /home/andy/.config/Hardcode-Tray/Telegram/20-02-2017_13-18-30/icomute_22_1.png.bak
[DEBUG] - 2017-02-20 13:18:34,493 - Backup current file /home/andy/.TelegramDesktop/tdata/ticons/ico_22_1.png to /home/andy/.config/Hardcode-Tray/Telegram/20-02-2017_13-18-30/ico_22_1.png.bak
[DEBUG] - 2017-02-20 13:18:37,992 - Backup current file /usr/share/yakyak/app/icons/icon-read.png to /home/andy/.config/Hardcode-Tray/Yakyak/20-02-2017_13-18-37/icon-read.png.bak
[DEBUG] - 2017-02-20 13:18:38,208 - Backup current file /usr/share/yakyak/app/icons/icon-read@2x.png to /home/andy/.config/Hardcode-Tray/Yakyak/20-02-2017_13-18-37/icon-read@2x.png.bak
[DEBUG] - 2017-02-20 13:18:38,458 - Backup current file /usr/share/yakyak/app/icons/icon-unread.png to /home/andy/.config/Hardcode-Tray/Yakyak/20-02-2017_13-18-37/icon-unread.png.bak
[DEBUG] - 2017-02-20 13:18:38,687 - Backup current file /usr/share/yakyak/app/icons/icon-unread@2x.png to /home/andy/.config/Hardcode-Tray/Yakyak/20-02-2017_13-18-37/icon-unread@2x.png.bak

@bilelmoussaoui
Copy link
Owner

@AndydeCleyre The kde not detected debug msg was sent by the get_scaling_factor function, i added an other debug msg to seee what causes this issue. Can you pull the latest changes and try again? This should output more information about this issue.
Thank you very much!

@AndydeCleyre
Copy link
Author

The sectioning of that kde config file is weird:

Traceback (most recent call last):
  File "/opt/Hardcode-Tray/modules/utils.py", line 122, in get_scaling_factor
    config.read(plasma_scaling_config)
  File "/usr/lib/python3.6/configparser.py", line 696, in read
    self._read(fp, filename)
  File "/usr/lib/python3.6/configparser.py", line 1063, in _read
    lineno)
configparser.DuplicateSectionError: While reading from '/home/andy/.config/plasma-org.kde.plasma.desktop-appletsrc' [line  7]: section 'ActionPlugins' already exists

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "script.py", line 79, in <module>
    args = ArgsParser(args)
  File "/opt/Hardcode-Tray/modules/parser.py", line 199, in __init__
    self.parse()
  File "/opt/Hardcode-Tray/modules/parser.py", line 206, in parse
    self._parse_scaling_factor()
  File "/opt/Hardcode-Tray/modules/parser.py", line 273, in _parse_scaling_factor
    self.scaling_factor = get_scaling_factor(DESKTOP_ENV)
  File "/opt/Hardcode-Tray/modules/utils.py", line 126, in get_scaling_factor
    logging.debug("KDE not detected, error : %s" % kde_error.decode("utf-8"))
AttributeError: 'DuplicateSectionError' object has no attribute 'decode'

@bilelmoussaoui
Copy link
Owner

Alright, it seems that i can't read that file using ConfigParser (to read ini files). I will use a simple file reading and regex on it to get the iconSize

@bilelmoussaoui
Copy link
Owner

@AndydeCleyre My latest commit should fix this now :)

@AndydeCleyre
Copy link
Author

Traceback (most recent call last):
  File "script.py", line 26, in <module>
    from modules.parser import Parser, ArgsParser, CONVERSION_TOOLS
  File "/opt/Hardcode-Tray/modules/parser.py", line 28, in <module>
    from modules.icon import Icon
  File "/opt/Hardcode-Tray/modules/icon.py", line 24, in <module>
    from modules.utils import get_iterated_icons, get_extension
  File "/opt/Hardcode-Tray/modules/utils.py", line 259
    "No backup folder found for the application %s", application_name))
                                                                      ^
SyntaxError: invalid syntax

@bilelmoussaoui
Copy link
Owner

It was a typo, fixed!

@AndydeCleyre
Copy link
Author

Oooh. I can't see a difference in the icons (I think that I need to follow up with the papirus theme to understand how to handle this), but:

Your indicator icon size is : 110

Do you still want to see a log, or does that seal the deal?

@bilelmoussaoui
Copy link
Owner

I would like to take a look to be sure that everything works okey ;) + Woud like to know which value was assigned to iconSize in your current configuration

@AndydeCleyre
Copy link
Author

It's currently 3 for the systray.

[DEBUG] - 2017-02-20 14:19:37,097 - Scaling factor was detected in the KDE configuration with the value 5
[DEBUG] - 2017-02-20 14:19:37,097 - Icon size was changed to : 110
[DEBUG] - 2017-02-20 14:19:37,098 - new application Bitcoin path : /home/andy/.local/share/sni-qt/icons/bitcoin-qt/110/
[DEBUG] - 2017-02-20 14:19:37,109 - new application Clementine path : /home/andy/.local/share/sni-qt/icons/clementine/110/
[DEBUG] - 2017-02-20 14:19:37,227 - new application Flarget path : /home/andy/.local/share/sni-qt/icons/flareget/110/
[DEBUG] - 2017-02-20 14:19:37,228 - new application Google Music Manager path : /home/andy/.local/share/sni-qt/icons/MusicManager/110/
[DEBUG] - 2017-02-20 14:19:37,596 - new application Hexchat path : /home/andy/.config/hexchat/icons/
[DEBUG] - 2017-02-20 14:19:37,596 - new application HP Printer path : /home/andy/.local/share/sni-qt/icons/python2.7/110/
[DEBUG] - 2017-02-20 14:19:37,596 - Creating application folder for HP Printer
[DEBUG] - 2017-02-20 14:19:37,598 - new application Megasync path : /home/andy/.local/share/sni-qt/icons/megasync/110/
[DEBUG] - 2017-02-20 14:19:37,599 - new application Mumble path : /home/andy/.local/share/sni-qt/icons/mumble/110/
[DEBUG] - 2017-02-20 14:19:37,599 - new application Museeq path : /home/andy/.local/share/sni-qt/icons/museeq/110/
[DEBUG] - 2017-02-20 14:19:37,599 - new application OwnCloud path : /home/andy/.local/share/sni-qt/icons/owncloud/110/
[DEBUG] - 2017-02-20 14:19:37,599 - new application QElectroTech path : /home/andy/.local/share/sni-qt/icons/qelectrotech/110/
[DEBUG] - 2017-02-20 14:19:37,600 - new application RescueTime path : /home/andy/.local/share/sni-qt/icons/rescuetime/110/
[DEBUG] - 2017-02-20 14:19:37,600 - new application ScreenCloud path : /home/andy/.local/share/sni-qt/icons/screencloud/110/
[DEBUG] - 2017-02-20 14:19:37,600 - new application Seafile path : /home/andy/.local/share/sni-qt/icons/seafile-applet/110/
[DEBUG] - 2017-02-20 14:19:37,600 - new application Skype path : /home/andy/.local/share/sni-qt/icons/skype/110/
[DEBUG] - 2017-02-20 14:19:37,601 - new application Steam path : /home/andy/.steam/
[DEBUG] - 2017-02-20 14:19:37,601 - new application Teamviewer path : /home/andy/.local/share/sni-qt/icons/TVGuiDelegate/110/
[DEBUG] - 2017-02-20 14:19:37,601 - Creating application folder for Teamviewer
[DEBUG] - 2017-02-20 14:19:37,602 - new application Telegram path : /home/andy/.TelegramDesktop/Telegram
[DEBUG] - 2017-02-20 14:19:37,602 - new application Telegram path : /home/andy/.local/share/TelegramDesktop/Telegram
[DEBUG] - 2017-02-20 14:19:37,602 - new application Telegram path : /home/andy/.TelegramDesktop/tdata/ticons/
[DEBUG] - 2017-02-20 14:19:37,602 - new application Telegram path : /home/andy/.local/share/TelegramDesktop/tdata/ticons/
[DEBUG] - 2017-02-20 14:19:37,605 - new application Tomahawk path : /home/andy/.local/share/sni-qt/icons/tomahawk/110/
[DEBUG] - 2017-02-20 14:19:37,605 - Creating application folder for Tomahawk
[DEBUG] - 2017-02-20 14:19:37,606 - new application WizNote path : /home/andy/.local/share/sni-qt/icons/WizNote/110/
[DEBUG] - 2017-02-20 14:19:37,607 - Backup current file /usr/lib/chromium/resources.pak to /home/andy/.config/Hardcode-Tray/Chromium/20-02-2017_14-19-37/resources.pak.bak
[DEBUG] - 2017-02-20 14:19:42,162 - Backup current file /usr/lib/slack/resources/app.asar.unpacked/src/static/slack-taskbar-highlight.png to /home/andy/.config/Hardcode-Tray/Slack/20-02-2017_14-19-42/slack-taskbar-highlight.png.bak
[DEBUG] - 2017-02-20 14:19:42,402 - Backup current file /usr/lib/slack/resources/app.asar.unpacked/src/static/slack-taskbar-rest.png to /home/andy/.config/Hardcode-Tray/Slack/20-02-2017_14-19-42/slack-taskbar-rest.png.bak
[DEBUG] - 2017-02-20 14:19:42,653 - Backup current file /usr/lib/slack/resources/app.asar.unpacked/src/static/slack-taskbar-unread.png to /home/andy/.config/Hardcode-Tray/Slack/20-02-2017_14-19-42/slack-taskbar-unread.png.bak
[DEBUG] - 2017-02-20 14:19:43,173 - Backup current file /home/andy/.TelegramDesktop/tdata/ticons/icomute_22_0.png to /home/andy/.config/Hardcode-Tray/Telegram/20-02-2017_14-19-43/icomute_22_0.png.bak
[DEBUG] - 2017-02-20 14:19:43,423 - Backup current file /home/andy/.TelegramDesktop/tdata/ticons/icomute_22_1.png to /home/andy/.config/Hardcode-Tray/Telegram/20-02-2017_14-19-43/icomute_22_1.png.bak
[DEBUG] - 2017-02-20 14:19:48,330 - Backup current file /home/andy/.TelegramDesktop/tdata/ticons/ico_22_1.png to /home/andy/.config/Hardcode-Tray/Telegram/20-02-2017_14-19-43/ico_22_1.png.bak
[DEBUG] - 2017-02-20 14:19:53,154 - Backup current file /usr/share/yakyak/app/icons/icon-read.png to /home/andy/.config/Hardcode-Tray/Yakyak/20-02-2017_14-19-53/icon-read.png.bak
[DEBUG] - 2017-02-20 14:19:53,397 - Backup current file /usr/share/yakyak/app/icons/icon-read@2x.png to /home/andy/.config/Hardcode-Tray/Yakyak/20-02-2017_14-19-53/icon-read@2x.png.bak
[DEBUG] - 2017-02-20 14:19:53,649 - Backup current file /usr/share/yakyak/app/icons/icon-unread.png to /home/andy/.config/Hardcode-Tray/Yakyak/20-02-2017_14-19-53/icon-unread.png.bak
[DEBUG] - 2017-02-20 14:19:53,876 - Backup current file /usr/share/yakyak/app/icons/icon-unread@2x.png to /home/andy/.config/Hardcode-Tray/Yakyak/20-02-2017_14-19-53/icon-unread@2x.png.bak

Looks like it's grabbing the wrong iconSize entry. I guess you need to be checking for something like \[Containments\]\[\d+\]\[General\]

@AndydeCleyre
Copy link
Author

AndydeCleyre commented Feb 20, 2017

But it won't be the only match. Actually here's a grep-friendly regex:

\[Containments\]\[[0-9]+\]\[General\]

At least for me, only one of the sections matching that has an iconSize entry.

@bilelmoussaoui
Copy link
Owner

Alright, i thought that it must be defined only once :) It should be correctly detected now :)

@AndydeCleyre
Copy link
Author

Thanks, it seems to find the right setting now. The output is a little crazy:

None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
<_sre.SRE_Match object; span=(0, 26), match='[Containments][1][General]'>
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
None
<_sre.SRE_Match object; span=(0, 28), match='[Containments][132][General]'>
Welcome to the tray icons hardcoder fixer!
Your indicator icon size is : 66
<and then the normal rest of the output>

@bilelmoussaoui
Copy link
Owner

Perfect! It was a debugging output that i've frogot to remove; it's removed now :) If you have any other issue with that, it should be reported upstream now :) thanks for your patient!
Those fixes should land on stable by this weekend 👍

@AndydeCleyre
Copy link
Author

Thank you so much for working through this, and for this project.

@bilelmoussaoui
Copy link
Owner

My pleasure ;)

@AndydeCleyre
Copy link
Author

Hello! I don't think this is really working yet.

3.7.r4.gd5410a8

hardcode-tray -a --change-color "#d3dae3 #c2b790" --theme Papirus-Dark
Welcome to the tray icons hardcoder fixer!
Your indicator icon size is : 44
The detected desktop environement : Kde
Your current icon theme is : Papirus-Dark
Conversion tool : Inkscape
Applications will be fixed : All
Applying now..

Chromium            [##......................................] 1/16 6.2%
Hexchat             [############............................] 5/16 31.2%
HP Printer          [###############.........................] 6/16 37.5%
Slack               [######################..................] 9/16 56.2%
Telegram            [##############################..........] 12/16 75.0%
Yakyak              [########################################] 16/16 100.0%

Done, Thank you for using the Hardcode-Tray fixer!
mediainfo .TelegramDesktop/tdata/ticons/ico_22_1.png|grep pixels
Width                                    : 22 pixels
Height                                   : 22 pixels
mediainfo .config/hexchat/icons/hexchat.png|grep pixels
Width                                    : 22 pixels
Height                                   : 22 pixels
mediainfo /usr/lib/slack/resources/app.asar.unpacked/src/static/slack-taskbar-unread.png|grep pixels
Width                                    : 22 pixels
Height                                   : 22 pixels

@AndydeCleyre
Copy link
Author

I'm currently using this for better results:

icon_size="512"
main_color="#c2b790"
accent_color="#a94d37"
main_color_old="#d3dae3"
accent_color_old="#5294e2"

tg_icons="$HOME/.TelegramDesktop/tdata/ticons"
tg_tmp="/tmp/tg_svgs"
mkdir -p ${tg_tmp} ${tg_icons}
for i in '_22':'' '_22_1':'attention-' 'mute_22_0':'' 'mute_22_1':'mute-'; do
    ico=${i%:*}; name=${i#*:}
    sed "s/${main_color_old}/${main_color}/gi" ${panel_icons}/telegram-${name}panel.svg > ${tg_tmp}/telegram-${name}panel.svg
    sed -i "s/${accent_color_old}/${accent_color}/gi" ${tg_tmp}/telegram-${name}panel.svg
    inkscape -z -e ${tg_icons}/ico${ico}.png -w ${icon_size} -h ${icon_size} ${tg_tmp}/telegram-${name}panel.svg &>/dev/null
done
for f in {2..2000}; do
    ln -sf ${tg_icons}/ico_22_1.png ${tg_icons}/ico_22_${f}.png
    ln -sf ${tg_icons}/icomute_22_1.png ${tg_icons}/icomute_22_${f}.png
done

slack_icons="/usr/lib/slack/resources/app.asar.unpacked/src/static"
slack_tmp="/tmp/slack_svgs"
mkdir -p ${slack_tmp}
for i in '':'rest' '-unread':'unread' '-unread':'highlight'; do
    ico=${i%:*}; name=${i#*:}
    sed "s/${main_color_old}/${main_color}/gi" ${panel_icons}/slack-indicator${ico}.svg > ${slack_tmp}/slack-taskbar-${name}.svg
    sed -i "s/${accent_color_old}/${accent_color}/gi" ${slack_tmp}/slack-taskbar-${name}.svg
    inkscape -z -e ${slack_tmp}/slack-taskbar-${name}.png -w ${icon_size} -h ${icon_size} ${slack_tmp}/slack-taskbar-${name}.svg &>/dev/null
    sudo cp ${slack_tmp}/*png ${slack_icons}/
done

hex_icons="$HOME/.config/hexchat/icons"
hex_tmp="/tmp/hex_svgs"
mkdir -p ${hex_icons} ${hex_tmp}
for i in 'indicator':'hexchat' 'highlight':'tray_fileoffer' 'highlight':'tray_highlight' 'highlight':'tray_message'; do
    ico=${i%:*}; name=${i#*:}
    sed "s/${main_color_old}/${main_color}/gi" ${panel_icons}/hexchat-${ico}.svg > ${hex_tmp}/${name}.svg
    sed -i "s/${accent_color_old}/${accent_color}/gi" ${hex_tmp}/${name}.svg
    inkscape -z -e ${hex_icons}/${name}.png -w ${icon_size} -h ${icon_size} ${hex_tmp}/${name}.svg &>/dev/null
done

@bilelmoussaoui
Copy link
Owner

I will take a look this evening ;) thanks for trying this out, as i don't have a HDPi screen to test it

@AndydeCleyre
Copy link
Author

No problem, but as I've mentioned, I don't have any high dpi screens either.

@bilelmoussaoui
Copy link
Owner

@AndydeCleyre Hey, I have released a new version yesterday; You will have to reinstall it as there was a lot of changes. it should now work as expected as i have fixed few issues with the conversion from SVG to PNG. The icons are scaled up only for PNG ones, as i can't rescale SVG ones (done automatically normally...)

@AndydeCleyre
Copy link
Author

AndydeCleyre commented May 25, 2017

Hi, I've just tried with 3.8.1. It's detecting indicator size of 22 and creating icons that size, so they don't look good. But the detected size may be because we never accounted for the presence of multiple systray instances with different icon sizes, which I currently have. I can't specify the size with --size because that has an upper limit of 24, while the plasma tray icons on non-high-dpi systems can be any of (16, 22, 32, 48, 64, 128).

@bilelmoussaoui
Copy link
Owner

@AndydeCleyre I will need more info to debug this, can you join the chat on Gitter and see how we can fix this 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants