#icons #freedesktop

freedesktop-icons

A Freedesktop Icons lookup crate

9 releases

new 0.3.0 Jan 23, 2025
0.2.6 Feb 13, 2024
0.2.5 Jan 24, 2024
0.2.4 Sep 21, 2023
0.1.1 May 17, 2022

#110 in GUI

Download history 22142/week @ 2024-10-07 21403/week @ 2024-10-14 24618/week @ 2024-10-21 19894/week @ 2024-10-28 28212/week @ 2024-11-04 28169/week @ 2024-11-11 25365/week @ 2024-11-18 12989/week @ 2024-11-25 22031/week @ 2024-12-02 19960/week @ 2024-12-09 21906/week @ 2024-12-16 4821/week @ 2024-12-23 7054/week @ 2024-12-30 23903/week @ 2025-01-06 30140/week @ 2025-01-13 20703/week @ 2025-01-20

82,149 downloads per month
Used in 4 crates

MIT license

35KB
746 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

~2–13MB
~88K SLoC