2

Chromium browser opens a new window instead of handling magnet links or APT links. I tried to look around and found How to tell Chrome what to do with a magnet link? but it doesn’t work for me. I ran : xdg-mime default deluge.desktop x-scheme-handler/magnet but nothing changed.

xdg-mime query default x-scheme-handler/magnet returns deluge.desktop.

And I made sure the name is right.

I'm using Lubuntu 14.04 [lxde]

  • Problem solved for both APT and Magnets, look below. I answered my own question >.> – Kyodo Apr 26 '14 at 0:20
3

Make Chromium or Chrome to open magnet links in LXDE

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 instead:

#--------------------------------------
# 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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.