Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(launcher): item.name as fallback for app icon #476

Merged
merged 1 commit into from
Feb 27, 2024
Merged

feat(launcher): item.name as fallback for app icon #476

merged 1 commit into from
Feb 27, 2024

Conversation

slowsage
Copy link
Contributor

When using spotify in wayland with hyprland, the spotify icon is not pulled up correctly by the launcher module:
spotify --enable-features=UseOzonePlatform,WaylandWindowDecorations --ozone-platform=wayland
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. Spotify under X11 does not have this problem.

Refs: #228, #146

Comment on lines +169 to +173
let input = if item.app_id.is_empty() {
item.name.clone()
} else {
item.app_id.clone()
};
Copy link
Owner

@JakeStanger JakeStanger Feb 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Untested but I think you can reduce this to the following:

Suggested change
let input = if item.app_id.is_empty() {
item.name.clone()
} else {
item.app_id.clone()
};
let input = let input = item.app_id.cloned().unwrap_or_else(|| item.app_id.clone());

Or you might be able to use .or_else, and use a single clone at the end

@JakeStanger
Copy link
Owner

Cheers for the PR, seems like a good fix

Copy link
Owner

@JakeStanger JakeStanger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All LGTM, I'll try and give this a test in the next couple of days then merge, thanks!

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
@JakeStanger JakeStanger merged commit 149b57a into JakeStanger:master Feb 27, 2024
8 checks passed
@slowsage slowsage deleted the spotify-wayland-icon branch March 4, 2024 03:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants