There was a way to register URL protocol handlers with Gconf, which is now obsolete and there seems to be no way to do the same with DConf (or Gsettings, its recommended wrapper).
How do one properly register an URL protocol handlers since DConf?
Additionally, something looks strange to me (as I don't understand it), on my Ubuntu 12.04
apt:// should be handled by the
apturl command. It is so with my Opera browser, but only because I added this specific association using the browser's configuration facility. Otherwise, in the rest of the environment:
gnome-open apt://foo.baropens the Software Center.
gconf-editor, I see a key
/desktop/gnome/url-handlers/aptwhose value is
apturl "%s"and it's enabled. This configuration seems to be ignored, which is reasonably expected, as GConf is considered obsolete.
dconf-editor, I can't see anything related to URL handlers or protocols in
It looks a bit messy to my eyes (just teasing with this wording, nothing bad)
Side note: I'm looking for something which preferably works even when the full desktop environment is not loaded, like when running an i3wm session with only
gsettings-daemon (and other stuff unrelated to this case) loaded.
Another way to “register” a protocol handler is with
*.desktop files and their MIME-Type; e.g.
I found a
/usr/share/applications/ubuntu-software-center.desktop with this content:
[Desktop Entry] Name=Ubuntu Software Center GenericName=Software Center Comment=Lets you choose from thousands of applications available for Ubuntu Exec=/usr/bin/software-center %u Icon=softwarecenter Terminal=false Type=Application Categories=PackageManager;GTK;System;Settings; MimeType=application/x-deb;application/x-debian-package;x-scheme-handler/apt; StartupNotify=true X-Ubuntu-Gettext-Domain=software-center Keywords=Sources;PPA;Install;Uninstall;Remove;Purchase;Catalogue;Store;
This one explains why
gnome-open apt://foo.bar opens the Software Center instead of
So I installed this
[Desktop Entry] Encoding=UTF-8 Version=1.0 Type=Application Terminal=false Exec=/usr/bin/apturl %u Name=APT‑URL Comment=APT‑URL handler Icon= Categories=Application;Network; MimeType=x-scheme-handler/apt;
update-desktop-database and even after rebooting, both
gnome-open still do the same and ignore this user desktop file, which as usual with user desktop‑files, should override the one in
Maybe there is something special with desktop files specifying
x-scheme-handler MIME type and they are not handled the usual way.
The desktop‑file way does not answer the question.