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

Player icon not working properly #47

Closed
lorenzobazzana opened this issue Dec 15, 2021 · 4 comments
Closed

Player icon not working properly #47

lorenzobazzana opened this issue Dec 15, 2021 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@lorenzobazzana
Copy link

Hi, I think there's an issue with some player icons for gnome themes that use the default icon for those players.

For example, the theme "Flat Remix" has a custom icon for Spotify and Rhythmbox and everything works fine, while the theme "Flatery-dark" uses the default icons and they don't show up at all, they're replaced istead by a generic audio icon.

By looking around, I think that the issue is related to the get icon() method at line 862 in player.js: if the value returned does not match exactly an app icon the extension just thinks that there's no icon at all for that app. This means that some default icons are ignored because they have different names (eg. com.spotify.Client or org.gnome.Rhythmbox)

@ChrisLauinger77 ChrisLauinger77 added the bug Something isn't working label Oct 6, 2023
@sakithb sakithb self-assigned this Oct 9, 2023
@sakithb sakithb moved this to 📋 Backlog in Media Controls v28/v29 Oct 9, 2023
@sakithb sakithb moved this from 📋 Backlog to 🏗 In progress in Media Controls v28/v29 Oct 11, 2023
@ChrisLauinger77
Copy link
Collaborator

ChrisLauinger77 commented Oct 13, 2023

    get icon() {
        let icon;

        if (this._otherProxy.DesktopEntry) {
            icon = this._otherProxy.DesktopEntry;
        } else {
            icon = this.name.toLowerCase().split(" ");
            icon = icon[icon.length - 1];
        }
        if (!icon.includes(".")) {
            let appsys = Shell.AppSystem.get_default();
            for (let app of appsys.get_running()) {
                if (app.get_name().toLowerCase().includes(icon)) {
                    icon = app.get_id().replace(".desktop", "");
                }
            }
        }
        return icon;
    }

this would be my proposal @sakithb
it looks for running apps and finds the icon
this import also would need to be added:

import Shell from "gi://Shell";

I worked on it - not realising you also had it in progress :(

@sakithb
Copy link
Owner

sakithb commented Oct 14, 2023

    get icon() {
        let icon;

        if (this._otherProxy.DesktopEntry) {
            icon = this._otherProxy.DesktopEntry;
        } else {
            icon = this.name.toLowerCase().split(" ");
            icon = icon[icon.length - 1];
        }
        if (!icon.includes(".")) {
            let appsys = Shell.AppSystem.get_default();
            for (let app of appsys.get_running()) {
                if (app.get_name().toLowerCase().includes(icon)) {
                    icon = app.get_id().replace(".desktop", "");
                }
            }
        }
        return icon;
    }

this would be my proposal @sakithb it looks for running apps and finds the icon this import also would need to be added:

import Shell from "gi://Shell";

I worked on it - not realising you also had it in progress :(

Thanks, that should work, you can push the changes, I did not really progress on the issue much.

@sakithb
Copy link
Owner

sakithb commented Oct 14, 2023

or I can do it if you don't mind

ChrisLauinger77 added a commit that referenced this issue Oct 14, 2023
ChrisLauinger77 added a commit that referenced this issue Oct 14, 2023
@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in Media Controls v28/v29 Oct 14, 2023
@ChrisLauinger77
Copy link
Collaborator

main and gnome44 updated

@sakithb sakithb assigned ChrisLauinger77 and unassigned sakithb Oct 14, 2023
@sakithb sakithb moved this from ✅ Done to 👀 In review in Media Controls v28/v29 Oct 18, 2023
@sakithb sakithb moved this from 👀 In review to ✅ Done in Media Controls v28/v29 Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
No open projects
Status: ✅ Done
Development

No branches or pull requests

3 participants