Skip to content

The all-in-one local AI studio for your desktop: chat, image and video generation and a coding agent in one free, open source app. Windows and Linux. No Docker, no terminal, no cloud required.

feat: system tray — close minimizes to tray, right-click to quit

PurpleDoubleD34c8f8bee33b
diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock
index 2a05bb80..1e39999c 100644
--- a/src-tauri/Cargo.lock
+++ b/src-tauri/Cargo.lock
@@ -181,6 +181,12 @@ version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"
+[[package]]
+name = "byteorder-lite"
+version = "0.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495"
+
[[package]]
name = "bytes"
version = "1.11.1"
@@ -1477,7 +1483,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3e795dff5605e0f04bff85ca41b51a96b83e80b281e96231bcaaf1ac35103371"
dependencies = [
"byteorder",
- "png",
+ "png 0.17.16",
]
[[package]]
@@ -1594,6 +1600,19 @@ dependencies = [
"icu_properties",
]
+[[package]]
+name = "image"
+version = "0.25.10"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "85ab80394333c02fe689eaf900ab500fbd0c2213da414687ebf995a65d5a6104"
+dependencies = [
+ "bytemuck",
+ "byteorder-lite",
+ "moxcms",
+ "num-traits",
+ "png 0.18.1",
+]
+
[[package]]
name = "indexmap"
version = "1.9.3"
@@ -1983,6 +2002,16 @@ dependencies = [
"windows-sys 0.61.2",
]
+[[package]]
+name = "moxcms"
+version = "0.8.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bb85c154ba489f01b25c0d36ae69a87e4a1c73a72631fc6c0eb6dde34a73e44b"
+dependencies = [
+ "num-traits",
+ "pxfm",
+]
+
[[package]]
name = "muda"
version = "0.17.1"
@@ -1998,7 +2027,7 @@ dependencies = [
"objc2-core-foundation",
"objc2-foundation",
"once_cell",
- "png",
+ "png 0.17.16",
"serde",
"thiserror 2.0.18",
"windows-sys 0.60.2",
@@ -2592,6 +2621,19 @@ dependencies = [
"miniz_oxide",
]
+[[package]]
+name = "png"
+version = "0.18.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "60769b8b31b2a9f263dae2776c37b1b28ae246943cf719eb6946a1db05128a61"
+dependencies = [
+ "bitflags 2.11.0",
+ "crc32fast",
+ "fdeflate",
+ "flate2",
+ "miniz_oxide",
+]
+
[[package]]
name = "potential_utf"
version = "0.1.4"
@@ -2700,6 +2742,12 @@ dependencies = [
"unicode-ident",
]
+[[package]]
+name = "pxfm"
+version = "0.1.28"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b5a041e753da8b807c9255f28de81879c78c876392ff2469cde94799b2896b9d"
+
[[package]]
name = "quick-xml"
version = "0.38.4"
@@ -3748,6 +3796,7 @@ dependencies = [
"gtk",
"heck 0.5.0",
"http",
+ "image",
"jni",
"libc",
"log",
@@ -3815,7 +3864,7 @@ dependencies = [
"ico",
"json-patch",
"plist",
- "png",
+ "png 0.17.16",
"proc-macro2",
"quote",
"semver",
@@ -4344,7 +4393,7 @@ dependencies = [
"objc2-core-graphics",
"objc2-foundation",
"once_cell",
- "png",
+ "png 0.17.16",
"serde",
"thiserror 2.0.18",
"windows-sys 0.60.2",
diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml
index bd9e8844..0f22e14c 100644
--- a/src-tauri/Cargo.toml
+++ b/src-tauri/Cargo.toml
@@ -9,7 +9,7 @@ edition = "2021"
tauri-build = { version = "2", features = [] }
[dependencies]
-tauri = { version = "2", features = ["devtools"] }
+tauri = { version = "2", features = ["devtools", "tray-icon", "image-png"] }
tauri-plugin-shell = "2"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs
index da02dc6b..8779331f 100644
--- a/src-tauri/src/main.rs
+++ b/src-tauri/src/main.rs
@@ -6,7 +6,12 @@ mod python;
mod state;
use state::AppState;
-use tauri::Manager;
+use tauri::{
+ Manager,
+ menu::{Menu, MenuItem},
+ tray::TrayIconBuilder,
+ image::Image,
+};
fn main() {
let app_state = AppState::new();
@@ -58,15 +63,61 @@ fn main() {
window.open_devtools();
}
+ // ─── System Tray ───
+ let show = MenuItem::with_id(app, "show", "Show", true, None::<&str>)?;
+ let quit = MenuItem::with_id(app, "quit", "Quit", true, None::<&str>)?;
+ let menu = Menu::with_items(app, &[&show, &quit])?;
+
+ let tray_icon = Image::from_path("icons/icon.png")
+ .or_else(|_| Image::from_path("icons/32x32.png"))
+ .unwrap_or_else(|_| Image::from_bytes(include_bytes!("../icons/32x32.png")).expect("embedded icon"));
+
+ TrayIconBuilder::new()
+ .icon(tray_icon)
+ .tooltip("Locally Uncensored")
+ .menu(&menu)
+ .on_menu_event(|app, event| {
+ match event.id().as_ref() {
+ "show" => {
+ if let Some(window) = app.get_webview_window("main") {
+ let _ = window.show();
+ let _ = window.set_focus();
+ }
+ }
+ "quit" => {
+ app.exit(0);
+ }
+ _ => {}
+ }
+ })
+ .on_tray_icon_event(|tray, event| {
+ if let tauri::tray::TrayIconEvent::DoubleClick { .. } = event {
+ let app = tray.app_handle();
+ if let Some(window) = app.get_webview_window("main") {
+ let _ = window.show();
+ let _ = window.set_focus();
+ }
+ }
+ })
+ .build(app)?;
+
+ // ─── Close → hide to tray instead of quit ───
+ if let Some(window) = app.get_webview_window("main") {
+ let w = window.clone();
+ window.on_window_event(move |event| {
+ if let tauri::WindowEvent::CloseRequested { api, .. } = event {
+ api.prevent_close();
+ let _ = w.hide();
+ }
+ });
+ }
+
+ // ─── Auto-start services ───
let state = app.state::<AppState>();
- // Auto-start Ollama
commands::process::auto_start_ollama(&state);
-
- // Auto-start ComfyUI
commands::process::auto_start_comfyui(&state);
- // Start Whisper server in background thread (model loading can take minutes)
let handle = app.handle().clone();
let python_bin = state.python_bin.clone();
let whisper = state.whisper.clone();