leanflutter / uni_links_desktop

A desktop (supports macOS and Windows) implementation of uni_links plugin.
https://pub.dev/packages/uni_links_desktop
MIT License
28 stars 15 forks source link

Linux (Snap) support #12

Open CaptainDario opened 1 year ago

CaptainDario commented 1 year ago

Is Linux, especially Snap (as this is the officially supported packaging format), support planned for this?

For Snap, the protocol handling can be done via the snap's desktop file

You need to modify the .desktop file that snapd uses to generate the desktop entry. Primarily you need:

A line registering the protocol. e.g:

MimeType=x-scheme-handler/my-protocol-name;

Modify the exec= line to establish what arguments are acceptable, with valid argument types here 1. So for example

[Desktop Entry]
Name=CarrollNotes
Comment=A meme notetaking application
Exec=CarrollNotes %u
Icon=${SNAP}/meta/gui/CarrollNotes.svg
Type=Application
Categories=Office;
MimeType=x-scheme-handler/CarrollNotes;

If this is done correctly, other applications will be able to call your protocol handler, and the arguments would be passed to your snap to handle. You could then hypothetically launch CarrollNotes://OpenNote?=foobar and the snap would be passed the argument and be free to respond to it.

In general, this could be done using the bus package as mentioned here

It would be really nice, if you could consider snap and/or general Linux support.

CaptainDario commented 1 year ago

@lijy91 could you comment on if linux support is planned? I saw you also have created the protocol_handler package, is linux support planned for either of these two packages?

thecodekitchen commented 1 year ago

I've got an app planned that desperately needs this feature! Please let us know what the status is!