The version number shown in the PI only updates via the 'projects' push, which only fires from onPropertyInspectorDidAppear (i.e. when a different button is clicked, forcing the PI to re-appear). After 'Check for Updates' completes and the plugin process restarts, an already-open PI kept showing the pre-update version indefinitely. Two changes: send a final 'Updated to vX — restarting…' status right before process.exit(0) so the update message doesn't hang on 'Updating…', and push sendProjectsToPI() once on every plugin startup (after streamDeck.connect()) so a PI that survived the restart gets the new version immediately instead of waiting for an unrelated button click.
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:
- Drag a Toggle Timer button onto a key in Stream Deck
- Click the button — a settings panel appears at the bottom
- Expand Notion Credentials and fill in your API token, then select your name from the dropdown
- Select your project from the Project dropdown
Uninstall & Reinstall
If the plugin is not updating or behaving unexpectedly, do a clean reinstall:
- Remove the plugin folder:
rm -rf ~/Library/Application\ Support/com.elgato.StreamDeck/Plugins/com.pdma.notion-timer.sdPlugin
-
Quit and relaunch Stream Deck.
-
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:
- Plugin starts and connects to Stream Deck
- After 10 seconds it checks
version.jsonon Gitea - If a newer version is available, it downloads
plugin.jsandplugin.js.sig - The Ed25519 signature is verified against the public key embedded in the plugin
- If the signature is valid, the plugin overwrites itself and restarts
- 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
- Make your changes
- Bump
CURRENT_VERSIONinsrc/plugin.tsandversion.json - 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 |