rust-xdg
rust-xdg copied to clipboard
Feature Request: Icon Themes
I'm currently running into an issue in a personal project of mine where I want to load icons based on the user-selected theme, but there don't seem to be any good rust crates for doing this. Could this crate accommodate this use-case, given that it's an XDG standard (https://specifications.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html)?
I don't expect this library to load the images itself. I'm more interested in locating icon file paths by name, and potentially implementing the caching rules discussed in the standard.
I didn't notice anything in the above link specifying exactly where the name of the icon theme is stored, so that might be a barrier to implementation, but seemingly neither GTK or Qt have a problem with this.
This is in scope for the xdg crate, and I encourage you to contribute the code to do that.
So I'm definitely willing to work on this. After looking into it further, implementing this is going to require the ability to parse desktop entry files (https://specifications.freedesktop.org/desktop-entry-spec/latest/). I did find the ini
crate out there, but I think the desktop entry specification has enough special stuff in there to justify rolling a specialized parser.
It's actually a semi-interesting problem. The .theme
icon theme files, along with the other iterations of desktop entry files, all seem to follow the same format, but have different schemas. It'd be nice to have a single parser that can then be applied to all the different use-cases.
I agree that a specialized parser makes sense here.
How about a feature flag for xdg icon-theme
that will use a separate module to parse the theme files. The theme path should be in the default crate.