pop-os / launcher

Modular IPC-based desktop launcher service
Mozilla Public License 2.0
232 stars 48 forks source link

Launch an xdg-open custom URI #154

Closed canadaduane closed 1 year ago

canadaduane commented 1 year ago

The https://obsidian.md app (flatpak) registers its own mime type, obsidian://.... From the CLI, I can launch Obsidian with an open search page, like so:

$ xdg-open obsidian://search?query=journal

I can add a launcher config entry, like so:

$ sudo vim /usr/lib/pop-launcher/plugins/web/config.ron

#
#    (
#       matches: ["j", "journal"],
#       queries: [(name: "Journal", query: "obsidian://search?query=")]
#    ),
#

However, the launcher seems to open a browser to https://obsidian://search?query=.

Is this intended behavior?

mmstick commented 1 year ago

It's not. Would you like to also patch this?

mmstick commented 1 year ago

I guess it's kind of weird for the web plugin to be used for non-web URIs.

canadaduane commented 1 year ago

Is there another plugin that would be better suited to this kind of URI?

canadaduane commented 1 year ago

Since the web plugin does use xdg-open already, it does seem very adjacent. I will look into patching unless you feel it does not belong here.

mmstick commented 1 year ago

There's not another plugin

canadaduane commented 1 year ago

The above PR gets a step closer to my goal; however, I've now discovered a new impediment:

Jan 10 20:45:32 rosie gnome-shell[15076]: got query: obsidian://search?query=test
Jan 10 20:45:32 rosie systemd[3774]: Started app-flatpak-md.obsidian.Obsidian-15102.scope.
Jan 10 20:45:32 rosie gnome-shell[15111]: /app/bin/obsidian.sh: line 27: echo: write error: Broken pipe

I'm still investigating, but it appears something is not long-lived enough for this to work as-is.

(Obsidian does not open).

Update: Line 27 appears to be an "echo" statement in obsidian.sh: https://github.com/flathub/md.obsidian.Obsidian/blob/master/obsidian.sh#L27

canadaduane commented 1 year ago

I'm still investigating, but it appears something is not long-lived enough for this to work as-is.

Fixed in #155

jacobgkau commented 1 year ago

If the PR fixing the issue hasn't been merged yet, then please don't close the issue. (Since the PR and issue are linked, the issue will automatically close when the PR is merged.)