Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: release 0.0.2 (#7) #8

Merged
merged 1 commit into from
Mar 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 6 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,7 @@

## Installation

[Here](https://github.com/golota60/idasen-tray-controller/releases/) you can find all the releases and associated files you should download. Here's a quick explanation which version is for what system:

- `windows-x64.zip` - contains `.exe` and `.msi` files - compiled for windows 64-bit system.
- `linux-x64.zip` - contains `.deb` and `.AppImage - compiled for linux 64-bit system.
- `aarch64-apple-darwin.zip` - contains `.dmg`, `.app` and `.sh`(for debugging) - compiled for apple silicon.
- `x86_64-apple-darwin.zip` - contains `.dmg`, `.app` and `.sh`(for debugging) - compiled for apple with intel-based processors.
- `universal-apple-darwin.zip` - contains `.dmg`, `.app` and `.sh`(for debugging) - compiled for any macOS system. Around 2x bigger than a dedicated build.
[Here](https://github.com/golota60/idasen-tray-controller/releases/) you can find all the releases and associated files you should download.

## Usage

Expand Down Expand Up @@ -102,12 +96,13 @@ Roadmap(w/o order):
- [x] Better desk moving behavior(currently it moves weirdly, due to usage of external lib)
- [x] More information inside README + potential problems
- [ ] Better tests
- [ ] Run on system startup
- [x] Run on system startup
- [x] Display a setup screen instead of automatic connection for better UX
- [x] Allow for config reset from inside the app
- [ ] Add options(TBD which ones)
- [ ] Automatic update prompts(?)
- [ ] Automatic deploys & changelog on CI
- [ ] Add options(low/high perf mode, system startup toggle)
- [ ] ~Automatic update prompts(?)~ who would want their desk manager app to connect to the internet
- [x] Automatic deploys
- [ ] low/high perf mode

Known issues:

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "idasen-tray-controller",
"private": true,
"version": "0.0.1",
"version": "0.0.2",
"type": "module",
"license": "MIT",
"scripts": {
Expand All @@ -18,6 +18,7 @@
"clsx": "^1.2.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"tauri-plugin-autostart-api": "https://github.com/tauri-apps/tauri-plugin-autostart",
"use-simple-async": "^1.4.0"
},
"devDependencies": {
Expand Down
56 changes: 55 additions & 1 deletion src-tauri/Cargo.lock

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

3 changes: 2 additions & 1 deletion src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "idasen-tray-controller"
version = "0.0.0"
version = "0.0.2"
description = "An app to control IKEA Idasen desk"
authors = ["you"]
license = "MIT"
Expand All @@ -25,6 +25,7 @@ indicatif = "0.16.2"
thiserror = "1.0.30"
tokio-stream = "0.1.8"
uuid = "1.3.0"
tauri-plugin-autostart = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "dev" }

[features]
# by default Tauri runs in production mode
Expand Down
2 changes: 2 additions & 0 deletions src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
windows_subsystem = "windows"
)]

use tauri_plugin_autostart::MacosLauncher;
use std::sync::Mutex;

use btleplug::platform::Peripheral as PlatformPeripheral;
Expand Down Expand Up @@ -128,6 +129,7 @@ fn main() {
let tray = SystemTray::new().with_menu(tray);

tauri::Builder::default()
.plugin(tauri_plugin_autostart::init(MacosLauncher::LaunchAgent, None))
.system_tray(tray)
.manage(SharedDesk(None.into()))
.setup(move |app| {
Expand Down
35 changes: 34 additions & 1 deletion src/AboutPage.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
import clsx from "clsx";
import { useState } from "react";
import { useEffect, useState } from "react";
import { relaunch } from "@tauri-apps/api/process";
import useSimpleAsync from "use-simple-async";
import { enable, isEnabled, disable } from "tauri-plugin-autostart-api";
import Button from "./generic/Button";
import { removeConfig } from "./rustUtils";

const AboutPage = () => {
const [prompt] = useState<string | undefined>();
const [isAutostartEnabled, setAutostartEnabled] = useState<
boolean | undefined
>();

const [upstreamAutostart] = useSimpleAsync(isEnabled);

useEffect(() => {
if (isAutostartEnabled === undefined) {
setAutostartEnabled(upstreamAutostart);
}
}, [isAutostartEnabled, upstreamAutostart]);

return (
<>
<div className="flex-col flex justify-center items-center">
Expand All @@ -22,6 +36,25 @@ const AboutPage = () => {
>
Reset config & restart the app
</Button>
<div className="flex items-center mt-3">
<input
className="w-5 h-5 mr-2 ring-black checked:bg-blue-500"
type="checkbox"
name="autostart-toggle"
checked={isAutostartEnabled || false}
value={isAutostartEnabled as any}
onChange={() => {
if (isAutostartEnabled) {
disable();
setAutostartEnabled(false);
} else {
enable();
setAutostartEnabled(true);
}
}}
/>
<label htmlFor="autostart-toggle">Open on system startup</label>
</div>
<p className={clsx("h-12 my-2", prompt ? "visible" : "invisible")}>
{prompt}
</p>
Expand Down
6 changes: 6 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2647,6 +2647,12 @@ tailwindcss@^3.2.4:
quick-lru "^5.1.1"
resolve "^1.22.1"

"tauri-plugin-autostart-api@https://github.com/tauri-apps/tauri-plugin-autostart":
version "0.0.0"
resolved "https://github.com/tauri-apps/tauri-plugin-autostart#0c8e3ad92e00e7b0aed60fc8a639e77407105253"
dependencies:
"@tauri-apps/api" "^1.2.0"

text-table@^0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4"
Expand Down