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

Include icon paths in browser information #20

Open
roniemartinez opened this issue Jun 4, 2022 · 2 comments
Open

Include icon paths in browser information #20

roniemartinez opened this issue Jun 4, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@roniemartinez
Copy link
Owner

No description provided.

@roniemartinez roniemartinez added the enhancement New feature or request label Jun 4, 2022
@matibarriento
Copy link

On linux, this can be achieved by calling getIcon to the DesktopEntry

entry = DesktopEntry(path)
icon = entry.getIcon()

Also, Browser TypedDict should have an optional attribute to have compatibility with other platforms

class Browser(TypedDict):
    browser_type: str
    path: str
    display_name: str
    version: str
    icon: Optional[str]

My output

[   
    {
        'browser_type': 'chrome',
        'display_name': 'Google Chrome',
        'icon': 'google-chrome',
        'path': '/usr/bin/google-chrome-stable',
        'version': '111.0.5563.110'
    },
    {  
        'browser_type': 'chromium',
        'display_name': 'Chromium Web Browser',
        'icon': '/snap/chromium/2406/chromium.png',
        'path': 'env '
        'BAMF_DESKTOP_FILE_HINT=/var/lib/snapd/desktop/applications/chromium_chromium.desktop '
        '/snap/bin/chromium',
        'version': '111.0.5563.110'
    },
    {   
        'browser_type': 'firefox',
        'display_name': 'Firefox Web Browser',
        'icon': '/snap/firefox/2487/default256.png',
        'path': 'env '
        'BAMF_DESKTOP_FILE_HINT=/var/lib/snapd/desktop/applications/firefox_firefox.desktop '
        '/snap/bin/firefox',
        'version': '111.0.1'
    },
    {  
        'browser_type': 'opera',
        'display_name': 'Opera',
        'icon': '/snap/opera/225/usr/share/icons/hicolor/256x256/apps/opera.png',
        'path': 'env '
        'BAMF_DESKTOP_FILE_HINT=/var/lib/snapd/desktop/applications/opera_opera.desktop '
        '/snap/bin/opera',
        'version': '97.0.4719.28'
    },
    {   
        'browser_type': 'brave',
        'display_name': 'Brave Web Browser',
        'icon': 'brave-browser',
        'path': '/usr/bin/brave-browser-stable',
        'version': '97.1.34.81'
    }
]

Happy to send the PR.

@roniemartinez
Copy link
Owner Author

@matibarriento Thank you for looking into it. I am happy to accept PRs. Adding the tests would be awesome too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants