david@lat2:~$ obsidian obsidian://open?vault=zettlrMarkor&file=recentNotes
[1] 30407
david@lat2:~$ 2021-08-05 03:25:12 Loading main app package /snap/obsidian/x1/resources/obsidian.asar
Gtk-Message: 21:25:12.721: Failed to load module "appmenu-gtk-module"
(obsidian:30407): Gtk-WARNING **: 21:25:12.739: Theme parsing error: gtk.css:1555:23: 'font-feature-settings' is not a valid property name
(obsidian:30407): Gtk-WARNING **: 21:25:12.744: Theme parsing error: gtk.css:3593:25: 'font-feature-settings' is not a valid property name
(obsidian:30407): Gtk-WARNING **: 21:25:12.745: Theme parsing error: gtk.css:4055:23: 'font-feature-settings' is not a valid property name
2021-08-05 03:25:12 Checking for update using Github
What I’m trying to do
I want to be able to open a specific note within obsidian from outside obsidian, like from a terminal or a bash script.
The link I used was correct because it was generated by dragging the link to the existing file into an external text editor. I also tried adding “.md” to the end.
What happens:
obsidian launches, but opens the most recently viewed file, not the “recentNotes” file.
What am I doing wrong?
version: 0.12.12 (snap)
linux version: Ubuntu 20.04.2 LTS
(You probably shouldn’t set Obsidian as a text/html handler.)
and I call up Obidian from the terminal using xdg-open:
matthias@e6510:~$ xdg-open obsidian://open?vault=Knowledgebase&file=Discord
[1] 42953
matthias@e6510:~$ 2021-08-05 15:37:30 Loading updated app package /home/matthias/.config/obsidian/obsidian-0.12.12.asar
Received callback URL obsidian://open?vault=Knowledgebase
2021-08-05 15:37:31 Checking for update using Github
2021-08-05 15:37:31 Success.
2021-08-05 15:37:31 Latest version is 0.12.12
2021-08-05 15:37:31 App is up to date.
[1]+ Fertig xdg-open obsidian://open?vault=Knowledgebase
Doesn’t work. Why? Because the obsidian URI isn’t quoted and the & will send the first part of the string to the background!
Using:
matthias@e6510:~$ xdg-open "obsidian://open?vault=Knowledgebase&file=Discord"
matthias@e6510:~$ 2021-08-05 15:59:14 Loading updated app package /home/matthias/.config/obsidian/obsidian-0.12.12.asar
Received callback URL obsidian://open?vault=Knowledgebase&file=Discord
2021-08-05 15:59:15 Checking for update using Github
2021-08-05 15:59:15 Success.
2021-08-05 15:59:15 Latest version is 0.12.12
2021-08-05 15:59:15 App is up to date.
works fine! (Check on the “Received callback” line: it now got the full URI, including the file name.)
The output of both xdg-mime query default x-scheme-handler/obsidian and xdg-settings get default-url-scheme-handler obsidian should be obsidian.desktop.
Also double-check that Obsidian appears in ~/.config/mimeapps.list: