diff --git a/package.json b/package.json index 8254015..3a4b3cb 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "@fontsource/roboto": "5.2.6", "@tauri-apps/api": "2.6.0", "@tauri-apps/plugin-opener": "2.4.0", + "@tauri-apps/plugin-os": "2.3.0", "react": "19.1.0", "react-dom": "19.1.0" }, diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index d086da7..f9dfa61 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -266,6 +266,7 @@ dependencies = [ "tauri", "tauri-build", "tauri-plugin-opener", + "tauri-plugin-os", ] [[package]] @@ -1213,6 +1214,16 @@ dependencies = [ "version_check", ] +[[package]] +name = "gethostname" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc257fdb4038301ce4b9cd1b3b51704509692bb3ff716a410cbd07925d9dae55" +dependencies = [ + "rustix", + "windows-targets 0.52.6", +] + [[package]] name = "getrandom" version = "0.1.16" @@ -2395,6 +2406,18 @@ dependencies = [ "pin-project-lite", ] +[[package]] +name = "os_info" +version = "3.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0e1ac5fde8d43c34139135df8ea9ee9465394b2d8d20f032d38998f64afffc3" +dependencies = [ + "log", + "plist", + "serde", + "windows-sys 0.52.0", +] + [[package]] name = "pango" version = "0.18.3" @@ -3479,6 +3502,15 @@ dependencies = [ "syn 2.0.104", ] +[[package]] +name = "sys-locale" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eab9a99a024a169fe8a903cf9d4a3b3601109bcc13bd9e3c6fff259138626c4" +dependencies = [ + "libc", +] + [[package]] name = "system-deps" version = "6.2.2" @@ -3700,6 +3732,24 @@ dependencies = [ "zbus", ] +[[package]] +name = "tauri-plugin-os" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05bccb4c6de4299beec5a9b070878a01bce9e2c945aa7a75bcea38bcba4c675d" +dependencies = [ + "gethostname", + "log", + "os_info", + "serde", + "serde_json", + "serialize-to-javascript", + "sys-locale", + "tauri", + "tauri-plugin", + "thiserror 2.0.12", +] + [[package]] name = "tauri-runtime" version = "2.7.0" diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index e95dccc..82a8de5 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -16,4 +16,5 @@ tauri = { version = "2.6.2", features = [] } tauri-plugin-opener = "2.4.0" serde = { version = "1.0.219", features = ["derive"] } serde_json = "1.0.140" +tauri-plugin-os = "2.3.0" diff --git a/src-tauri/capabilities/default.json b/src-tauri/capabilities/default.json index 057d8d2..2e5338d 100644 --- a/src-tauri/capabilities/default.json +++ b/src-tauri/capabilities/default.json @@ -7,6 +7,7 @@ ], "permissions": [ "core:default", - "opener:default" + "opener:default", + "os:default" ] } \ No newline at end of file diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index a74da47..fbbbab4 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -1,6 +1,7 @@ #[cfg_attr(mobile, tauri::mobile_entry_point)] pub fn run() { tauri::Builder::default() + .plugin(tauri_plugin_os::init()) .plugin(tauri_plugin_opener::init()) .invoke_handler(tauri::generate_handler![]) .run(tauri::generate_context!()) diff --git a/src-tauri/tauri.macos.conf.json b/src-tauri/tauri.macos.conf.json new file mode 100644 index 0000000..3e59878 --- /dev/null +++ b/src-tauri/tauri.macos.conf.json @@ -0,0 +1,40 @@ +{ + "$schema": "https://schema.tauri.app/config/2", + "productName": "Berry Dash Manager", + "version": "1.0.0", + "identifier": "xyz.lncvrt.berrydash-manager", + "build": { + "beforeDevCommand": "yarn dev", + "devUrl": "http://localhost:1420", + "beforeBuildCommand": "yarn build", + "frontendDist": "../dist" + }, + "app": { + "macOSPrivateApi": true, + "windows": [ + { + "title": "Berry Dash Manager", + "width": 1000, + "height": 600, + "resizable": false, + "maximizable": false, + "titleBarStyle": "Overlay", + "hiddenTitle": true + } + ], + "security": { + "csp": null + } + }, + "bundle": { + "active": true, + "targets": "all", + "icon": [ + "icons/32x32.png", + "icons/128x128.png", + "icons/128x128@2x.png", + "icons/icon.icns", + "icons/icon.ico" + ] + } +} diff --git a/yarn.lock b/yarn.lock index d38a5cd..575833b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -795,6 +795,13 @@ dependencies: "@tauri-apps/api" "^2.6.0" +"@tauri-apps/plugin-os@2.3.0": + version "2.3.0" + resolved "https://registry.yarnpkg.com/@tauri-apps/plugin-os/-/plugin-os-2.3.0.tgz#6e0648e3e1c2a352a49dcf2f38543cb04c14a410" + integrity sha512-dm3bDsMuUngpIQdJ1jaMkMfyQpHyDcaTIKTFaAMHoKeUd+Is3UHO2uzhElr6ZZkfytIIyQtSVnCWdW2Kc58f3g== + dependencies: + "@tauri-apps/api" "^2.6.0" + "@tybys/wasm-util@^0.10.0": version "0.10.0" resolved "https://registry.yarnpkg.com/@tybys/wasm-util/-/wasm-util-0.10.0.tgz#2fd3cd754b94b378734ce17058d0507c45c88369"