Obsidian Theme
Install, list and select Obsidian CSS themes — with Borland Modern Blue and Swamp Club bundled — without hand-copying folders or editing appearance.json. WHAT IT DOES
Obsidian themes are folders under .obsidian/themes/<name> plus a
cssTheme key in .obsidian/appearance.json, but installing one by hand
means copying files, getting the folder name exactly right and editing JSON
without dropping the vault's other appearance settings. This extension makes
that one idempotent command. It ships the two themes used on this machine —
Borland Modern Blue and Swamp Club — installs either or both into a vault,
selects one by id or display name, and reports what is actually installed and
active. With no vault path it reads Obsidian's own per-platform registry and
picks the open (or only) vault, so a normal desktop install needs no
configuration. Paths use @std/path, so Windows drive-letter and UNC vaults
work as well as macOS and Linux; the extension backs up any file it
overwrites and preserves every other appearance key.
INSTALL
swamp extension pull @svendowideit/obsidian-themeDEPENDENCIES
None — the extension is self-contained. It reads Obsidian's vault registry
and writes only the theme folders and appearance.json with Deno's
filesystem, using @std/path for both / and \ separators. It starts no
service and installs no cron trigger. The vault must have been opened in
Obsidian once so .obsidian exists and is registered.
RUN
# No vaultPath: read Obsidian's per-platform registry and use the open
# (or only) vault. This is the normal desktop case.
swamp model @svendowideit/obsidian-theme method run install obsidian-theme
# Or target a specific vault explicitly (absolute, ~, or a Windows path).
swamp model @svendowideit/obsidian-theme method run install obsidian-theme \
--input vaultPath=/home/me/vault
# Show every installed theme and which one is active.
swamp model @svendowideit/obsidian-theme method run list obsidian-theme \
--input vaultPath=/home/me/vault
# Select the Borland theme by id; its display name also works.
swamp model @svendowideit/obsidian-theme method run select obsidian-theme \
--input vaultPath=/home/me/vault \
--input theme=borland-modern-blue
# The one entry point: install on a fresh vault, refresh on an existing
# one, and select the default only if no theme is chosen yet. Re-running
# changes nothing and never overwrites your selection.
swamp workflow run @svendowideit/obsidian-theme-upgrade \
--input vaultPath=/home/me/vaultCONFIGURE
Global arguments: vaultPath (default empty = auto-detect), vaultName
(default empty), configDir (default .obsidian) and defaultTheme
(default borland-modern-blue). With vaultPath empty the extension reads
Obsidian's registry — %APPDATA%\obsidian\obsidian.json on Windows,
~/Library/Application Support/obsidian/obsidian.json on macOS, and
$XDG_CONFIG_HOME or ~/.config/obsidian/obsidian.json on Linux — and uses
the vault marked open, or the only registered vault. Set vaultName to pick
a registered vault by folder name, or vaultPath to bypass the registry.
Every method also accepts vaultPath, vaultName and configDir as
per-call overrides (empty uses the global), so --input vaultPath=… works on
a method run. Method arguments: install takes theme (empty installs
every bundled theme) and force; installBundledThemes takes
selectDefault, defaultTheme and force; select takes theme. A
per-call input wins over a global. To make a vault the default for method
runs, configure the model once:
swamp model create @svendowideit/obsidian-theme obsidian-theme \
--global-arg vaultPath=/home/me/vaultSETUP
setup is read-only and safe to run first. It reports how the vault was
found (explicit, registry-name, registry-default or none), the
registry path and every registered vault, whether the config folder, themes
folder and appearance file exist, which bundled themes are installed, which
theme is active, and any discovery error. It persists what it found as the
config resource so later runs can reuse it; it never edits the vault. Run
it with no arguments to see the detected vault, or point it at one:
swamp model @svendowideit/obsidian-theme method run setup obsidian-theme
swamp model @svendowideit/obsidian-theme method run setup obsidian-theme \
--input vaultPath=/home/me/vaultUPGRADE
One idempotent workflow is both the install and the upgrade: on a fresh
vault it installs both themes and selects the default only when no theme is
active; on an existing vault it refreshes the bundled files without changing
the selected theme. Existing files that differ are backed up once to
*.bak-obsidian-theme before they are replaced:
swamp workflow run @svendowideit/obsidian-theme-upgrade \
--input vaultPath=/home/me/vaultWHAT IT INSTALLS
Two theme folders under <vaultPath>/<configDir>/themes/ —
Borland Modern Blue/ and Swamp Club/, each with theme.css and
manifest.json — plus the cssTheme key it sets in
<vaultPath>/<configDir>/appearance.json when you select a theme. It creates
appearance.json if absent, keeps every other key, and writes one
*.bak-obsidian-theme backup beside any file it overwrites. It installs no
service, daemon or trigger.
Global Arguments
| Argument | Type | Description |
|---|---|---|
| vaultPath? | string | Obsidian vault folder — the directory that contains the config dotfolder. |
| vaultName? | string | Registered vault folder name to look up in Obsidian's registry when |
| configDir? | string | Vault config dotfolder, relative to vaultPath (default .obsidian). |
| defaultTheme? | string | Bundled theme (id or display name) selected when the vault has no |
| Argument | Type | Description |
|---|---|---|
| theme? | string | Bundled theme id or display name to install. Empty installs every bundled theme. |
| force? | boolean | Rewrite even when the installed theme files are already identical. |
| Argument | Type | Description |
|---|---|---|
| selectDefault? | boolean | Select defaultTheme only when the vault has no cssTheme yet. An existing |
| defaultTheme? | string | Override defaultTheme for this call (empty uses the model global). |
| force? | boolean | Rewrite even when the installed theme files are already identical. |
| Argument | Type | Description |
|---|---|---|
| theme | string | Installed theme to select — its display name or a bundled theme id. |
Resources
Install the bundled Obsidian themes on a fresh vault, or refresh them after an extension update, without changing an existing selected theme. The workflow runs setup first, installs Borland Modern Blue and Swamp Club with the current bundled files, and then lists every installed theme and the active one. On an empty vault it selects the default theme; on a vault that already has a cssTheme it leaves that choice alone. Identical files are skipped; a file whose content changed is backed up once t
- Has README or module doc2/2earned
- README has a code example1/1earned
- README is substantive1/1earned
- Most symbols documented1/1earned
- No slow types (deprecated)1/1earned
- Dependencies pass trust audit2/2earned
- Docs keep secrets in a vault1/1earned
- Has description1/1earned
- Platform support declared (or universal)2/2earned
- License2/2earned
- Verified public repository2/2earned