#icons #freedesktop

freedesktop-icons

A Freedesktop Icons lookup crate

10 releases

new 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 24800/week @ 2024-10-23 21729/week @ 2024-10-30 27216/week @ 2024-11-06 29714/week @ 2024-11-13 20225/week @ 2024-11-20 14685/week @ 2024-11-27 22440/week @ 2024-12-04 17573/week @ 2024-12-11 18056/week @ 2024-12-18 4573/week @ 2024-12-25 13791/week @ 2025-01-01 26653/week @ 2025-01-08 25757/week @ 2025-01-15 24746/week @ 2025-01-22 28837/week @ 2025-01-29 23693/week @ 2025-02-05

109,373 downloads per month
Used in 4 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–11MB
~69K SLoC