MacOS MVP Requirements
This commit is contained in:
parent
6e5e38abdc
commit
84b979a80a
@ -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
|
* [ ] Auto-send `return` on paste completion for pre-determined phrases
|
||||||
* [ ] Ability to add custom types / phrases
|
* [ ] Ability to add custom types / phrases
|
||||||
* [ ] [Unicode "font" options](https://lingojam.com/DiscordFonts)
|
* [ ] [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/)
|
19
entitlements.plist
Normal file
19
entitlements.plist
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
|
||||||
|
<key>com.apple.security.app-sandbox</key><true/>
|
||||||
|
<key>com.apple.security.network.client</key><true/>
|
||||||
|
|
||||||
|
<key>com.apple.application-identifier</key>
|
||||||
|
<string>W9ASV855X5.lgbt.cray.allenwrench</string>
|
||||||
|
|
||||||
|
<key>com.apple.developer.team-identifier</key>
|
||||||
|
<string>W9ASV855X5</string>
|
||||||
|
|
||||||
|
<key>com.apple.security.files.user-selected.read-only</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
|
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "allenwrench-app",
|
"name": "allenwrench-app",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.0.0",
|
"version": "0.1.1",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
4
src-tauri/Cargo.lock
generated
4
src-tauri/Cargo.lock
generated
@ -27,8 +27,8 @@ dependencies = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "allenwrench-app"
|
name = "allenwrench"
|
||||||
version = "0.0.0"
|
version = "0.1.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"arboard",
|
"arboard",
|
||||||
"enigo",
|
"enigo",
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "allenwrench-app"
|
name = "allenwrench"
|
||||||
version = "0.0.0"
|
version = "0.1.1"
|
||||||
description = "A Tauri App"
|
description = "Hexcorp Drone Input Tool"
|
||||||
authors = ["you"]
|
authors = ["Liz Cray", "4661"]
|
||||||
license = ""
|
license = "Apache-2.0"
|
||||||
repository = ""
|
repository = "git@git.corrupt.link:liz/AllenWrench.git"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
// Prevents additional console window on Windows in release, DO NOT REMOVE!!
|
// Prevents additional console window on Windows in release, DO NOT REMOVE!!
|
||||||
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
|
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
|
||||||
|
|
||||||
|
use tauri::{Manager, Size, LogicalSize};
|
||||||
use enigo::{Enigo, Key, KeyboardControllable, MouseControllable};
|
use enigo::{Enigo, Key, KeyboardControllable, MouseControllable};
|
||||||
use std::thread;
|
use std::thread;
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
@ -73,8 +74,18 @@ fn type_str(input: String) {
|
|||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
tauri::Builder::default()
|
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())
|
.plugin(tauri_plugin_positioner::init())
|
||||||
.invoke_handler(tauri::generate_handler![type_str, get_mouse_pos])
|
.invoke_handler(tauri::generate_handler![type_str, get_mouse_pos])
|
||||||
.run(tauri::generate_context!())
|
.run(tauri::generate_context!())
|
||||||
.expect("error while running tauri application");
|
.expect("error while running tauri application");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
"withGlobalTauri": false
|
"withGlobalTauri": false
|
||||||
},
|
},
|
||||||
"package": {
|
"package": {
|
||||||
"productName": "allenwrench-app",
|
"productName": "allenwrench",
|
||||||
"version": "0.1.1"
|
"version": "0.1.1"
|
||||||
},
|
},
|
||||||
"tauri": {
|
"tauri": {
|
||||||
@ -48,7 +48,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"bundle": {
|
"bundle": {
|
||||||
|
"category": "Utility",
|
||||||
"active": true,
|
"active": true,
|
||||||
|
"copyright": "Copyright 2023 Elizabeth Cray",
|
||||||
"targets": "all",
|
"targets": "all",
|
||||||
"identifier": "lgbt.cray.allenwrench",
|
"identifier": "lgbt.cray.allenwrench",
|
||||||
"icon": [
|
"icon": [
|
||||||
@ -59,7 +61,12 @@
|
|||||||
],
|
],
|
||||||
"resources": [
|
"resources": [
|
||||||
"resources/*"
|
"resources/*"
|
||||||
]
|
],
|
||||||
|
"macOS": {
|
||||||
|
"minimumSystemVersion": "10.11",
|
||||||
|
"license": "../LICENSE.txt",
|
||||||
|
"entitlements": "../entitlements.plist"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"security": {
|
"security": {
|
||||||
"csp": null
|
"csp": null
|
||||||
@ -67,7 +74,7 @@
|
|||||||
"windows": [
|
"windows": [
|
||||||
{
|
{
|
||||||
"fullscreen": false,
|
"fullscreen": false,
|
||||||
"resizable": false,
|
"resizable": true,
|
||||||
"maximizable": false,
|
"maximizable": false,
|
||||||
"minimizable": false,
|
"minimizable": false,
|
||||||
"alwaysOnTop": true,
|
"alwaysOnTop": true,
|
||||||
|
11
src/App.tsx
11
src/App.tsx
@ -23,6 +23,7 @@ type Code = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Set window to above the mouse cursor
|
// Set window to above the mouse cursor
|
||||||
|
// TODO: Fix for MacOS
|
||||||
invoke('get_mouse_pos', {}).then((posJson: any) => {
|
invoke('get_mouse_pos', {}).then((posJson: any) => {
|
||||||
let pos = JSON.parse(posJson);
|
let pos = JSON.parse(posJson);
|
||||||
appWindow.innerSize().then((size: any) => {
|
appWindow.innerSize().then((size: any) => {
|
||||||
@ -44,11 +45,13 @@ function App() {
|
|||||||
return (storedId ? storedId : "0000");
|
return (storedId ? storedId : "0000");
|
||||||
});
|
});
|
||||||
|
|
||||||
resolveResource("resources/codes.json").then((path: string) => {
|
if (!codes){
|
||||||
readTextFile(path).then((codesJson: string) => {
|
resolveResource("resources/codes.json").then((path: string) => {
|
||||||
setCodes(JSON.parse(codesJson));
|
readTextFile(path).then((codesJson: string) => {
|
||||||
|
setCodes(JSON.parse(codesJson));
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
}
|
||||||
|
|
||||||
const getSubjects = (input: Array<Code>) => {
|
const getSubjects = (input: Array<Code>) => {
|
||||||
// TODO: Put all single-level elements at bottom
|
// TODO: Put all single-level elements at bottom
|
||||||
|
Loading…
Reference in New Issue
Block a user