# URL Scheme doesn't work on Linux

**URL:** <https://forum.obsidian.md/t/url-scheme-doesnt-work-on-linux/5794>\
**Category:** Bug graveyard\
**Tags:** upstream-bug, important\
**Created:** [September 16, 2020, 2:22pm UTC](https://forum.obsidian.md/t/url-scheme-doesnt-work-on-linux/5794 "2020-09-16T14:22:51Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![argentum](https://forum.obsidian.md/user_avatar/forum.obsidian.md/argentum/32/7733_2.png) [@argentum](https://forum.obsidian.md/u/argentum)\
**Post date:** [September 16, 2020, 2:22pm UTC](https://forum.obsidian.md/t/url-scheme-doesnt-work-on-linux/5794/1 "2020-09-16T14:22:51Z")

</div>

### Steps to reproduce

1. Have two vaults `vaultA` and `vaultB` (no spaces in their names).
2. `vaultA` has a note `noteA`
3. With Obsidian closed, try to open an Obsidian URL either in the browser or through `xdg-open`:
  - obsidian://vault/vaultB
  - obsidian://vault/vaultA/noteA
  - obsidian://vault/vaultA

4. With `vaultA` open in Obsidian try to open either of these:
  - obsidian://vault/vaultB
  - obsidian://vault/vaultA/noteA

5. Try the absolute path to `noteA`
  - obsidian:///home/argen/vaultA/noteA

### Expected result

With `vaultA` open in Obsidian

- Opening the link for `obsidan://vault/vaultA/noteA` would open `noteA`
- Opening the link for `obsidian://vault/vaultB` would open `vaultB`

### Actual result

- If Obsidian is closed, the last opened vault is opened.
- If Obsidian is open, the vault picker is shown.

### Environment

- Operating system: Ubuntu 18.04 with gnome-flashback and i3

- Obsidian version: 0.8.15, installer v.0.8.14

* * *

### Additional information

My `obsidian.destkop` file located in `~/.local/share/applications/`:

```auto
[Desktop Entry]
Name=Obsidian
Comment=Markdown Notetaking App
GenericName=Text Editor
Type=Application
Path=/home/argen/bin
Exec=Obsidian-0.8.14.AppImage %u
Icon=obsidian
StartupWMClass=obsidian
MimeType=text/html;x-scheme-handler/obsidian;

```

I also tried with the unpacked AppImage, and `Exec` pointing to the `obsidian` executable with the same result.

I have also ran the following:

```bash
xdg-mime default obsidian.destkop x-scheme-handler/obsidian
update-desktop-database

```

The output of both `xdg-mime query default x-scheme-handler/obsidian` and `xdg-settings get default-url-scheme-handler obsidian` is `obsidian.desktop`.

The relevant lines from my `~/.config/mimeapps.list`:

```bash
[Default Applications]
...
text/html=obsidian.desktop
x-scheme-handler/obsidian=obsidian.desktop

```

The `text/html` mime type gets added whenever I open Obsidian, but I don’t think that plays a role here.

Edit: Looking a little closer at the `mimeapps.list`, something is not right here. Opening Obsidian makes it the **default** application for `html` files, instead of the browser. I don’t know if this is related, but this is definitely a bug. I don’t think Obsidian is intended to open other local html files, but even if it is it should be added to the `[Added Associations]` section instead of making it the default. In fact, double clicking a local html file behaves in a similar way as trying to open an obsidian link: if Obsidian is open, the vault picker is chosen or if it’s closed, the last vault is open.

---

<div class="post-metadata">

**Author:** ![mjedmonds](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/m/bbe5ce/32.png) [@mjedmonds](https://forum.obsidian.md/u/mjedmonds)\
**Post date:** [September 16, 2020, 2:26pm UTC](https://forum.obsidian.md/t/url-scheme-doesnt-work-on-linux/5794/2 "2020-09-16T14:26:43Z")

</div>

I can confirm the URL handler is not working for me either on Linux. My desktop entry looks like this (I modified the default from snap to include `MimeType` and `%u` on `Exec` after a discussion with @argentum)

```auto
[Desktop Entry]
X-SnapInstanceName=obsidian
Name=Obsidian
Exec=env BAMF_DESKTOP_FILE_HINT=/var/lib/snapd/desktop/applications/obsidian_obsidian.desktop /snap/bin/obsidian %u
Terminal=false
Type=Application
Icon=/snap/obsidian/x1/meta/gui/icon.png
StartupWMClass=Obsidian
Comment=Obsidian
Categories=Office;
MimeType=x-scheme-handler/obsidian;

```

---

<div class="post-metadata">

**Author:** ![Philipp](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/p/46a35a/32.png) [@Philipp](https://forum.obsidian.md/u/Philipp)\
**Post date:** [September 16, 2020, 2:26pm UTC](https://forum.obsidian.md/t/url-scheme-doesnt-work-on-linux/5794/3 "2020-09-16T14:26:44Z")

</div>

Same behavior for me as well! Ubuntu 20.04.

---

<div class="post-metadata">

**Author:** ![alltagsverstand](https://forum.obsidian.md/user_avatar/forum.obsidian.md/alltagsverstand/32/4265_2.png) [@alltagsverstand](https://forum.obsidian.md/u/alltagsverstand)\
**Post date:** [September 16, 2020, 5:36pm UTC](https://forum.obsidian.md/t/url-scheme-doesnt-work-on-linux/5794/4 "2020-09-16T17:36:06Z")

</div>

> [@argentum](#):
>
> ### Actual result
> 
> - If Obsidian is closed, the last opened vault is opened.
> - If Obsidian is open, the vault picker is shown.

Same behavior here.

Tried also to open a file within a vault directly - here again (if obsidian was closed) the last opened file is shown…

Ubuntu Mate 20.04

---

<div class="post-metadata">

**Author:** ![knowledgeworker](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/k/b9e5f3/32.png) [@knowledgeworker](https://forum.obsidian.md/u/knowledgeworker)\
**Post date:** [September 22, 2020, 6:01am UTC](https://forum.obsidian.md/t/url-scheme-doesnt-work-on-linux/5794/6 "2020-09-22T06:01:07Z")

</div>

Newbie here. Can you advise how much this impacts functionality? It sounds/reads to me as a major issue. I’ve just installed Obsidian on my Linux (Bunsen Labs: Debian-based) machine.

---

<div class="post-metadata">

**Author:** ![alltagsverstand](https://forum.obsidian.md/user_avatar/forum.obsidian.md/alltagsverstand/32/4265_2.png) [@alltagsverstand](https://forum.obsidian.md/u/alltagsverstand)\
**Post date:** [September 22, 2020, 6:46am UTC](https://forum.obsidian.md/t/url-scheme-doesnt-work-on-linux/5794/7 "2020-09-22T06:46:02Z")

</div>

> [@knowledgeworker](#):
>
> Can you advise how much this impacts functionality?

It doesn’t have any impact on obsidian’s functionality at all - the question is only if you can target specific notes _in_ obsidian _from_ other apps…

And this should be fixed with the new insider build 0.9.0!

Btw., for me it is still not working - still shows the vault picker! But maybe I didn’t do enough configuration, didn’t have the time yet to deal with it… Is the problem solved for others? @argentum @Philipp @mjedmonds

---

<div class="post-metadata">

**Author:** ![argentum](https://forum.obsidian.md/user_avatar/forum.obsidian.md/argentum/32/7733_2.png) [@argentum](https://forum.obsidian.md/u/argentum)\
**Post date:** [September 22, 2020, 8:39am UTC](https://forum.obsidian.md/t/url-scheme-doesnt-work-on-linux/5794/8 "2020-09-22T08:39:00Z")

</div>

Not yet! There was an upstream fix that got merged today. Hopefully, that fixes it!

---

<div class="post-metadata">

**Author:** ![mullerrwd](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/m/ce7236/32.png) [@mullerrwd](https://forum.obsidian.md/u/mullerrwd)\
**Post date:** [September 22, 2020, 12:50pm UTC](https://forum.obsidian.md/t/url-scheme-doesnt-work-on-linux/5794/9 "2020-09-22T12:50:47Z")

</div>

I second the problems outlined here. See my [discord comments](https://discord.com/channels/686053708261228577/716028884885307432/757909500307963965) for steps taken and errors.

---

<div class="post-metadata">

**Author:** ![Licat](https://forum.obsidian.md/user_avatar/forum.obsidian.md/licat/32/2_2.png) [@Licat](https://forum.obsidian.md/u/Licat)\
**Post date:** [September 25, 2020, 8:43am UTC](https://forum.obsidian.md/t/url-scheme-doesnt-work-on-linux/5794/10 "2020-09-25T08:43:59Z")

</div>

After some extensive testing I have found that this bug is caused by a “is-win32” check left in the code which skipped parsing of command line arguments on Linux. What a dumb mistake on my part, I’m really sorry!

Will be fixed in v0.9.2.

---

<div class="post-metadata">

**Author:** ![mullerrwd](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/m/ce7236/32.png) [@mullerrwd](https://forum.obsidian.md/u/mullerrwd)\
**Post date:** [September 26, 2020, 11:10am UTC](https://forum.obsidian.md/t/url-scheme-doesnt-work-on-linux/5794/11 "2020-09-26T11:10:49Z")

</div>

No worries! I’m happy you found it, looking forward to the update👍

---

<div class="post-metadata">

**Author:** ![Craig](https://forum.obsidian.md/user_avatar/forum.obsidian.md/craig/32/8831_2.png) [@Craig](https://forum.obsidian.md/u/Craig)\
**Post date:** [September 26, 2020, 1:36pm UTC](https://forum.obsidian.md/t/url-scheme-doesnt-work-on-linux/5794/12 "2020-09-26T13:36:19Z")

</div>

Good news! Thanks for digging in on this issue, @Licat.

---

<div class="post-metadata">

**Author:** ![Thriveth](https://forum.obsidian.md/user_avatar/forum.obsidian.md/thriveth/32/8752_2.png) [@Thriveth](https://forum.obsidian.md/u/Thriveth)\
**Post date:** [January 18, 2021, 8:59pm UTC](https://forum.obsidian.md/t/url-scheme-doesnt-work-on-linux/5794/13 "2021-01-18T20:59:14Z")

</div>

The bug that makes Obsidian hijack all text/html files in the mimeapps.list file still persists, though, and it is very annoying that I need to manually edit that file every time I want to view an HTML file from my desktop.

An app like Obsidian should definitely not touch a user’s default system settings for anything outside Obsidian’s own scope.

---

<div class="post-metadata">

**Author:** ![argentum](https://forum.obsidian.md/user_avatar/forum.obsidian.md/argentum/32/7733_2.png) [@argentum](https://forum.obsidian.md/u/argentum)\
**Post date:** [January 19, 2021, 11:54am UTC](https://forum.obsidian.md/t/url-scheme-doesnt-work-on-linux/5794/14 "2021-01-19T11:54:31Z")

</div>

This is, unfortunately, a bug in xdg-utils (used by electron). See [here](https://github.com/electron/electron/issues/20382) for more details, and feel free to open a #bug-reports to track the upstream bug, but in the end, we depend on an upstream fix for this.

---

<div class="post-metadata">

**Author:** ![argentum](https://forum.obsidian.md/user_avatar/forum.obsidian.md/argentum/32/7733_2.png) [@argentum](https://forum.obsidian.md/u/argentum)\
**Post date:** [January 28, 2021, 3:06pm UTC](https://forum.obsidian.md/t/url-scheme-doesnt-work-on-linux/5794/15 "2021-01-28T15:06:08Z")

</div>

@Thriveth there is a workaround [here](https://github.com/balena-io/etcher/issues/3374#issuecomment-739558436) in case you’re interested. Haven’t had time yet to test it out.

---

<div class="post-metadata">

**Author:** ![WhiteNoise](https://forum.obsidian.md/user_avatar/forum.obsidian.md/whitenoise/32/11_2.png) [@WhiteNoise](https://forum.obsidian.md/u/WhiteNoise)\
**Post date:** [October 13, 2022, 4:12pm UTC](https://forum.obsidian.md/t/url-scheme-doesnt-work-on-linux/5794/16 "2022-10-13T16:12:02Z")

</div>

Archived on October 13, 2022, 4:12pm UTC


