Hacker News new | ask | show | jobs
by cromka 210 days ago
Would be great if it was also possible to have it open the Team URIs in that App Mode instance instead of the browser itself — I assume it does not.
1 comments

What kind of URLs does it use? If it's anything with a unique prefix (like Telegram's tg://), you can add it to the desktop file:

  MimeType=x-scheme-handler/foobar;
and run `update-mime-database`.

If not, I would write a shell wrapper and set it as the default browser; something to the effect of:

  #!/usr/bin/bash
  set -eu
  for arg in "$@"; do
    if [[ $arg == *whatever-url-teams-uses.com* ]]; then
      exec gtk-launch teams "$@"
    fi
  done
  exec gtk-launch firefox "$@"
(gtk-launch uses flags from the .desktop file so you don't have to repeat them)