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

Switch to PyXDG.IconTheme for icons lookup #24

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

pinotree
Copy link
Contributor

@pinotree pinotree commented Jun 6, 2021

Use PyXDG.IconTheme to lookup the application icons instead of pyGTK; this has some advantages:

  • we are already using PyXDG, so it does not add new requirements
  • the icon lookup follows the icon theme specs a little bit closer
  • the icon lookup does not require an X/graphical session
  • there is no implicit adwaita or gnome icon theme used in lookup

there are also few disadvantages:

  • there is no concept of "default icon theme", so hicolor is the default theme; a new --icon-theme option is added to select which theme to use
  • it seems the lookup logic for hicolor returns the smallest icon available in case the current size is not available: for example a 16px PNG is returned instead of a 48px for a requested and not found 64px size

pinotree added 3 commits June 6, 2021 13:11
Use PyXDG.IconTheme to lookup the application icons instead of pyGTK;
this has some advantages:
- we are already using PyXDG, so it does not add new requirements
- the icon lookup follows the icon theme specs a little bit closer
- the icon lookup does not require an X/graphical session
- there is no implicit 'adwaita' or 'gnome' icon theme used in lookup
there are also few disadvantages:
- there is no concept of "default icon theme", so "hicolor" is hardcoded
  for now; note that, when using pyGTK, the "default icon theme" was the
  GTK one, not any other configured in other ways
- it seems the lookup logic for hicolor returns the smallest icon
  available in case the current size is not available: for example a
  16px PNG is returned instead of a 48px for a requested and not found
  64px size
Add a --icon-theme command line option to specify in XDG icon theme
search for icons; defaults to 'hicolor'.
It is no more used, so drop any leftovers of it.
@gapan
Copy link
Owner

gapan commented Jun 6, 2021

I'm sorry, but detecting the icon theme is very important functionality that should not be removed. Having to specify the icon theme is too cumbersome, I don't want to do that.

@pinotree
Copy link
Contributor Author

pinotree commented Jun 6, 2021

The problem I see is that the "current icon theme" in reality is the GTK icon theme, which follows the GTK configuration. There is nothing that says it is the same for non-GTK applications.

@gapan
Copy link
Owner

gapan commented Jun 6, 2021

That's not a problem in my opinion. In my experience at least, most people that use a WM such as the ones supported by xdgmenumaker, mostly use GTK apps.

@donmor
Copy link

donmor commented Sep 5, 2022

Fetching current icon theme is not so hard to achieve: gsettings get org.gnome.desktop.interface icon-theme
There may be better ways to fetch it. Using the fetched icon theme as a default should be a solution.

@donmor
Copy link

donmor commented Sep 5, 2022

BTW, is it possible to add the --icon-theme option using pyGTK? Also, there could be multiple icon themes specified, to make up a chain of fallbacks.

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.

3 participants