pdmarf acf4f98d6b v1.0.49: fix version auto-refresh by polling from the property inspector
The v1.0.47/48 attempt pushed sendProjectsToPI() from the plugin right
after streamDeck.connect() on startup, assuming that would reach an
already-open panel post-update-restart. It doesn't: per the SDK,
sendToPropertyInspector only delivers 'when the property inspector is
visible for an action provided by this plugin', and that visibility
state is tracked per-process via live didAppear/onSendToPlugin events
-- a freshly restarted process has never received one, so the push was
silently dropped. Confirmed in testing: the panel stayed frozen on
'Updating to vX...' indefinitely.

Removed the ineffective push. Instead, the property inspector's
'Check for Updates' handler now schedules a few refreshProjects
requests (1.5s/3.5s/6s/9s after the click) -- the same proven
PI-initiated round trip already used when entering an API token, which
reliably re-populates the panel including the version text once the
new process comes back up.

Also hardened checkForUpdates(): the final 'Updated to vX --
restarting...' status is now awaited with a short delay before
process.exit(0), best-effort only, since the panel no longer depends
on it arriving.
2026-09-02 11:32:06 +01:00
2026-04-10 19:51:21 +01:00
2026-04-10 19:51:21 +01:00
2026-04-10 19:51:21 +01:00

Notion Timer — Stream Deck Plugin

A Stream Deck plugin that toggles time tracking in Notion. Press a button to start a timer against a project, press again to stop. Only one timer can run at a time.


Staff Installation

Requires Stream Deck installed and up to date.

Open Terminal and run:

curl -s https://gitea.pdmarf.co.uk/pdm/stream_deck_notion_timer/raw/branch/master/install.sh | bash

Stream Deck will open and install the plugin automatically.

First-time setup:

  1. Drag a Toggle Timer button onto a key in Stream Deck
  2. Click the button — a settings panel appears at the bottom
  3. Expand Notion Credentials and fill in your API token, then select your name from the dropdown
  4. Select your project from the Project dropdown

Uninstall & Reinstall

If the plugin is not updating or behaving unexpectedly, do a clean reinstall:

  1. Remove the plugin folder:
rm -rf ~/Library/Application\ Support/com.elgato.StreamDeck/Plugins/com.pdma.notion-timer.sdPlugin
  1. Quit and relaunch Stream Deck.

  2. Reinstall the latest version:

curl -sL https://gitea.pdmarf.co.uk/pdm/stream_deck_notion_timer/raw/branch/master/notion-timer.streamDeckPlugin -o /tmp/notion-timer.streamDeckPlugin && open /tmp/notion-timer.streamDeckPlugin

Stream Deck will install the plugin and auto-updates will work from that point on.


Auto-Updates

Updates are automatic — no action needed from staff.

The flow:

  1. Plugin starts and connects to Stream Deck
  2. After 10 seconds it checks version.json on Gitea
  3. If a newer version is available, it downloads plugin.js and plugin.js.sig
  4. The Ed25519 signature is verified against the public key embedded in the plugin
  5. If the signature is valid, the plugin overwrites itself and restarts
  6. Stream Deck relaunches the plugin on the new version

If the update server is unreachable or the signature fails, the plugin continues running on the current version unchanged.


Developer Workflow

Build & deploy locally

npm run build       # compile + sign

Then copy to Stream Deck:

cp com.pdma.notion-timer.sdPlugin/bin/plugin.js "$HOME/Library/Application Support/com.elgato.StreamDeck/Plugins/com.pdma.notion-timer.sdPlugin/bin/plugin.js"
cp com.pdma.notion-timer.sdPlugin/bin/plugin.js.sig "$HOME/Library/Application Support/com.elgato.StreamDeck/Plugins/com.pdma.notion-timer.sdPlugin/bin/plugin.js.sig"
pkill -f "notion-timer"

Release an update to staff

  1. Make your changes
  2. Bump CURRENT_VERSION in src/plugin.ts and version.json
  3. Run:
npm run package
git add .
git commit -m "v1.x.x: description"
git push

Staff machines will pick up the update within 10 seconds of their next Stream Deck start.

Signing key

The Ed25519 private key lives at ~/.notion-timer-signing-key.pem — keep this backed up. If lost, a new key pair must be generated and the plugin redistributed manually to all staff.


Architecture

Component Location Runtime
Plugin logic src/plugin.ts Node.js 20 (under Stream Deck)
Notion API src/notion.ts Node.js 20
Settings UI ui/property-inspector.html Browser (in Stream Deck app)
PI library ui/libs/ Browser — from elgatosf/streamdeck-javascript-sdk
S
Description
No description provided
Readme
803 KiB
Languages
JavaScript 89.5%
TypeScript 5.2%
HTML 5.1%
Shell 0.2%