GNOME's default browser, Epiphany has a a handy feature that lets you turn any website into what acts like an independent application. In reality all it does is create a .desktop
in ${HOME}/.local/share/applications/
that launches Epiphany with the --application-mode
flag. Here's an example of one I setup for Linear:
[Desktop Entry]
Exec=epiphany --application-mode --profile=/home/daniel/.local/share/org.gnome.Epiphany.WebApp_af502f2b37eea07ed9083c7daf40f34553f6fccd https://linear.app/companyname/team/AAA/active
StartupNotify=true
Terminal=false
Type=Application
Categories=GNOME;GTK;
StartupWMClass=org.gnome.Epiphany.WebApp_af502f2b37eea07ed9083c7daf40f34553f6fccd
X-Purism-FormFactor=Workstation;Mobile;
Name=Linear
Icon=/home/daniel/.local/share/applications/linear.png
This is handy for people like me who like to split their development process over multiple workspaces and don't want to have to flip back to Firefox and find a tab in a haystack of tabs every time you want to check a ticket.
I'm now fiddling with an idea where I could click on a URL in Slack or Thunderbird and have it open in the appropriate "app": work tickets for Jira/Linear/whatever, Git(Hub|Lab) to the appropriate app as well, etc.
The trouble I'm having at the moment though is that while I can launch Epiphany to point to any URL I want using whatever profile I want, I can't figure out how to point one of these pseudo apps to a new URL when it's currently running.
For example this will open the Linear app to the specified URL:
$ epiphany --application-mode --profile=/home/daniel/.local/share/org.gnome.Epiphany.WebApp_af502f2b37eea07ed9083c7daf40f34553f6fccd https://linear.app/companyname/issue/AAA-111/the-name-of-the-ticket
However if you run that command when the Linear app is already open, running the above does nothing.
I can run the above command without --application-mode
, but that just opens the URL in a new browser window, and if I run that again, it just opens yet another browser window :-(
I'm hoping that there's some API available to let me say "hey browser window that's already open, go here: https://...". If I can't do this via the command line, maybe dbus can do it? I have no idea, but I'm hoping the SO community does. Worst case scenario I suppose I could find and kill any running instance of the app in question and re-launch it, but that's obviously not ideal.