Alexays / Waybar

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

wlr/taskbar: Missing icons for signal-desktop and gnome-terminal #921

Open cryptoluks opened 3 years ago

cryptoluks commented 3 years ago

Hi,

when running wayland --log-level trace it can be observed, that for Signal (signal-desktop) and the Gnome Terminal (gnome-terminal which spawns gnome-terminal-server) no icons can be found.

[2020-11-24 09:05:53.307] [debug] Couldn't find icon for Signal

For both applications, icons are defined in their respective .desktop file and they are also available on my system under /usr/share/icons.

❯ grep -i icon /usr/share/applications/signal-desktop.desktop 
Icon=signal-desktop
❯ find /usr/share/icons -iname "*"signal-desktop"*"
/usr/share/icons/hicolor/128x128/apps/signal-desktop.png
/usr/share/icons/hicolor/16x16/apps/signal-desktop.png
/usr/share/icons/hicolor/24x24/apps/signal-desktop.png
/usr/share/icons/hicolor/256x256/apps/signal-desktop.png
/usr/share/icons/hicolor/32x32/apps/signal-desktop.png
/usr/share/icons/hicolor/48x48/apps/signal-desktop.png
/usr/share/icons/hicolor/512x512/apps/signal-desktop.png
/usr/share/icons/hicolor/64x64/apps/signal-desktop.png
/usr/share/icons/hicolor/1024x1024/apps/signal-desktop.png
/usr/share/icons/Papirus/16x16/apps/signal-desktop-beta.svg
/usr/share/icons/Papirus/16x16/apps/signal-desktop.svg
/usr/share/icons/Papirus/22x22/apps/signal-desktop-beta.svg
/usr/share/icons/Papirus/22x22/apps/signal-desktop.svg
/usr/share/icons/Papirus/24x24/apps/signal-desktop-beta.svg
/usr/share/icons/Papirus/24x24/apps/signal-desktop.svg
/usr/share/icons/Papirus/32x32/apps/signal-desktop-beta.svg
/usr/share/icons/Papirus/32x32/apps/signal-desktop.svg
/usr/share/icons/Papirus/48x48/apps/signal-desktop-beta.svg
/usr/share/icons/Papirus/48x48/apps/signal-desktop.svg
/usr/share/icons/Papirus/64x64/apps/signal-desktop-beta.svg
/usr/share/icons/Papirus/64x64/apps/signal-desktop.svg

I also tried changing the used icon theme in the wlr/taskbar settings in the waybar config without success. Using the latest waybar-git (Archlinux AUR).

Please let me know if I can provide more information to pinpoint the issue.

Thank you very much.

cryptoluks commented 3 years ago

I just installed the icon theme Numix Circle as in the waybar taskbar manpage shown and added "icon-theme": "Numix-Circle" to my waybar config.

Now for signal-desktop an icon is shown in the taskbar, but still not for gnome-terminal.

l3nkz commented 3 years ago

The problem is probably, that the app doesn't provide the correct app-id which is used to find the icon. Unfortunately, this is nothing that I can solve within the plugin. I only get the information that the compositor provides to me via the foreign-toplevel-manager protocol.

qoheniac commented 3 years ago

I tested four programs (Zoom, Thunderbird, Firefox, GNOME Terminal) and it looks like this ("format": "{icon} {app_id}"):

bar

And here are the app IDs as found in swaymsg -t get_tree and the location of the .desktop files:

Program App ID .desktop File
Zoom "zoom" /usr/share/applications/Zoom.desktop
Thunderbird null /usr/share/applications/mozilla-thunderbird.desktop
Firefox null /usr/share/applications/firefox.desktop
GNOME Terminal "gnome-terminal-server" /usr/share/applications/org.gnome.Terminal.desktop
ROXterm "roxterm" /usr/share/applications/roxterm.desktop

So it works if app id is null, but not if it is set to some (wrong?) value.

Edit: I added ROXterm as an example where it seems to find the icon based on the app ID.

s-mcf commented 3 years ago

Firefox sets app_id when using the Wayland backend (ie when MOZ_ENABLE_WAYLAND is set), but I see an icon in wlr/taskbar. Curiously, for Firefox Nightly, which also sets app_id to "firefox" as mainline Firefox does, I see the mainline Firefox icon only if I have mainline Firefox installed. If I uninstall mainline Firefox, Firefox Nightly has no icon.

Here's my table:

Program app_id icon name set in .desktop file Icon in hicolor folder? Icon in pixmaps folder? Icon in wlr/taskbar?
Firefox (Wayland mode) firefox firefox yes no yes
Firefox (X11 mode) null firefox yes no yes
Firefox Nightly firefox firefox-nightly yes no shows mainline Firefox icon instead, if mainline Firefox is installed
Thunderbird thunderbird thunderbird yes no yes
Telegram telegramdesktop telegram yes no yes
Signal null signal-desktop yes no no
Zoom zoom Zoom no yes no
Discord null discord no yes yes
Alacritty Alacritty Alacritty no yes yes

waybar -l trace doesn't show any detail beyond "Couldn't find icon for \<app>".

l3nkz commented 3 years ago

There were some recent changes regarding the icon finding code. Can you try with the latest master branch?

qoheniac commented 3 years ago

With the latest master branch the icons for Dino, Signal and Zoom are now found but the icon for gnome-terminal still isn't.

scqcasc commented 9 months ago

I was able to get the gnome-terminal icon by adding this app_ids-mapping:

"gnome-terminal-server": "org.gnome.Terminal"