Recentemente tenho tido problemas ao abrir magnet links no
Chrome, pois este abria uma nova janela ao invés de abrir o programa para torrent, que no meu caso é o
Deluge.
Consegui fazer funcionar da seguinte maneira, no arquivo
/usr/bin/xdg-open há o seguinte trecho de código:
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
}
Aparentemente ele não consegue encontrar seu DE (Desktop Environment), então dê isso de bandeja à ele, deixando o código desta forma:
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=xfce;
}
Bom, depois de ter feito este procedimento que achei no Google, o Chrome passou a abrir o Deluge para links magnéticos.
NOTA: no meu caso que uso o Xubuntu o DE é xfce, no Ubuntu o DE é o Unity, que talvez use o DE generic no arquivo e assim sucessivamente.
Como trocar o programa com a qual o Chrome ira abrir o link magnético:
Nenhum comentário foi encontrado.