Running the Last.fm player from your browser
From Helpful
Note: Newer versions of the last.fm player seem to handle this for you more automatically than at the time this was written.
In windows, the player is automatically launched when you click a lastfm:// link, apparently because browsers seem to hand unknown protocols to windows (though I don't know the details). If so, that's a fair reason it doesn't happen in linux: there's no always-present system that maps protocol to application. It doesn't really matter why as it's fixable with some tweaking.
Note, incidentally, that you can always drag the links from the browser to the player; there is no need to type the addresses.
Contents |
Firefox (linux, windows)
If you use firefox this isn't very hard:
- Surf to about:config (these are your firefox settings) and search (filter) for a key named network.protocol-handler.app.lastfm.
- If it doesn't yet exist, create it: Right-click anywhere in the config list, choose 'New' , the 'String' type, with network.protocol-handler.app.lastfm as the preference name.
- Its value should be the path to your player executable, eg. ~/Last.fm/player or /home/username/Last.fm/player.
You just created a handler for the lastfm:// protocol in firefox, which (re-)launches the executable with each lastfm:// URL, and the executable is smart enough to handle that. For those who play with LIRC or the likes: this means you can play with the last.fm player from the command line if you wish.
The first time you use a link like this, firefox will ask you "this is an external program, do you want me to keep on warning you about this?" the first time. It's safe enough to turn the warning off, at least in non-evil environments (technically trusting an application is bad security when that executable can be replaced with something bad, but that's sort of nitpicking).
In windows, the inseraller for the player sets up what you need. If it didn't work, or more likely, if you downloaded the .zip because you have a low-permission work setup, follow the above instructions, but use a windows-style path, like "C:\Program Files\Last.fm Player\player.exe".
KDE protocol handler
You can register the protocol in KDE, which makes it usable from most places, including Konqueror and the run dialog. this link in the Last.fm forums suggests creating a lastfm.protocol file in the relevant KDE directory.
Apparently this is /usr/kde/3.4/share/services/lastfm.protocol for me and for KDE version 3.4.
To be sure for your setup, do aPut the following in the file (or copy from another and alter):
[Protocol] exec=/path/to/Last.fm/player %u protocol=lastfm input=none output=none helper=true listing= reading=false writing=false makedir=false deleting=false
Of course changing the path to a real one.
GNOME protocol handler
You can do something similar in GNOME. The settings would be visibile in the Configuration Editor (System Tools) but you cannot add a protocol in the GUI, so you need to do it from the command line:
gconftool-2 -s /desktop/gnome/url-handlers/lastfm/enabled --type bool true gconftool-2 -s /desktop/gnome/url-handlers/lastfm/command --type string "/path/to/Last.fm/player %s" gconftool-2 -s /desktop/gnome/url-handlers/lastfm/needs_terminal --type bool false
(It is possible that you need to run gconftool instead of gconftool-2, this is some version deal. I don't know, I rarely use GNOME) Things like Galeon, Epiphany and other GNOME apps should be able to handle lastfm:// links now.
Other
Beats me what, but feel free to add. Probably some less usual browsers can still be added, or fixing a broken windows setup.

