#icons #freedesktop #lookup

freedesktop-icons

A Freedesktop Icons lookup crate

10 releases

0.3.1 Feb 8, 2025
0.2.6 Feb 13, 2024
0.2.4 Sep 21, 2023
0.2.3 Jan 11, 2023
0.2.1 May 24, 2022

#84 in GUI

Download history 12628/week @ 2024-12-19 4572/week @ 2024-12-26 17886/week @ 2025-01-02 29066/week @ 2025-01-09 23386/week @ 2025-01-16 25867/week @ 2025-01-23 29018/week @ 2025-01-30 31415/week @ 2025-02-06 23234/week @ 2025-02-13 30962/week @ 2025-02-20 30285/week @ 2025-02-27 24061/week @ 2025-03-06 30234/week @ 2025-03-13 31936/week @ 2025-03-20 30352/week @ 2025-03-27 20154/week @ 2025-04-03

118,661 downloads per month
Used in 7 crates

MIT license

37KB
802 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

~0.7–12MB
~69K SLoC