Double-click .torrent to add to remote Transmission client

This was written for Linux Mint 20.1 running Cinnamon.

My Transmission torrents client runs as a docker on my unRAID server in my basement. Rather than loading up the web interface and manually uploading a downloaded torrent it is handy to do be able to double-click and have the file added automatically.

First we need to install the local Transmission CLI tools.

1
sudo apt-get install transmission-cli

Then add this add_torrent.sh script to /usr/local/bin:

1
2
3
4
#!/bin/bash

/usr/bin/transmission-remote [transmission-server] -a "$1" \
&& /usr/bin/notify-send -i server "Torrent Added!" "$1"

Super simple but you will need to specify your Transmission server. This will add the file to the remote client and then show a notification if the command was successful.

To associate this command with a .torrent file, find your file in the file browser, right-click and select Open-with => Other application. Then type /usr/local/bin/add_torrent.sh into the bottom text field and click Add to list.