Skip to content

Commit 7c2e775

Browse files
committed
feat(launcher): item.name as fallback for app icon
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
1 parent 39cb35b commit 7c2e775

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/modules/launcher/item.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,12 @@ impl ItemButton {
166166

167167
if appearance.show_icons {
168168
let gtk_image = gtk::Image::new();
169-
let image =
170-
ImageProvider::parse(&item.app_id.clone(), icon_theme, true, appearance.icon_size);
169+
let input = if item.app_id.is_empty() {
170+
item.name.clone()
171+
} else {
172+
item.app_id.clone()
173+
};
174+
let image = ImageProvider::parse(&input, icon_theme, true, appearance.icon_size);
171175
if let Some(image) = image {
172176
button.set_image(Some(&gtk_image));
173177
button.set_always_show_image(true);

0 commit comments

Comments
 (0)