Set default program for magnet links in Ubuntu

First show the default magnet handler and all apps that are capable of opening magnet links:

gio mime x-scheme-handler/magnet
$ gio mime x-scheme-handler/magnet
Default application for “x-scheme-handler/magnet”: org.kde.ktorrent.desktop
Registered applications:
	org.kde.ktorrent.desktop
	transmission-gtk.desktop
	deluge.desktop
Recommended applications:
	org.kde.ktorrent.desktop
	transmission-gtk.desktop
	deluge.desktop

To set Deluge as the default program for magnet links,

gio mime x-scheme-handler/magnet deluge.desktop