A library to get the app icon from an app bundle.
This lib requires a Rust version of at least 1.64
There are three general methods of installation that we can recommend.
- Use crates.io and npm (easiest, and requires you to trust that our publishing pipeline worked)
- Pull sources directly from Github using git tags / revision hashes (most secure)
- Git submodule install this repo in your tauri project and then use file protocol to ingest the source (most secure, but inconvenient to use)
Install the Core plugin by adding the following to your Cargo.toml
file:
src-tauri/Cargo.toml
[dependencies]
app-icon = { git = "https://github.com/ahkohd/tauri-toolkit", branch = "v2" }
use app_icon::GetAppIconError;
fn main() -> Result<(), GetAppIconError> {
let app_path = Path::new("/System/Applications/Notes.app");
let save_path = Path::new("/tmp/Notes.png");
app_icon::get_icon(app_path, save_path, 32.0)?;
Ok(())
}
PRs accepted. Please make sure to read the Contributing Guide before making a pull request.
MIT or MIT/Apache 2.0 where applicable