Skip to content

Commit

Permalink
fix: tauri_plugin_notification for non-Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
SpikeHD committed Oct 26, 2024
1 parent 7c59796 commit def11b5
Show file tree
Hide file tree
Showing 3 changed files with 173 additions and 12 deletions.
169 changes: 160 additions & 9 deletions src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ rsrpc = { git = "https://www.github.com/SpikeHD/rsRPC", tag = "v0.16.4", optiona
window_titles = { git = "https://github.com/SpikeHD/window_titles", branch = "master" }
mundy = { version = "0.1.2", features = ["accent-color", "callback"] }

[target.'cfg(not(windows))'.dependencies]
tauri-plugin-notification = "2.0"

[target."cfg(any(target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies]
webkit2gtk = { version = "2.0", features = ["v2_4"] }
wgpu = { version = "22", default-features = false }
Expand Down
13 changes: 10 additions & 3 deletions src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,17 @@ fn main() {
let client_mods = load_mods_js();

#[allow(clippy::single_match)]
tauri::Builder::default()
#[allow(unused_mut)]
let mut builder = tauri::Builder::default()
.plugin(tauri_plugin_http::init())
.plugin(tauri_plugin_shell::init())
.plugin(tauri_plugin_autostart::init(
.plugin(tauri_plugin_shell::init());

#[cfg(not(target_os = "windows"))]
{
builder = builder.plugin(tauri_plugin_notification::init());
}

builder.plugin(tauri_plugin_autostart::init(
tauri_plugin_autostart::MacosLauncher::LaunchAgent,
Some(vec!["--startup"]),
))
Expand Down

0 comments on commit def11b5

Please sign in to comment.