From f2638497fac4f0e350d069857e6e7437cb756669 Mon Sep 17 00:00:00 2001 From: slowsage <84777606+slowsage@users.noreply.github.com> Date: Mon, 26 Feb 2024 13:43:21 -0500 Subject: [PATCH] fix(launcher): not resolving icon for some apps When using spotify in wayland with hyprland, the spotify icon is not pulled up correctly by the launcher module. The class/app_id is "" while the name/title is "Spotify Premium". This uses item.name as a fallback which ensure spotify icon shows up correctly under wayland. Refs: #228, #146 --- src/modules/launcher/item.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/modules/launcher/item.rs b/src/modules/launcher/item.rs index ba4407d1..924b74ab 100644 --- a/src/modules/launcher/item.rs +++ b/src/modules/launcher/item.rs @@ -166,8 +166,12 @@ impl ItemButton { if appearance.show_icons { let gtk_image = gtk::Image::new(); - let image = - ImageProvider::parse(&item.app_id.clone(), icon_theme, true, appearance.icon_size); + let input = if item.app_id.is_empty() { + item.name.clone() + } else { + item.app_id.clone() + }; + let image = ImageProvider::parse(&input, icon_theme, true, appearance.icon_size); if let Some(image) = image { button.set_image(Some(>k_image)); button.set_always_show_image(true);