Zhiyuan Ju35 downloadsLock the vault workspace with a password when the app loses focus.
Lock an Obsidian vault's workspace with a local password. Reopening the vault or returning to a locked workspace requires the password.
Vault Screen Lock requires Obsidian 1.15.0 or later.
vault-screen-lock folder under the vault configuration folder's plugins directory. The default location is .obsidian/plugins/vault-screen-lock/.main.js, manifest.json, and styles.css from the same GitHub release and place them directly in that folder.Switching apps and minimizing have been tested on Linux with X11, along with a screen lock signal from an isolated D-Bus session. Mobile background handling has been tested in Obsidian's mobile layout with simulated app lifecycle conditions. Locking on desktop devices and lifecycle behavior on iOS and Android still need device verification.
The plugin runs offline. It stores a salted password verifier in Obsidian's vault-specific device storage. Set a password on each device. Obsidian stores the mobile grace period with the plugin data in the vault's configuration folder. Sync can carry the grace period across devices if it includes plugin settings.
This is a privacy screen for casual access. Notes and attachments remain readable on disk. Anyone who can open Obsidian's Settings can disable the plugin, including from a separate Settings window that was left open. Close Settings before stepping away. Restricted Mode also lets you open the vault with community plugins disabled. On mobile the plugin covers the workspace during the grace period when the web view delivers its background event. The operating system controls when it captures app previews.
If you forget the password or the lock screen says the saved settings could not be read, reset the verifier for that vault on this device.
Disable Vault Screen Lock in Settings → Community plugins, or open the vault in Restricted Mode. If you cannot reach either option, quit Obsidian and temporarily move the plugins/vault-screen-lock folder out of the vault's configuration folder. Reopen the same vault.
In the vault workspace, open View → Toggle Developer Tools and select Console. On mobile, use the Obsidian guide to inspecting the web view on the device where you set the password. Run this command to clear just the plugin's password verifier for the open vault.
app.saveLocalStorage("vault-screen-lock:verifier", null)
If you moved the plugin folder, quit Obsidian, restore the folder, and reopen the vault. Enable Vault Screen Lock if needed, then return to the workspace and set a new password.
Build with Node.js 24 or later and npm.
npm ci --ignore-scripts
npm run lint
npm run build
Attach main.js, manifest.json, and styles.css individually to a GitHub Release whose tag equals the manifest version.
The build pins the public obsidian type package independently of the minimum app version, which reflects the runtime used to verify the plugin.