1
0
Fork 0
mirror of https://github.com/Zedfrigg/ironbar.git synced 2025-04-19 19:34:24 +02:00

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
This commit is contained in:
slowsage 2024-02-26 13:43:21 -05:00 committed by Jake Stanger
parent 39cb35b59d
commit f2638497fa
No known key found for this signature in database
GPG key ID: C51FC8F9CB0BEA61

View file

@ -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);