Skip to content

Commit

Permalink
fix(launcher): not resolving icon for some apps
Browse files Browse the repository at this point in the history
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
  • Loading branch information
slowsage authored and JakeStanger committed Feb 27, 2024
1 parent 39cb35b commit f263849
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/modules/launcher/item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(&gtk_image));
button.set_always_show_image(true);
Expand Down

0 comments on commit f263849

Please sign in to comment.