Jump to content

Seamless magnet integration with Chome and Gnome


Platima

Recommended Posts

Hey everyone,

I spent a little bit getting this just right, so I thought I'd share it all with you. It's also cross-posted to the linux forum (40) too.

Script to accept magnet URIs. It trims the leading whitespace, uses wget to add the torrent, and fires up uTorrent Server in App mode:

#!/bin/bash
USERNAME=admin
PASSWORD=
HOST=127.0.0.1
PORT=8080
URL=$(echo -n "$@" | sed -e "s/^\ //g")
wget -q -O /dev/null --user="$USERNAME" --password="$PASSWORD" "http://$HOST:$PORT/gui/?action=add-url&s=$URL"
/opt/google/chrome/google-chrome "--app=http://$USERNAME:$PASSWORD@$HOST:$PORT/gui" &

Commands to add magnet handler to Gnome:

gconftool-2 --set --type=string /desktop/gnome/url-handlers/magnet/command '<path_to_script> %s'
gconftool-2 --set --type=bool /desktop/gnome/url-handlers/magnet/enabled true
gconftool-2 --set --type=bool /desktop/gnome/url-handlers/magnet/need-terminal false

Enjoy!

-Platima

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...