#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

#112 in GUI

Download history 13290/week @ 2024-02-02 22841/week @ 2024-02-09 21753/week @ 2024-02-16 28660/week @ 2024-02-23 24832/week @ 2024-03-01 26296/week @ 2024-03-08 19990/week @ 2024-03-15 30618/week @ 2024-03-22 26072/week @ 2024-03-29 13647/week @ 2024-04-05 20825/week @ 2024-04-12 23422/week @ 2024-04-19 24991/week @ 2024-04-26 23649/week @ 2024-05-03 20170/week @ 2024-05-10 21301/week @ 2024-05-17

93,789 downloads per month
Used in 2 crates

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–12MB
~93K SLoC