bilelmoussaoui / Hardcode-Tray

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

[Icon Request] ytmdesktop #642

Closed yochananmarqos closed 4 years ago

yochananmarqos commented 4 years ago

Specifications

varlesh commented 4 years ago

added, but not tested... app contained also:

yochananmarqos commented 4 years ago

It's not detecting either package for some reason.

Welcome to Hardcode-Tray!
Hardcode-Tray replaces some icons on the binary files of some applications. 
Please close all the running applications before running Hardcode-Tray script.
Desktop Environment: Other
Scaling Factor: 1
Icon Size: 24
Icon Theme: Papirus-Dark-Maia
Conversion Tool: RSVGConvert
To Do: All
1 - Apply
2 - Revert
3 - Clear Backup Cache
Please choose: 1
Applying now..

Android Messages Desktop    [###.................................] 1/13 7.7% 0.15s
Bitwarden           [######..............................] 2/13 15.4% 0.09s
Chromium            [########............................] 3/13 23.1% 0.15s
Google Chrome       [###########.........................] 4/13 30.8% 0.15s
HP Printer          [##############......................] 5/13 38.5% 0.00s
JDownloader         [#################...................] 6/13 46.2% 0.02s
Keybase             [###################.................] 7/13 53.8% 0.38s
MullvadVPN          [######################..............] 8/13 61.5% 1.44s
Nicotine +          [#########################...........] 9/13 69.2% 0.08s
Skype               [############################........] 10/13 76.9% 3.15s
Solaar              [##############################......] 11/13 84.6% 0.12s
Steam               [#################################...] 12/13 92.3% 0.02s
Vivaldi             [####################################] 13/13 100.0% 0.05s
Took 5.80s to finish the tasks

Done, Thank you for using the Hardcode-Tray fixer!
varlesh commented 4 years ago

Papirus-Dark-Maia maybe not contained icons? Try it with fresh git-version Papirus

varlesh commented 4 years ago

https://github.com/PapirusDevelopmentTeam/papirus-icon-theme/commit/67aab707707646a1d4d5699a87524970b7915603

yochananmarqos commented 4 years ago

papirus-maia-icon-theme depends on papirus-icon-theme, so it should work as it has before. I installed papirus-icon-theme-git from the AUR, still no luck. I also tried --theme Papirus-Dark.

varlesh commented 4 years ago

i'm extract appimage 1.11 version and unpack app.asar. This file contained icons:

Ico - Windows Icns - OSX png - Linux

Files path added to database and Papirus to

varlesh commented 4 years ago

image

{
    "name": "YouTube Music Desktop",
    "app_path": [
        "/opt/ytmdesktop/",
        "/usr/lib/ytmdesktop"
    ],
    "icons_path": [
        "/opt/ytmdesktop/resources/",
        "/usr/lib/ytmdesktop/resources/"
    ],
    "binary": "app.asar",
    "script": "electron",
    "icons": {
        "tray": {
            "original": "src/assets/favicon.png",
            "theme": "youtube-music-desktop-app-tray"
        },
        "tray-play": {
            "original": "src/assets/favicon_play.png",
            "theme": "youtube-music-desktop-app-tray-play"
        },
        "tray-pause": {
            "original": "src/assets/favicon_pause.png",
            "theme": "youtube-music-desktop-app-tray-pause"
        }
    }
}
yochananmarqos commented 4 years ago

As far as I've seen, the tray icon does not change when the player is paused. Not sure if that has anything to do with it or not.

yochananmarqos commented 4 years ago

Turns out it is applying:

YouTube Music Desktop [####################################] 14/14 100.0% 0.96s

However, the tray icon is still the original.

varlesh commented 4 years ago

My fault, sorry. This app use base64image, but this not supported: https://github.com/ytmdesktop/ytmdesktop/blob/master/src/icons_for_shiny_tray.js Similar problem with Slack: https://github.com/bilelmoussaoui/Hardcode-Tray/issues/605

varlesh commented 4 years ago

for info: icons located on app.asar/src/icons_for_shiny_tray.js

BlueManCZ commented 4 years ago

I just tested this and it doesn't use base64. It looks like it uses the default system icon, because tray icon changes dynamically with icon themes without an application restart.

Papirus: Snímek z 2020-07-31 00-08-24 Numix: Snímek z 2020-07-31 00-08-49

varlesh commented 4 years ago

@BlueManCZ But how draw pause & play state? on KDE appimage draw this: image image image

BlueManCZ commented 4 years ago

@varlesh I didn't test it on KDE. On Gnome these icons never appeared. I will look into it and let you know.

BlueManCZ commented 4 years ago

You are right, on KDE it behaves differently. But I can only confirm it doesn't use base64. These icons in assets don't work?

Snímek obrazovky pořízený 2020-07-31 12-18-49

varlesh commented 4 years ago

See my comment https://github.com/bilelmoussaoui/Hardcode-Tray/issues/642#issuecomment-647871023 I try only png's. How say @yochananmarqos this not worked

varlesh commented 4 years ago

If app superimposed pause.png & play.png on main icon - it's impossible themable or very hard doing this. Anyway this app strange draw tray icons

BlueManCZ commented 4 years ago

But keep in mind, @yochananmarqos tested it on Gnome, as I did before https://github.com/bilelmoussaoui/Hardcode-Tray/issues/642#issuecomment-666739813. It uses system-icons in Gnome.

BlueManCZ commented 4 years ago

@varlesh Your .json file works on KDE for me.

Snímek obrazovky pořízený 2020-07-31 12-55-55 Snímek obrazovky pořízený 2020-07-31 12-56-22 Snímek obrazovky pořízený 2020-07-31 12-56-46

BlueManCZ commented 4 years ago

Now the question is, how to fix this icon in Gnome? Are there any cases like this, where the icon behaves differently in Gnome than in KDE? @varlesh @bilelmoussaoui

varlesh commented 4 years ago

It's good news)) I can't test it because have only appimage & DEB-based distro. I think it's will be worked for GNOME with KDE environment hack: XDG_CURRENT_DESKTOP=KDE ytmdesktop Try it

BlueManCZ commented 4 years ago

You are right!

With XDG_CURRENT_DESKTOP=GNOME:

Snímek z 2020-07-31 13-05-59

With XDG_CURRENT_DESKTOP=KDE:

Snímek z 2020-07-31 13-06-19

varlesh commented 4 years ago

Ok. Closed

varlesh commented 4 years ago

@yochananmarqos As solution use KDE env option. Change Exec on desktop file to: Exec=XDG_CURRENT_DESKTOP=KDE ytmdesktop %U https://aur.archlinux.org/cgit/aur.git/tree/ytmdesktop.desktop?h=ytmdesktop#n5 https://aur.archlinux.org/cgit/aur.git/tree/ytmdesktop.desktop?h=ytmdesktop-git#n5

yochananmarqos commented 4 years ago

@varlesh Yep, that works. Thanks!

BlueManCZ commented 4 years ago

I think the correct way how to handle this in .desktop file is Exec=env XDG_CURRENT_DESKTOP=KDE ytmdesktop %U

yochananmarqos commented 4 years ago

@BlueManCZ Yep, I just realized that after adding it to the desktop file.