#icons #freedesktop #gui

freedesktop-icons-greedy

A Freedesktop Icons lookup crate

3 releases

0.2.6 Jul 25, 2023
0.2.5 Jul 25, 2023
0.2.4 Jul 25, 2023

#25 in #freedesktop

Download history 7/week @ 2024-07-21 4/week @ 2024-07-28 1/week @ 2024-08-18 1/week @ 2024-08-25 15/week @ 2024-09-01 18/week @ 2024-09-08 19/week @ 2024-09-15 12/week @ 2024-09-22 21/week @ 2024-09-29 2/week @ 2024-10-06 3/week @ 2024-10-13 164/week @ 2024-10-20 9/week @ 2024-10-27 7/week @ 2024-11-03

183 downloads per month

MIT license

34KB
762 lines

freedesktop-icons-greedy

A fork of freedesktop-icons that resolves icons even when the theme doesn't have an index.

use freedesktop_icons_greedy::lookup;

let icon = lookup("firefox")
    .with_greed()
    .find();

lib.rs:

freedesktop-icons

This crate provides a freedesktop icon lookup implementation.

It exposes a single lookup function to find icons based on their name, theme, size and scale.

Example

Simple lookup:

The following snippet get an icon from the default 'hicolor' theme with the default scale (1) and the default size (24).

use freedesktop_icons_greedy::lookup;

let icon = lookup("firefox").find();

Complex lookup:

If you have specific requirements for your lookup you can use the provided builder functions:

use freedesktop_icons_greedy::lookup;

let icon = lookup("firefox")
    .with_size(48)
    .with_scale(2)
    .with_theme("Arc")
    .find();

Cache:

If your application is going to repeat the same icon lookups multiple times you can use the internal cache to improve performance.

use freedesktop_icons_greedy::lookup;

let icon = lookup("firefox")
    .with_size(48)
    .with_scale(2)
    .with_theme("Arc")
    .with_cache()
    .find();

Dependencies

~2–9.5MB
~90K SLoC