Last active
October 21, 2022 05:28
-
-
Save Konstantin-Dudersky/e626d04e8981efe4fe3b4547154d8f59 to your computer and use it in GitHub Desktop.
Open obsidian vault
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
"""Open obsidian vault. | |
Set the path to the vault in a variable VAULT_PATH. | |
Examples: | |
- absolute path: | |
VAULT_PATH: str = "/home/user/path-to-vault" | |
- relative path - current folder: | |
VAULT_PATH: str = "" | |
- relative path - subfolder of the root folder: | |
VAULT_PATH: str = "../subfolder" | |
""" | |
import subprocess | |
from pathlib import Path | |
VAULT_PATH: str = "" | |
URI: str = "obsidian://{path}" | |
subprocess.run(["xdg-open", URI.format(path=Path(VAULT_PATH).resolve())]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment