Keep the app running in the system tray when its window is closed, so the command line interface keeps working.
Keeps Obsidian running in the system tray when you close its window, instead of quitting. Useful for the Obsidian command line interface, which needs the app running.
Desktop only.
obsidian:// link) brings hidden windows back. CLI commands do not.To exit Obsidian completely, use Quit Obsidian.
With several vaults open, there is still only one tray icon, and its menu acts on all windows. Close-to-tray applies only to vaults with the plugin enabled.
The plugin runs entirely inside Obsidian and makes no network requests. It uses the Electron APIs Obsidian already exposes to plugins (require('electron').remote):
beforeunload listener cancels the window close and hides the window instead. Reloads are left alone. Quitting the app is left alone too, so Obsidian's own shutdown and save logic still runs.close listener stops Obsidian from force-destroying the window 3 seconds after a cancelled close.icon.png.Window-close handling relies on Obsidian internals (the is-closing/is-quitting IPC channels and the window-close timer). It was verified against Obsidian 1.14.4 on Windows. macOS and Linux use the same code paths but have not been tested.
main.js and manifest.json from the latest release.<vault>/.obsidian/plugins/close-to-tray/.npm install
npm run dev # rebuild main.js on change
npm run build # type-check + production build
npm run lint
For live testing, symlink or copy main.js and manifest.json into a test vault's .obsidian/plugins/close-to-tray/.
minAppVersion in manifest.json if needed, then run npm version <patch|minor|major>. This bumps manifest.json, package.json, and versions.json.git push --follow-tags. The release workflow builds the plugin and creates a draft GitHub release with main.js and manifest.json attached.