#icons #freedesktop

freedesktop-icons

A Freedesktop Icons lookup crate

6 releases

new 0.2.4 Sep 21, 2023
0.2.3 Jan 11, 2023
0.2.2 Dec 18, 2022
0.2.1 May 24, 2022
0.1.1 May 17, 2022

#100 in GUI

Download history 16130/week @ 2023-06-05 12825/week @ 2023-06-12 13461/week @ 2023-06-19 13498/week @ 2023-06-26 8416/week @ 2023-07-03 14993/week @ 2023-07-10 8675/week @ 2023-07-17 12810/week @ 2023-07-24 11056/week @ 2023-07-31 10904/week @ 2023-08-07 12883/week @ 2023-08-14 14330/week @ 2023-08-21 12520/week @ 2023-08-28 10680/week @ 2023-09-04 14307/week @ 2023-09-11 17526/week @ 2023-09-18

55,296 downloads per month
Used in jolly

MIT license

32KB
702 lines

freedesktop-icons

crates.io-badge docrs-badge

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::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::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::lookup;

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

Dependencies

~1.4–2.2MB
~42K SLoC