#icons #freedesktop

freedesktop-icons

A Freedesktop Icons lookup crate

11 unstable releases (3 breaking)

0.4.0 Apr 16, 2025
0.3.1 Feb 8, 2025
0.3.0 Jan 23, 2025
0.2.6 Feb 13, 2024
0.2.1 May 24, 2022

#81 in GUI

Download history 5473/week @ 2025-12-23 8196/week @ 2025-12-30 37956/week @ 2026-01-06 42490/week @ 2026-01-13 47567/week @ 2026-01-20 41426/week @ 2026-01-27 51101/week @ 2026-02-03 37114/week @ 2026-02-10 38279/week @ 2026-02-17 41156/week @ 2026-02-24 28399/week @ 2026-03-03 37457/week @ 2026-03-10 43354/week @ 2026-03-17 47054/week @ 2026-03-24 30365/week @ 2026-03-31 33545/week @ 2026-04-07

160,971 downloads per month
Used in 21 crates (14 directly)

MIT license

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

~5–17MB
~112K SLoC