bilelmoussaoui / Hardcode-Tray

Fixes Hardcoded tray icons in Linux
Other
861 stars 63 forks source link

Element icon keeps switching back #684

Open poperigby opened 3 years ago

poperigby commented 3 years ago

Specifications

Expected behavior and actual behavior

Every time I run hardcode-tray, Element's tray icon gets properly switched, but when I start Element again the icon gets switched back after a couple of seconds.

Steps to reproduce the problem

  1. Close Element
  2. Run sudo -E hardcode-tray --conversion-tool RSVGConvert --size 22
  3. Start Element again
varlesh commented 3 years ago

strange behavior, i'm test with DEB-package 1.7.23 all worked fine and icon not changed... Try check visual changed icon on /usr/lib/element/img/element.png when switched after a couple of seconds. Also try maybe after applying hardcode-tray set read-only premissions for this icon: sudo chmod 444 /usr/lib/element/img/element.png

IF-Adin commented 3 years ago

@varlesh I have the same problem. It happens when i get any message. Also i can not find an element folder in /usr/lib. Using Kubuntu, newest version.

varlesh commented 3 years ago

It's old bug. Aplication initially use PNG but after loading - used ICO: https://github.com/bilelmoussaoui/Hardcode-Tray/issues/527 hardcode-tray not support ICO, but i think it's can be fixed manually. Try it:

cd /opt/Element/resources/img/
sudo ffmpeg -i element.png element.ico
IF-Adin commented 3 years ago

@varlesh Ok, i did what you said, but it changed nothing. It seems that it's not using the ico. I did a full search and i did not find an element.ico anywhere else on my drive.

Thank you for all the help by the way, you are awesome.

IF-Adin commented 3 years ago

Also, not sure if related, but i noticed that when i change the icon theme, the element tray icon disappears altogether. It is the only app that has this problem for me.

IF-Adin commented 3 years ago

Ok, so i have found the issue. The icon is in the webapp.asar When you unpack /opt/Element/resources/webpack.asar you can find the icon in /vector-icons/

varlesh commented 3 years ago

yes, on sources used favicon code... i think used favicon.ico for tray from webpack.asar anyway we can't fix that, because hardcode-tray not support ICO

at-pyrix commented 2 years ago

Ok, so i have found the issue. The icon is in the webapp.asar When you unpack /opt/Element/resources/webpack.asar you can find the icon in /vector-icons/

Hmm... I can't find the /Element folder in /opt

varlesh commented 2 years ago

on Archlinux it's /usr/lib/element

at-pyrix commented 2 years ago

ok, thanks

rauldipeas commented 2 years ago

Any news on this issue? It's not possible to fix the .ico using ffmpeg?

rauldipeas commented 2 years ago

My temporary fix, maybe help someone...

npx asar e\
    /opt/Element/resources/webapp.asar\
    element-asar
rsvg-convert -f png\
    /usr/share/icons/Papirus/24x24/panel/element-desktop-tray.svg\
    -o element-asar/vector-icons/favicon.*.ico
npx asar p\
    element-asar\
    webapp.asar
sudo cp -rf\
    webapp.asar\
    /opt/Element/resources/
sudo rsvg-convert -f png -h 256 -w 256\
    /usr/share/icons/Papirus/24x24/panel/element-desktop-tray.svg\
    -o /opt/Element/resources/img/element.png
rm -rf\
    element-asar\
    webapp.asar
rauldipeas commented 2 years ago

yes, on sources used favicon code... i think used favicon.ico for tray from webpack.asar anyway we can't fix that, because hardcode-tray not support ICO

As you can see on my temporary fix, there's no need to convert to ico format, just use the png format and everything's fine.