diff --git a/README.md b/README.md index 2e4acbd..9820a0b 100644 --- a/README.md +++ b/README.md @@ -13,3 +13,7 @@ Allen Wrench is a desktop tool to aid [Hexcorp](https://hexcorp.net) Drones in t * [ ] Auto-send `return` on paste completion for pre-determined phrases * [ ] Ability to add custom types / phrases * [ ] [Unicode "font" options](https://lingojam.com/DiscordFonts) + +### Misc notes + +[Use this as a guide for building for MacOS](https://thinkgo.io/post/2023/02/publish_tauri_to_apples_app_store/) \ No newline at end of file diff --git a/entitlements.plist b/entitlements.plist new file mode 100644 index 0000000..1d981b8 --- /dev/null +++ b/entitlements.plist @@ -0,0 +1,19 @@ + + + + + + com.apple.security.app-sandbox + com.apple.security.network.client + + com.apple.application-identifier + W9ASV855X5.lgbt.cray.allenwrench + + com.apple.developer.team-identifier + W9ASV855X5 + + com.apple.security.files.user-selected.read-only + + + + \ No newline at end of file diff --git a/package.json b/package.json index 8cd8cc2..2e9ff4c 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "allenwrench-app", "private": true, - "version": "0.0.0", + "version": "0.1.1", "type": "module", "scripts": { "dev": "vite", diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index d1390b4..40b0bbc 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -27,8 +27,8 @@ dependencies = [ ] [[package]] -name = "allenwrench-app" -version = "0.0.0" +name = "allenwrench" +version = "0.1.1" dependencies = [ "arboard", "enigo", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 3902e87..b1ccc62 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -1,10 +1,10 @@ [package] -name = "allenwrench-app" -version = "0.0.0" -description = "A Tauri App" -authors = ["you"] -license = "" -repository = "" +name = "allenwrench" +version = "0.1.1" +description = "Hexcorp Drone Input Tool" +authors = ["Liz Cray", "4661"] +license = "Apache-2.0" +repository = "git@git.corrupt.link:liz/AllenWrench.git" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index f3b7a60..53af2ce 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -1,6 +1,7 @@ // Prevents additional console window on Windows in release, DO NOT REMOVE!! #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] +use tauri::{Manager, Size, LogicalSize}; use enigo::{Enigo, Key, KeyboardControllable, MouseControllable}; use std::thread; use std::time::Duration; @@ -73,8 +74,18 @@ fn type_str(input: String) { fn main() { tauri::Builder::default() + .setup(|app| { + let main_window = app.get_window("main").unwrap(); + + #[cfg(target_os = "macos")] { + let _ = main_window.set_size(Size::Logical(LogicalSize {width: 400.0, height: 352.0})); + } + + Ok(()) + }) .plugin(tauri_plugin_positioner::init()) .invoke_handler(tauri::generate_handler![type_str, get_mouse_pos]) .run(tauri::generate_context!()) .expect("error while running tauri application"); + } diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 07bca99..cdb7d6a 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -7,7 +7,7 @@ "withGlobalTauri": false }, "package": { - "productName": "allenwrench-app", + "productName": "allenwrench", "version": "0.1.1" }, "tauri": { @@ -48,7 +48,9 @@ } }, "bundle": { + "category": "Utility", "active": true, + "copyright": "Copyright 2023 Elizabeth Cray", "targets": "all", "identifier": "lgbt.cray.allenwrench", "icon": [ @@ -59,7 +61,12 @@ ], "resources": [ "resources/*" - ] + ], + "macOS": { + "minimumSystemVersion": "10.11", + "license": "../LICENSE.txt", + "entitlements": "../entitlements.plist" + } }, "security": { "csp": null @@ -67,7 +74,7 @@ "windows": [ { "fullscreen": false, - "resizable": false, + "resizable": true, "maximizable": false, "minimizable": false, "alwaysOnTop": true, diff --git a/src/App.tsx b/src/App.tsx index 49523a6..84af724 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -23,6 +23,7 @@ type Code = { }; // Set window to above the mouse cursor +// TODO: Fix for MacOS invoke('get_mouse_pos', {}).then((posJson: any) => { let pos = JSON.parse(posJson); appWindow.innerSize().then((size: any) => { @@ -44,11 +45,13 @@ function App() { return (storedId ? storedId : "0000"); }); - resolveResource("resources/codes.json").then((path: string) => { - readTextFile(path).then((codesJson: string) => { - setCodes(JSON.parse(codesJson)); + if (!codes){ + resolveResource("resources/codes.json").then((path: string) => { + readTextFile(path).then((codesJson: string) => { + setCodes(JSON.parse(codesJson)); + }); }); - }); + } const getSubjects = (input: Array) => { // TODO: Put all single-level elements at bottom