5

I am using qBitTorrent 5.0.4 but launching it from the AppImage.

How do I assign Magnet File links to this "app", as there is no "installed" version of qBitTorrent on the system.

Do I need to install qBitTorrent with apt-get (or whatever), associate it, then delete it using purge, or do I install it, associate it and leave it there?

The only reason I'm using the AppImage is that the version is later than the one you get by using apt-get (or whichever command you use to install it).

Thanks.

1 Answers1

5

Since you got an already working .desktop-file now, add the line

MimeType=application/x-bittorrent;x-scheme-handler/magnet;

and add a %U to your Exec=-line so it looks like

Exec=/Path/to/your/appimage %U

to your .desktop-file. After doing so, you need to update the mimeinfo cache (see the example below how to do so) to get magnet links associated with your appimage.

To get an icon for your .desktop-file you need to copy an icon from your appimage to a location of your choice (for example ~/.icons/) and specify the full path to the icon in the .desktop-file.

While qbittorrent is running, the appimage will be mounted in a hidden folder under /tmp, in my case the folder is /tmp/.mount_qbittoAdJGnK, the name might be slightly different in your system. Browse the directory to /tmp/.mount_qbittoAdJGnK/usr/share/icons and copy an icon from there. I tried the scalabe icon /tmp/.mount_qbittoAdJGnK/usr/share/icons/hicolor/scalable/apps/qbittorrent.svg which is working fine.


Here an example for my very basic .desktop-file stored under /home/mook/.local/share/applications/qbittorrent-5.0.4_x86_64.AppImage.desktop:

[Desktop Entry]
Exec=/home/mook/qbittorrent-5.0.4_x86_64.AppImage %U
MimeType=application/x-bittorrent;x-scheme-handler/magnet;
Name=qbittorrent-5.0.4_x86_64.AppImage
Type=Application
Icon=/home/mook/.icons/qbittorrent.svg
Categories=Network;FileTransfer;P2P;Qt;

After creating that file I needed to run update-desktop-database ~/.local/share/applications. If you stored your .desktop-file in /usr/share/applications run sudo update-desktop-database /usr/share/applications.

The output of gio mime x-scheme-handler/magnet is

~$ gio mime x-scheme-handler/magnet
Default application for “x-scheme-handler/magnet”: qbittorrent-5.0.4_x86_64.AppImage.desktop
Registered applications:
        qbittorrent-5.0.4_x86_64.AppImage.desktop
Recommended applications:
        qbittorrent-5.0.4_x86_64.AppImage.desktop

Clicking on a magnet-link in firefox results in

enter image description here

Clicking on `Choose Application leads to

enter image description here

Clicking on Open Link opens qbittorrent:

enter image description here

I also have the icon in my application launcher:

enter image description here

mook765
  • 18,644