{"id":15722093,"url":"https://github.com/relm4/icons","last_synced_at":"2025-04-15T06:01:23.430Z","repository":{"id":142983224,"uuid":"614569138","full_name":"Relm4/icons","owner":"Relm4","description":"Icons for your Relm4 application","archived":false,"fork":false,"pushed_at":"2025-04-06T14:52:52.000Z","size":3789,"stargazers_count":16,"open_issues_count":9,"forks_count":7,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-09T09:12:02.057Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Relm4.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-03-15T21:24:01.000Z","updated_at":"2025-04-06T14:52:59.000Z","dependencies_parsed_at":"2024-03-13T20:55:39.473Z","dependency_job_id":"39ac2605-d6bc-4c33-b5db-76935bd7258a","html_url":"https://github.com/Relm4/icons","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Relm4%2Ficons","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Relm4%2Ficons/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Relm4%2Ficons/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Relm4%2Ficons/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Relm4","download_url":"https://codeload.github.com/Relm4/icons/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249016625,"owners_count":21198832,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T22:03:53.259Z","updated_at":"2025-04-15T06:01:23.342Z","avatar_url":"https://github.com/Relm4.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Relm4 icons - Icons for your gtk-rs and Relm4 applications!\n\n[![CI](https://github.com/Relm4/icons/actions/workflows/rust.yml/badge.svg)](https://github.com/Relm4/icons/actions/workflows/rust.yml)\n[![Matrix](https://img.shields.io/matrix/relm4:matrix.org?label=matrix%20chat)](https://matrix.to/#/#relm4:matrix.org)\n[![Relm4 icons on crates.io](https://img.shields.io/crates/v/relm4-icons.svg)](https://crates.io/crates/relm4-icons)\n[![Relm4 icons docs](https://img.shields.io/badge/rust-documentation-blue)](https://docs.rs/relm4_icons/)\n![Minimum Rust version 1.75](https://img.shields.io/badge/rustc-1.65+-06a096.svg)\n[![dependency status](https://deps.rs/repo/github/Relm4/icons/status.svg)](https://deps.rs/repo/github/Relm4/icons)\n\nMore than 3000 icons, ready for use in your app!\n\n## Installing librsvg\n\nThe `relm4-icons` crate relies on `librsvg` for rendering SVG icons. Ensure that `librsvg` is installed on your system before using this crate. The installation process varies depending on your operating system.\n\n```bash\n# Linux (Debian/Ubuntu)\nsudo apt update\nsudo apt install librsvg2-dev\n\n# Macos\nbrew install librsvg\n\n# Windows\ngvsbuild build librsvg\n```\n\n## Usage\n\n### 1. Find your icons 🔍\n\nYou can either use the of the over 3000 shipped icons or your own icons.\nYou can browse the shipped icons using one of the following methods:\n\nFor icons from the GNOME [icon-development-kit](https://gitlab.gnome.org/Teams/Design/icon-development-kit):\n+ Install [Icon library](https://flathub.org/apps/details/org.gnome.design.IconLibrary)\n+ Browse the [GNOME icon resource](https://teams.pages.gitlab.gnome.org/Design/icon-development-kit-www/)\n\nFor icons from [Fluent UI System Icons](https://github.com/microsoft/fluentui-system-icons):\n+ Browse the [fluent icon library catalog](https://aka.ms/fluentui-system-icons)\n\nFor browsing all shipped icons:\n+ Use the icon previews provided by in this repo: [16x16](icons16.md), [32x32](icons32.md) and [64x64](icons64.md)\n\n\u003e Sometimes, icons-development-kit and Fluent UI System Icons have overlapping icon names, so the postfix \"-alt\" is added.\n\n### 2. Add Relm4 icons ✍\n\n```toml\nrelm4-icons = \"0.10.0-beta.1\"\n\n[build-dependencies]\nrelm4-icons-build = \"0.10.0-beta.1\"\n```\n\n### 3. Add the icons to your project 📦\n\nAdd the following to your `build.rs`:\n\n```rust\nfn main() {\n    relm4_icons_build::bundle_icons(\n        // Name of the file that will be generated at `OUT_DIR`\n        \"icon_names.rs\",\n        // Optional app ID\n        Some(\"com.example.myapp\"),\n        // Custom base resource path:\n        // * defaults to `/com/example/myapp` in this case if not specified explicitly\n        // * or `/org/relm4` if app ID was not specified either\n        None::\u003c\u0026str\u003e,\n        // Directory with custom icons (if any)\n        None::\u003c\u0026str\u003e,\n        // List of icons to include\n        [\n            \"ssd\",\n            \"size-horizontally\",\n            \"cross\",\n        ],\n    );\n}\n```\n\n### 4. Load the icons 🛫\n\nAdd this to your initialization code:\n\n```rust\nmod icon_names {\n    include!(concat!(env!(\"OUT_DIR\"), \"/icon_names.rs\"));\n}\n\nfn main() {\n    ///...///\n    relm4_icons::initialize_icons(icon_names::GRESOURCE_BYTES, icon_names::RESOURCE_PREFIX);\n}\n```\n\n### 5. Use the icons 🎉\n\nUse `set_icon_name` and similar methods to use your icons, for example with\n[`ButtonExt`](https://gtk-rs.org/gtk4-rs/git/docs/gtk4/prelude/trait.ButtonExt.html#tymethod.set_icon_name),\n[`StackPage`](https://gtk-rs.org/gtk4-rs/git/docs/gtk4/struct.StackPage.html#method.set_icon_name),\n[`MenuButton`](https://gtk-rs.org/gtk4-rs/git/docs/gtk4/struct.MenuButton.html#method.set_icon_name) or\n[`Image`](https://gtk-rs.org/gtk4-rs/git/docs/gtk4/struct.Image.html#method.set_icon_name).\n\n#### Example\n\n```rust\nlet button = gtk::Button::default();\nbutton.set_icon_name(\"plus\");\n```\n\nYou can also use the `icon_names` module for extra compile-time generated icon names.\n\n```rust\nuse crate::icon_names;\n\nlet button = gtk::Button::default();\nbutton.set_icon_name(icon_names::PLUS);\n```\n\n## How it works\n\n### Crate\n\n1. Collect all icons specified in the config file\n2. Build a gresource bundle containing *only the selected icons*\n3. Include the gresource file in the compiled binary\n4. On initialization load the gresource file\n\n### Add new icons\n\nTo add new icons, move them into the `icons` folder and make sure their file name ends with `-symbolic.svg`.\nThen run the following commands:\n\n```sh\ncd update_icons\ncargo run\n```\n\nExisting icon sets can be updated as submodules with following commands:\n```sh\ngit submodule update --remote --checkout\nrm -rf build_icons/icons/fluentui-system-icons\nrm -rf build_icons/icons/icon-development-kit\ncd update_icons\ncargo run --bin fetch_icons\ncargo run\n```\n\n## Credit\n\n+ GNOME contributors for providing so many outstanding icons\n+ [gvdb-rs](https://github.com/felinira/gvdb-rs) for providing a great crate for interacting with gresources in pure Rust\n+ [gtk-rs](https://gtk-rs.org) for outstanding Rust bindings for GTK4\n\n## Legal\n\nThe source code of Relm4 icons is licensed under the terms of both the MIT license and the Apache License (Version 2.0).\n\n### Icons\n\n+ The icons in the `icons/icon-development-kit` folder are licensed under the terms of the [CC0 license](https://creativecommons.org/share-your-work/public-domain/cc0/) and therefore public domain.\n+ The icons in the `icons/fluentui-system-icons` folder are licensed under the terms of the [MIT license](https://opensource.org/license/MIT/).\n\nBoth licenses should work for both open source and proprietary applications (without warranty).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frelm4%2Ficons","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frelm4%2Ficons","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frelm4%2Ficons/lists"}