No description
Find a file
2022-05-13 11:16:09 +02:00
benches perf: refine benches and add somes test to ensure we are testing the correct inputs 2022-05-13 11:12:20 +02:00
src docs: add a readme 2022-05-13 11:16:09 +02:00
.gitignore chore: First commit 2022-05-12 10:10:48 +02:00
Cargo.toml feat: use CacheEntry enum to abort previously failed lookups 2022-05-13 10:11:02 +02:00
README.md docs: add a readme 2022-05-13 11:16:09 +02:00
rustfmt.toml chore: First commit 2022-05-12 10:10:48 +02:00

freedesktop-icons

This crate provides a freedesktop icon lookup implementation.

It exposes a single lookup function to find icon 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 requirement 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();