#icons #freedesktop

freedesktop-icons

A Freedesktop Icons lookup crate

8 releases

0.2.6 Feb 13, 2024
0.2.5 Jan 24, 2024
0.2.4 Sep 21, 2023
0.2.3 Jan 11, 2023
0.1.1 May 17, 2022

#120 in GUI

Download history 2799/week @ 2023-12-23 11820/week @ 2023-12-30 13431/week @ 2024-01-06 15905/week @ 2024-01-13 16747/week @ 2024-01-20 21247/week @ 2024-01-27 13025/week @ 2024-02-03 23162/week @ 2024-02-10 21883/week @ 2024-02-17 29189/week @ 2024-02-24 25642/week @ 2024-03-02 21074/week @ 2024-03-09 26569/week @ 2024-03-16 25524/week @ 2024-03-23 29752/week @ 2024-03-30 7908/week @ 2024-04-06

90,411 downloads per month
Used in jolly

MIT license

33KB
727 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–11MB
~95K SLoC