https://github.com/vasak-os/tauri-plugin-vicons
Plugin for tauri that allows you to get system icons with the icon name (Only for Linux {VasakOS})
https://github.com/vasak-os/tauri-plugin-vicons
linux tauri tauri-plugin typescript vasak vasakos
Last synced: 2 months ago
JSON representation
Plugin for tauri that allows you to get system icons with the icon name (Only for Linux {VasakOS})
- Host: GitHub
- URL: https://github.com/vasak-os/tauri-plugin-vicons
- Owner: Vasak-OS
- Created: 2025-04-10T18:23:42.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-10T18:47:31.000Z (about 1 year ago)
- Last Synced: 2025-04-10T19:56:54.460Z (about 1 year ago)
- Topics: linux, tauri, tauri-plugin, typescript, vasak, vasakos
- Language: Rust
- Homepage:
- Size: 12.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Tauri Plugin vicons
A simple plugin that allows you to get the operating system icons by name (only works on Linux) by getting it in base64 ready to use the src of any image
## Installation
```bash
bun add @vasakgroup/plugin-vicons
```
Add in `cargo.toml`
```toml
[dependencies]
tauri-plugin-vicons = { git = "https://github.com/Vasak-OS/tauri-plugin-vicons", branch = "v2" }
```
In `main.rs` or `lib.rs`, add the following to your `tauri::Builder`:
```rust
use tauri_plugin_vicons;
fn main() {
tauri::Builder::default()
.plugin(tauri_plugin_vicons::init()) // this line
.run(tauri::generate_context!())
.expect("error while running tauri application");
}
```
And add in `src-tauri/compatibilites/default.json`
```json
{
"permissions": [
...
"vicons:default",
]
}
```
## Usage
```ts
import { getIconSource } from '@vasakgroup/plugin-vicons';
const icon = await getIconSource('folder');
```
in vue
```vue
import { getIconSource } from '@vasakgroup/plugin-vicons';
import { ref } from 'vue';
const icon = ref('');
const getIcon = async () => {
icon.value = await getIconSource('folder');
};
getIcon();
![]()
```