oknozor / freedesktop-icons

A rust freedestkop icon lookup implementation
MIT License
6 stars 14 forks source link

Lookup icon for current theme? #15

Open MatthiasGrandl opened 4 months ago

MatthiasGrandl commented 4 months ago

Any chance API for looking up icons based on the current theme could be added? I guess it's probably out of scope for this crate as getting the active theme presumably pulls in a lot of other dependencies, but it would be very handy :)

oknozor commented 4 months ago

Hey @MatthiasGrandl, there is no such thing as current theme for all linux desktop environment. Some may choose to use the GTK default like Gnome, some like KDE have there own configuration and some other DE like i3, sway, hypr don't even have the concept of a current theme.

That said if you want to, it would be ok to open a PR adding a function to lookup the current GTK theme. I would rather have this behind a feature flag.

Also I don't have the time to implement that myself, but PRs are welcome.

MatthiasGrandl commented 4 months ago

Ah yeah that's true. So it seems in onagre you just have it as theme option, instead of trying to determine whatever theme is in use by the environment?

i3, sway, hypr don't even have the concept of a current theme.

well that's not quite true. you usually have some environment configuration that tells GTK/QT apps which theme to use. So I was thinking using GTK crates one could probably figure out what theme to use, with the caveat of pulling in tons of dependencies.

Also I don't have the time to implement that myself, but PRs are welcome.

I'll look into it, although I am not on Linux myself at the moment. I am building Loungy which is mostly on MacOS, but slowly getting ported to Linux :)