Can't figure url note links from linux terminal

Things I have tried

I put a desktop file in /home/david/.local/share/applications/

(called “obsidian.desktop”)

with this:
[Desktop Entry]
Exec=obsidian %u

and here’s the terminal output:

[email protected]:~$ obsidian obsidian://open?vault=zettlrMarkor&file=recentNotes
[1] 30407
[email protected]:~$ 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

I use Obsidian 0.12.12 (installer 0.12.10) as an AppImage on Linux Mint 20.2 (based on Ubuntu), and I have


[Desktop Entry]
Comment=Markdown Notetaking App
GenericName=Text Editor
Exec=/home/matthias/AppImages/Obsidian-0.12.10.AppImage %u

(You probably shouldn’t set Obsidian as a text/html handler.)

and I call up Obidian from the terminal using xdg-open:

[email protected]:~$ xdg-open obsidian://open?vault=Knowledgebase&file=Discord
[1] 42953
[email protected]:~$ 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!


[email protected]:~$ xdg-open "obsidian://open?vault=Knowledgebase&file=Discord"
[email protected]:~$ 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.)

Have you ran the following?

xdg-mime default obsidian.destkop x-scheme-handler/obsidian

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:

[Default Applications]

Thanks to both of you :slight_smile:

I’ll try those things and post back (hopefully within a day or so)

@Moonbase59 : It works!!! Thank you so much!

(should have known to try using quotation marks, ha ha)

1 Like

Hee hee! Don’t we all fall into these kind of traps, once in a while?

Glad it works for you!

(and you’d probably like to repair your theme, or file a bug hint. hint)

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.