How can I set yate to be my default tel: protocol handler?
Thanks to Ignacio Vazquez-Abrams for pointing me in the right direction with the mimetype handler.
I ended up creating a simple desktop entry to open links in Hangouts. I think the location for this will vary by distro, but for me this is what worked (I'm on Ubuntu GNOME 16.04). This just converts the tel:
number into a URL that tells hangouts to make a phone call, and lets xdg-open
handle it so it will open in your default browser.
~/.local/share/applications/mimeapps.list
[Added Associations]
x-scheme-handler/tel=hangouts.desktop
~/.local/share/applications/hangouts.desktop
#!/usr/bin/env xdg-open
[Desktop Entry]
Exec=bash -c 'xdg-open "https://hangouts.google.com/?action=chat&pn=${0//tel:/}"' %u
Terminal=false
Type=Application
To explain the code, it passes %u
(which will be the tel:
link) into an inline bash script as the $0
param. Then ${0//tel:/}
strips the tel:
from the front of it, leaving you with the number. That number then gets passed in to the hangouts URL.