xfce, chrome and deluge

Recently I switched from KDE to Xfce. The increase in speed is well worth the change. I like to have things look and work exactly was I want and I was able to customise and tweak Xfce to my requirements within a couple of hours.

Even before I made the move to Xfce I was having trouble getting Chrome to open magnet links. Chrome passes processing of magnet links off to xdg-open which was refusing to read the .desktop files and mime settings I had to have them open in deluge (or any other torrent app that was not transmission).

xdg-open would hand control to exo-open which would in turn open a new chrome window/tab to handle the magnet link.

After much frustration I decided to modify xdg-open. I modified the open_xfce() function to loook for a magnet URL and process it BEFORE I handed it off elsewhere.

I changed the open_xfce function to:

open_xfce()

{

if(echo "$1" | grep -q '^magnet:'); then

deluge "$1"

if [ $? -eq 0 ]; then

exit_success

fi

fi

exo-open "$1"

if [ $? -eq 0 ]; then

exit_success

else

exit_failure_operation_failed

fi

}

All is now well. magnet links in chrome now open successfully in deluge.