I’m writing a plugin that intends to have its settings read by the same plugin installed in other vaults. The problem is, Obsidian doesn’t appear to provide a mechanism to determine what another vault’s config folder is named:
Where does Obsidian store a vault’s “Override config folder” value?
Is there an API to get the Vault object of a different vault (to access its configDir)?
I consulted the How Obsidian stores data article, checked the global data folder, the Windows registry, and the local .obsidian folder (not that it would make much sense to be stored there) but I’m not seeing anything obvious and am running out of ideas.
App.getOverrideConfigDir(appId) was the missing link. There is one unforunate snag with its behavior: It returns null to indicate a vault is using the default config dir. This means plugin authors need to include “.obsidian” as a literal for the fallback code, which I’ve noticed the ObsidianReviewBot on github doesn’t like.
As a result, I may go with your second suggestion and use localStorage.
Hah, yes I thought about it! Perhaps first I will submit a version that uses “.obsidian” plainly so my intent is clear. It appears the review bot has a /skip command to presumably forward the issue to a human for review
vault.configDir works for the active vault, however my plugin is trying to access the config folder of a different vault.
The goal is to override a vault’s display name between Obsidian instances. The plugin is in queue so I may wait to see if you have feedback regarding the current approach