status-im / status-desktop

Status Desktop client made in Nim & QML
https://status.app
Mozilla Public License 2.0
271 stars 76 forks source link

Make deep links work for Linux #8027

Open endulab opened 1 year ago

endulab commented 1 year ago

Investigate what should be done to make deep links working on Linux.

Internal deep links should work from web browser according to specs: https://github.com/status-im/specs/blob/feature/url-shema/docs/draft/17-url-scheme.md (/u, /c and /cc for now).

caybro commented 1 year ago

Executive summary: not possible with the current AppImage packaging format that we use on Linux. AppImage simply doesn't support this usecase scenario. As a starting point, our .desktop file needs to contain a line such as:

MimeType=x-scheme-handler/status-im;

in order for the DE to recognize the status-im:// URL protocol but this needs to be done in a system-wide manner, not inside our AppImage bundle.

Then we need to make our binary aware of passing URL(s) via cmdline, which is done as follows:

Exec=nim_status_client %u

then somewhere in our NIM "main" code we'd need to parse that (list of) URL(s) and handle it accordingly and emit the appropriate signal.

Conclusion: fix this by moving to a more modern pkg format, such as Snap and/or Flatpak

cc @alexandraB99 @iurimatias @endulab

jrainville commented 1 year ago

I think we should leave this open, but move it to a later milestone with a to-analyze tag maybe?

caybro commented 1 year ago

Sure, why not, let's keep it open as a reminder what to do as the next step :)

anastasiyaig commented 1 year ago

@endulab @jrainville is it still a case to implement for 0.9.0?

jrainville commented 1 year ago

Moved to 0.10. We might move to later if we want to prioritize performance in 0.10.

jrainville commented 1 year ago

Just an FYI for whoever implements this. This part from Lukas "then somewhere in our NIM "main" code we'd need to parse that (list of) URL(s) and handle it accordingly and emit the appropriate signal" is already implemented.

jrainville commented 4 months ago

I was able to make it work by manually changing my configs on Ubuntu. Here are the steps:

  1. Create a file called status-app.desktop in ~/.local/share/applications

    [Desktop Entry]
    Version=1.0
    Name=Status
    Comment=Status is a free, open-source super app
    Exec="PATH/TO/status.AppImage" --uri=%U
    Terminal=false
    Type=Application
    TryExec=PATH/TO/status.AppImage
  2. Register the protocol in ~/.config/mineapps.list by adding this line: x-scheme-handler/status-app=status-app.desktop This can be done by running xdg-mime default status-app.desktop x-scheme-handler/status-app

With this in place, calling xdg-open "status-app://foo.bar" opens Status.


I'll now investigate how to set this up automatically when installing the app. Like @caybro said, it most likely involves changing the type of package we use.

jrainville commented 1 month ago

I have a branch here with my initial work https://github.com/status-im/status-desktop/tree/feat/bundle-app-as-flatpak. I had to pause this as there were more pressing issues