Alexays / Waybar

Highly customizable Wayland bar for Sway and Wlroots based compositors. :v: :tada:
MIT License
6.27k stars 689 forks source link

taskbar: dektop file icon of chromium PWA not respected #3510

Open Etch9 opened 1 month ago

Etch9 commented 1 month ago

I edited a chromium pwa's desktop file to change its icon but it remains the same in the taskbar, here's the desktop file:

#!/usr/bin/env xdg-open

[Desktop Entry]
Version=1.1
Terminal=false
Type=Application
Name=Cinny
Exec=flatpak 'run' '--command=/app/bin/chromium' 'io.github.ungoogled_software.ungoogled_chromium' '--profile-directory=Default' '--app-id=bcngdmpegpihnheapppgoniglphkpfhm'
Icon=/path/to/cinny.png
StartupWMClass=crx_bcngdmpegpihnheapppgoniglphkpfhm
X-Flatpak-Part-Of=io.github.ungoogled_software.ungoogled_chromium
TryExec=/var/lib/flatpak/exports/bin/io.github.ungoogled_software.ungoogled_chromium

here is a screenshot for reference: image

RobertMueller2 commented 1 month ago

wlr/taskbar receives a list of app_ids (or changing app_ids) through zwlr_foreign_toplevel_manager_v1.. Based on this app_id, wlr/taskbar looks for a matching .desktop file.

If I had to guess, the app_id is still chromium. Starting waybar with log level debug may offer some insight what wlr/taskbar sees. Is that environment hyprland? hyprctl clients may list the app_id as well, provided chromium is running in wayland mode.

Etch9 commented 1 month ago

the taskbar widget shows the app-id to be chrome-bcngdmpegpihnheapppgoniglphkpfhm-Default whilst the desktop file is found in ~/username/.local/share/applications/io.github.ungoogled_software.ungoogled_chromium.flextop.chrome-bcngdmpegpihnheapppgoniglphkpfhm-Default.desktop using exo-open i verified that it does open cinny. The compositor is niri, how do i start waybar with log level?

RobertMueller2 commented 1 month ago

If you have the config in a default location, you could just run waybar -l debug from command line. It starts a second.

What you could also try try is to link io.github.ungoogled_software.ungoogled_chromium.flextop.chrome-bcngdmpegpihnheapppgoniglphkpfhm-Default.desktop to chrome-bcngdmpegpihnheapppgoniglphkpfhm-Default.desktop.

Etch9 commented 1 month ago

Running waybar in debug mode gives this:

[2024-08-06 20:16:52.027] [debug] Task (2) setting app_id to unknown
[2024-08-06 20:16:52.029] [debug] Task (2)  [unknown] <amif> Loaded icon 'unknown'
[2024-08-06 20:16:52.029] [debug] Task (2) overwriting app_id 'unknown' with 'chrome-bcngdmpegpihnheapppgoniglphkpfhm-Default'
[2024-08-06 20:16:52.033] [debug] Task (2) Cinny [chrome-bcngdmpegpihnheapppgoniglphkpfhm-Default] <amif> Loaded icon 'io.github.ungoogled_software.ungoogled_chromium'
[2024-08-06 20:16:52.033] [debug] Task (2) Cinny [chrome-bcngdmpegpihnheapppgoniglphkpfhm-Default] <amif> entered output 0x568ca790b0e0
[2024-08-06 20:16:52.034] [debug] Task (2) Cinny [chrome-bcngdmpegpihnheapppgoniglphkpfhm-Default] <amif> now visible on eDP-1
[2024-08-06 20:16:52.034] [debug] Task (2) Cinny [chrome-bcngdmpegpihnheapppgoniglphkpfhm-Default] <amif> changed

Yes changing the name worked! image if i change the app_id using rewrite could i point wlr/taskbar to the right .desktop file? because now my runner sees 2 cinny

Etch9 commented 1 month ago

This is the debug output with the symlink:

[2024-08-06 20:29:30.036] [debug] Task (3) setting app_id to unknown
[2024-08-06 20:29:30.039] [debug] Task (3)  [unknown] <amif> Loaded icon 'unknown'
[2024-08-06 20:29:30.039] [debug] Task (3) overwriting app_id 'unknown' with 'chrome-bcngdmpegpihnheapppgoniglphkpfhm-Default'
[2024-08-06 20:29:30.051] [debug] Task (3) Cinny [chrome-bcngdmpegpihnheapppgoniglphkpfhm-Default] <amif> Loaded icon from file '/home/etch/cinny.png'
[2024-08-06 20:29:30.051] [debug] Task (3) Cinny [chrome-bcngdmpegpihnheapppgoniglphkpfhm-Default] <amif> entered output 0x584e00af0290
[2024-08-06 20:29:30.051] [debug] Task (3) Cinny [chrome-bcngdmpegpihnheapppgoniglphkpfhm-Default] <amif> now visible on eDP-1
[2024-08-06 20:29:30.051] [debug] Task (3) Cinny [chrome-bcngdmpegpihnheapppgoniglphkpfhm-Default] <amif> changed
RobertMueller2 commented 1 month ago

I think you could try an app id mapping within wlr/taskbar config. Like this maybe?

                "app_ids-mapping": {
                     "chrome-bcngdmpegpihnheapppgoniglphkpfhm-Default": "io.github.ungoogled_software.ungoogled_chromium.flextop.chrome-bcngdmpegpihnheapppgoniglphkpfhm-Default"
                },
Etch9 commented 1 month ago

I can confirm that mapping the id works!