I have a script that I have written that I would like to use whenever I click on a mailto: link. Which means I need to select it as the default Mail handler in my default applications.
But how do I register a mailto handler so that I can select it in the default applications?
Using Ubuntu 18.04, not virtualized.
I am not using a specific mail application, I am trying to write a script that will process the mailto links for me (for example, using different mail clients for different destination domains), but I need to convince Ubuntu that this script is an option for a default mail application
Thanks to @danzel, I found the answer was indeed to use a .desktop file.
So I created a simple script that allows you to specify a set of different mailers - I use my work email (Outlook for web), my personal email (via ssh) and sometimes gmail.
Here's the code:
And the mailto.desktop which goes in /usr/share/applications:
I have "Terminal=true" because I use ssh, and that's where the ssh window goes, otherwise the terminal window disappears pretty quick. If you don't use any terminal based mailers you can set that to false.