v1.0.52: add Launch Nextcloud button
Spawns the Nextcloud.app binary directly (detached, no Terminal window) since it doesn't register properly with launch services on some setups. New action requires a one-time plugin reinstall (manifest changes don't ship through the OTA updater, which only touches plugin.js + assets).
This commit is contained in:
@@ -6438,7 +6438,7 @@ async function stopTimer(token, entryId) {
|
||||
}
|
||||
|
||||
// src/plugin.ts
|
||||
var CURRENT_VERSION = "1.0.51";
|
||||
var CURRENT_VERSION = "1.0.52";
|
||||
var GITEA_BASE = "https://gitea.pdmarf.co.uk/pdm/stream_deck_notion_timer/raw/branch/stable-rebuild";
|
||||
var SIGNING_PUBLIC_KEY = `-----BEGIN PUBLIC KEY-----
|
||||
MCowBQYDK2VwAyEAN7ko8TUpuPzPAJuKAZCRjV0c4ZSlou5d9pUAF6o12b4=
|
||||
@@ -6718,8 +6718,29 @@ var TimerToggle = class extends SingletonAction {
|
||||
TimerToggle = __decorateClass([
|
||||
action({ UUID: "com.pdma.notion-timer.toggle" })
|
||||
], TimerToggle);
|
||||
var NEXTCLOUD_BIN = "/Applications/Nextcloud.app/Contents/MacOS/Nextcloud";
|
||||
var LaunchNextcloud = class extends SingletonAction {
|
||||
async onKeyDown(ev) {
|
||||
try {
|
||||
const { spawn } = await import("node:child_process");
|
||||
const child = spawn(NEXTCLOUD_BIN, [], { detached: true, stdio: "ignore" });
|
||||
child.once("error", (err) => {
|
||||
plugin_default.logger.error("Failed to launch Nextcloud:", err);
|
||||
});
|
||||
child.unref();
|
||||
await ev.action.showOk();
|
||||
} catch (err) {
|
||||
plugin_default.logger.error("Failed to launch Nextcloud:", err);
|
||||
await ev.action.showAlert();
|
||||
}
|
||||
}
|
||||
};
|
||||
LaunchNextcloud = __decorateClass([
|
||||
action({ UUID: "com.pdma.notion-timer.launch-nextcloud" })
|
||||
], LaunchNextcloud);
|
||||
var timerAction = new TimerToggle();
|
||||
plugin_default.actions.registerAction(timerAction);
|
||||
plugin_default.actions.registerAction(new LaunchNextcloud());
|
||||
plugin_default.ui.onSendToPlugin(async (ev) => {
|
||||
if (ev.payload.event === "saveSettings" && ev.payload.settings) {
|
||||
await ev.action.setSettings(ev.payload.settings);
|
||||
|
||||
@@ -1 +1 @@
|
||||
…æË>· o“ˆ!óhŰù!HC1ÈÉÒÉ_gY’|vnû¦»÷1Ûá´¨*ò�˜M(ªºþ0C5ó=
|
||||
IЬ╝Q╫┤Д■Ю╦ЩN╦°g╬░жКл┤╜Хр-│°вЙдmое╧В0Х·÷╕r([▌б▄√щ■v▓VwL∙┴╛
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 2.2 KiB |
@@ -0,0 +1,5 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 144 144" width="144" height="144">
|
||||
<rect width="144" height="144" rx="16" fill="#0082c9"/>
|
||||
<path d="M72 46c-13.3 0-24.4 9.4-27.1 22a16 16 0 0 0 3.1 31.8h48a16.5 16.5 0 0 0 3.6-32.6C97.3 55.6 85.9 46 72 46z"
|
||||
fill="none" stroke="white" stroke-width="6" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 349 B |
@@ -2,7 +2,7 @@
|
||||
"Author": "Pete Marfleet",
|
||||
"Description": "Toggle Notion time tracking for a project with a single button press.",
|
||||
"Name": "Notion Timer",
|
||||
"Version": "1.0.39",
|
||||
"Version": "1.0.40",
|
||||
"SDKVersion": 2,
|
||||
"Software": { "MinimumVersion": "5.0" },
|
||||
"OS": [{ "Platform": "mac", "MinimumVersion": "10.11" }],
|
||||
@@ -30,6 +30,19 @@
|
||||
],
|
||||
"PropertyInspectorPath": "ui/property-inspector.html",
|
||||
"SupportedInMultiActions": false
|
||||
},
|
||||
{
|
||||
"Icon": "imgs/nextcloud-icon",
|
||||
"Name": "Launch Nextcloud",
|
||||
"UUID": "com.pdma.notion-timer.launch-nextcloud",
|
||||
"Tooltip": "Launch the Nextcloud desktop client in the background.",
|
||||
"States": [
|
||||
{
|
||||
"Image": "imgs/nextcloud-icon",
|
||||
"TitleAlignment": "bottom"
|
||||
}
|
||||
],
|
||||
"SupportedInMultiActions": false
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Binary file not shown.
+24
-1
@@ -1,4 +1,4 @@
|
||||
const CURRENT_VERSION = "1.0.51";
|
||||
const CURRENT_VERSION = "1.0.52";
|
||||
const GITEA_BASE = "https://gitea.pdmarf.co.uk/pdm/stream_deck_notion_timer/raw/branch/stable-rebuild";
|
||||
const SIGNING_PUBLIC_KEY = `-----BEGIN PUBLIC KEY-----
|
||||
MCowBQYDK2VwAyEAN7ko8TUpuPzPAJuKAZCRjV0c4ZSlou5d9pUAF6o12b4=
|
||||
@@ -333,8 +333,31 @@ class TimerToggle extends SingletonAction<TimerSettings> {
|
||||
}
|
||||
}
|
||||
|
||||
const NEXTCLOUD_BIN = "/Applications/Nextcloud.app/Contents/MacOS/Nextcloud";
|
||||
|
||||
@action({ UUID: "com.pdma.notion-timer.launch-nextcloud" })
|
||||
class LaunchNextcloud extends SingletonAction {
|
||||
async onKeyDown(ev: KeyDownEvent): Promise<void> {
|
||||
try {
|
||||
const { spawn } = await import("node:child_process");
|
||||
const child = spawn(NEXTCLOUD_BIN, [], { detached: true, stdio: "ignore" });
|
||||
// "error" (e.g. ENOENT if Nextcloud isn't installed at this path) fires
|
||||
// asynchronously — without this listener it would crash the plugin process.
|
||||
child.once("error", (err) => {
|
||||
streamDeck.logger.error("Failed to launch Nextcloud:", err);
|
||||
});
|
||||
child.unref();
|
||||
await ev.action.showOk();
|
||||
} catch (err) {
|
||||
streamDeck.logger.error("Failed to launch Nextcloud:", err);
|
||||
await ev.action.showAlert();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const timerAction = new TimerToggle();
|
||||
streamDeck.actions.registerAction(timerAction);
|
||||
streamDeck.actions.registerAction(new LaunchNextcloud());
|
||||
|
||||
streamDeck.ui.onSendToPlugin<{ event: string; settings?: TimerSettings; token?: string }>(async (ev) => {
|
||||
if (ev.payload.event === "saveSettings" && ev.payload.settings) {
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
{ "version": "1.0.51" }
|
||||
{ "version": "1.0.52" }
|
||||
|
||||
Reference in New Issue
Block a user