I’m also using Git Bash on my Windows, so I’ve created a workaround script that modifies Obsidian’s obsidian.json
file and changes all "open":true
values to "open":false
before launching Obsidian. That way my Obsidian always launches with the vault selector instead of reopening the last vault. The only downside to this is every time I launch Obsidian, a terminal window shows up for a moment, but it’s just a minor inconvenience to get a very convenient feature.
I’ve figured it might also be helpful to see if I could do it with Windows PowerShell, so people could use this even if they don’t have Git Bash on their systems. Here’s how I’ve set up both versions:
Git Bash version
- Create a script file wherever it is convenient for you. Call it something like
Obsidian.sh
. - Edit the script and put this code in:
sed -i 's/\"open\":true/\"open\":false/g' /c/Users/YourWindowsUserName/AppData/Roaming/obsidian/obsidian.json
start obsidian:
Just remember to replace “YourWindowsUserName” with your actual user name.
- Right-click on the script file and click “Create shortcut”.
- Put the shortcut file where you want it. You can also pin it to your taskbar or start menu by right-clicking and selecting appropriate option.
- Change the name of the shortcut. If you want, you can also change the icon to match Obsidians by right-clicking the shortcut, going into Properties, clicking the “Change Icon…” button and putting
%USERPROFILE%\AppData\Local\Obsidian\Obsidian.exe
as the icon location.
Windows PowerShell version
- Create a script file wherever it is convenient for you. Call it something like
Obsidian.ps1
. - Edit the script file and put this code in:
$filePath = "c:\Users\YourWindowsUserName\AppData\Roaming\obsidian\obsidian.json"
(Get-Content $filePath).Replace("`"open`":true","`"open`":false") | Set-Content $filePath
start obsidian:
Just remember to replace “YourWindowsUserName” with your actual user name.
- Right-click on the script file and click “Create shortcut”.
- Right-click on the shortcut and go into “Properties”.
- In the “Target:” field, before your scripts location, put this in:
powershell -noLogo -ExecutionPolicy unrestricted -file
So your final target should look something like this:
powershell -noLogo -ExecutionPolicy unrestricted -file C:\Obsidian.ps1
- Put the shortcut file where you want it. You can also pin it to your taskbar or start menu by right-clicking and selecting appropriate option.
- Change the name of the shortcut. If you want, you can also change the icon to match Obsidians by right-clicking the shortcut, going into Properties, clicking the “Change Icon…” button and putting
%USERPROFILE%\AppData\Local\Obsidian\Obsidian.exe
as the icon location.