views:

22

answers:

1

I've tried asking this question on the KDE development forum, but haven't received a satisfying answer so far.

I've developed a Python script for Amarok 1.4 which retrieves upcoming events for the currently playing artist and displays them in the context browser. The user can click each event to know more about it, but so far clicking takes him to another Amarok tab, in which he must then click another button to finally get the link to open in the external browser.

What I'd like to know is whether there is a way to open the link directly in the external browser.

A: 

I know nothing about Amarok, but in general you can spawn the platform's default web browser on a URL:

  • on modern open-source desktops (KDE, GNOME, Xfce) by spawning the xdg-open command;

  • on OS X with the open command;

  • on Windows with the built-in os.startfile method.

There is also the webbrowser module, but it will often pick the wrong browser and everything about it is outmoded and ugly.

bobince
I think I would still have to find a way to override Amarok's behaviour (or to intercept the event so to speak), but still, that's a lead. Thanks!
Anthony Labarre