Make Chromium or Chrome to open magnet links in LXDE

Been updated the post:  http://www.foresightlinux.se/make-chromium-to-open-magnet-links/

But here goes:

To make chromium to open magnet links, that most of the torrent sites uses. You need to open terminal and write

gconftool-2 -t string -s /desktop/gnome/url-handlers/magnet/command "transmission %s"
gconftool-2 -s /desktop/gnome/url-handlers/magnet/needs_terminal false -t bool
gconftool-2 -t bool -s /desktop/gnome/url-handlers/magnet/enabled true

Open xdg-open in desired text-editor

sudo medit /usr/bin/xdg-open

 

find the lines:

#--------------------------------------
# Checks for known desktop environments
# set variable DE to the desktop environments name, lowercase
detectDE()
{
 if [ x"$KDE_FULL_SESSION" = x"true" ]; then DE=kde;
 elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome;
 elif `dbus-send --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.GetNameOwner string:org.gnome.SessionManager > /dev/null 2>&1` ; then DE=gnome;
 elif xprop -root _DT_SAVE_MODE 2> /dev/null | grep ' = \"xfce4\"$' >/dev/null 2>&1; then DE=xfce;
 elif [ x"$DESKTOP_SESSION" == x"LXDE" ]; then DE=lxde;
 else DE=""
 fi
}

make it to look like this intead:

#--------------------------------------
# Checks for known desktop environments
# set variable DE to the desktop environments name, lowercase
detectDE()
{
# if [ x"$KDE_FULL_SESSION" = x"true" ]; then DE=kde;
# elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome;
# elif `dbus-send --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.GetNameOwner string:org.gnome.SessionManager > /dev/null 2>&1` ; then DE=gnome;
# elif xprop -root _DT_SAVE_MODE 2> /dev/null | grep ' = \"xfce4\"$' >/dev/null 2>&1; then DE=xfce;
# elif [ x"$DESKTOP_SESSION" == x"LXDE" ]; then DE=lxde;
# else DE=""
# fi
DE=gnome;
}

 

 This will probably work in Arch, Lubuntu, Mint and Fedora. Will work in other Linux OS that uses lxde as desktop environment. This isn’t a optimized hack, if you know another way that works as good as this, let me know.

Tags

You may also like...

  • http://www.splashportal.net Aubrey Bourke

    Hi,

    Just noticed your post now on using gconf-tool in LXDE. I am curious as to how this is possible. Doees gconf-tool work with LXDE? Or must you install GNOME for this functionality?

    Kind Regards
    Aubrey.

    • tforsman

      You need package called: GConf, might be gconf in arch and lubuntu.
      That package should be enough to make the changes in config files.

  • Lubuntu 12.04

    Thanks a million, this worked perfectly. :D

  • Tamas

    Thanks, this one worked fine for me. This is the only place I could find the proper solution. Appreciate!

    Tamas

  • http://none RDB

    Awesome! Solution that works. OK, one item I use deluge instead of transmission. All you have to do is substitute deluge for transmission in the terminal commands and it works. I’m running Linuxmint maya and had to install medit and gconf. Think I will make a screencast for the linuxmint people and reference this webpage if that is OK?

    • tforsman

      Great that it worked. You could change medit to any text editor, so you don’t need to install it. It’s ok to use gedit, mousepad or similar.
      And it’s all fine to reference to this page

  • Tod

    Thanks! Worked perfectly!

    Linux ubuntu 3.2.0-29-generic #46-Ubuntu SMP Fri Jul 27 17:03:23 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

  • Glock

    Thank You!!! Worked perfectly for me with qBittorrent in Lubuntu!!

    • Glock

      Just a comment…I found that this solution causes a problem. When you download a file with chrome and click it to open, it does not open the file but the folder that contains it. It’s not a big deal but it can be frustrating…

  • http://palmer640.tk Palmer

    Finally, something that works! Thank you so much.

  • Cosmo

    Thank you so much! I am a total newb to linux and i managed to make it work ;-)

    -Version-
    Kernel : Linux 3.2.0-23-generic (x86_64)
    Distribution : Linux Mint 13 Maya

    • Cosmo

      p.s. it didn’t cause any problems with opening downloaded files either !

  • http://gravatar.com/dvilcans Dāvis

    Thank you! Works like a charm on Lubuntu 12.10.

  • http://www.stockholmsofia.se/ Timo

    Well, it ALMOST worked ;-)
    I found out my problem was that the command gnome-open was missing. The fix was to install the package which contains this command, after that it worked perfect! Like this in Lubuntu 12.10:
    sudo apt-get install libgnome2-bin

    • Joe

      Word.

  • Sergio Pastor

    It works on Debian Squeeze with XFCE4 :)
    Thank you! It’s amazing :D
    I don’t use Transmission, but Deluge.
    Doesn’t matter… It works for Deluge too.

  • jo

    Worked for as well, thanks heaps

    Xubuntu 13.04 – XFCE 4.10 – Chromium

  • Máximo

    This works perfectly on Lubuntu 13.04, thanks

  • Guest

    It works, it works. Lubuntu 13.04 – Thank you very much!

  • scoobee

    A more targeted approach: After the line later in the file that just says detectDE
    put this:

    if (echo “$url” | grep -q ‘^magnet:’); then
    DE=gnome
    fi

Recommended sites

Ad Square

Latest Questions

Latest recipes added

Donation

Keep this site alive and motivate me to continue to write about Linux. Give a small donation from flattr or paypal. Feel free to donate for the work for Foresight.
Other ways to give a small amount, click on Donation.
Flattr this