Running uTorrent under wine works pretty well in Linux. For a quick overview of installation, see this HowTo Ubuntu blog post. One problem with installing under wine is that file associations are not set correctly. This means that double-clicking a .torrent file or opening a .torrent link in your browser won’t automatically start uTorrent. Here’s how to solve that.
First, create a file called utorrent with the following content:
#!/bin/sh
if [ "$1" ]; then
torrent_file="Z:`echo $1 | sed 's/\//\\\/g'`"
env WINEPREFIX="/home/avery/.wine" wine \
"C:\\Program Files\\uTorrent\\uTorrent.exe" "$torrent_file"
else
env WINEPREFIX="/home/avery/.wine" wine \
"C:\\Program Files\\uTorrent\\uTorrent.exe"
fi
Replace /home/avery with the path to your home directory. Make sure to make the file executable:
$ chmod +x utorrent
This is the main script that we’ll start uTorrent with. Basically, if given a file path on the command line, it will transform it from a linux path to a wine path. /tmp/sample.torrent will become Z:\tmp\sample.torrent. The sed bit comes from an Ubuntu forums thread.
Next, we need to fix the .desktop file. It should be located at ~/.local/share/applications/wine/µTorrent.desktop and contain something like:
[Desktop Entry]
Name=µTorrent
Exec=env WINEPREFIX="/home/avery/.wine" wine \
"C:\\Program Files\\uTorrent\\uTorrent.exe"
Type=Application
StartupWMClass=Wine
Icon=6948_utorrent.0
Add the following two lines to the end of the file:
Categories=Network;FileTransfer;P2P MimeType=application/x-bittorrent
The first line makes uTorrent show up correctly in the GNOME menu system. The next associates uTorrent with the BitTorrent MIME type. Also, change the Exec line to:
Exec=/home/avery/bin/utorrent %f
Obviously, replace the path with wherever you put the utorrent script from above. The .desktop file should now contain:
[Desktop Entry] Name=µTorrent Exec=/home/avery/bin/utorrent %f Type=Application StartupWMClass=Wine Icon=6948_utorrent.0 Categories=Network;FileTransfer;P2P MimeType=application/x-bittorrent
To make uTorrent the default BitTorrent client, edit ~/.local/share/applications/defaults.list:
[Default Applications] application/x-bittorrent=µTorrent.desktop
This file might already exist, in which case you can just add the second line. Finally, we need to update GNOME’s file associations database:
$ update-desktop-database ~/.local/share/applications
Success:
Thank’s, awesome guide. This had been the only thing stopping me from using uTorrent.
Thanks so much! This works perfectly - and explained extremely well to make it very easy.
Thanks for the guide! But somehow this didn’t work for me. µTorrent is the deafault app, but gives error that the path is wrong. I’m pretty sure it’s because the script that changes the paths is not run, because when I edit µTorrent.desktop: Excec=/home/myusername/.. and put in a nonexisting file, I don’t get any error messages and µTorrent opens. Any ideas? I’m using µTorrent 1.8.2 on ubuntu 8.10.
Thanks for the guide! But somehow this didn’t work for me. µTorrent is the deafault app, but gives error that the path is wrong, and I’m pretty sure that it’s because the script that changes the paths is not run, because when I edit µTorrent.desktop: Excec=/home/myusername/.. and put in a nonexisting file, I don’t get any error messages and µTorrent opens. Any ideas? I’m using µTorrent 1.8.2 on ubuntu 8.10
Sorry, I just got it to work :( The problem was that Open With: had ubuntu.exe instead of ubuntu(default).
I got it to work, but with minor tweaking, I changed this line:
Exec=/home/avery/bin/utorrent %f
to:
Exec=/home/avery/utorrent %f
and then changed the avery to my username
Thanks for the help, all the other places I found just wanted me to use a native linux app, NONE OF WHICH worked as well, I never even tried Azaureus since it’s a resource hog.
Perfect!
I search for this. =)
Tks!
Awesome guide! Thanks!
Tip: Using global var $HOME on script “utorrent” make it generic, no need for change home path: “${HOME}/.wine”
Just so you know, some quirky things can happen with Ubuntu & WINE. I had to right click on the utorrent script file because of the missing sh extension & tell it to open it with it with bash because it was trying to load the script itself in wine & it’s other open with suggestions were text editors… So I had to use a custom command (bash) to get it to load the script correctly… Just something to watch out for…
thanks man
great guide
Awsome guide. Rewrote this into norwegian here:
http://hekta.org/~chriswil/blog/index.php/blog/show/Guide%3A-%C2%B5Torrent-som-standard-torrent-behandler.html
Worked like a charm
[...] стане това. За целта, съм ползвал информацията от този линк, като там се описва, как да се направи това за [...]