Adding to what everyone said, Make sure you have no overlapping applications being used.
For example let us assume you want to change the default magnet link to use qbittorrent so you type
xdg-mime default org.qbittorrent.qBittorrent.desktop x-scheme-handler/magnet
But when you type this and check your current default magnet
xdg-mime query default x-scheme-handler/magnet
It shows some other application for example popcorntime.desktop which isn't what you want.
So to fix this:
Using a File manager, go to /usr/share/applications and find popcorntime.desktop
Right click it and then click properties.
Go to the Applications tab.
In the Supported file types: area, remove the Mimetype application/x-bittorrent
Then go ahead and click ok
Notice how when you open properties again and check, you find that nothing has changed and it went back to how it was.
But it actually got deleted for a second and got reconfigured, which is why now the command
xdg-mime default org.qbittorrent.qBittorrent.desktop x-scheme-handler/magnet
which was already set in mimeapps.list will get applied.
xdg-mime
(part ofxdg-utils
) is the best answer for working with (querying, configuring)xdg-open
. See also unix.stackexchange.com/questions/8793/…xdg-open
opening everything in Firefox, simply deleting~/.config/mimeapps.list
and restarting fxed it for me (in Ubuntu 20.04).