My primary tool on my Debian box (asides from emacs) is gnome-terminal. I use mutt for email, and irssi for irc.
And since I'm an avid user of Spotify, and trade links to music with my friends and collegues, I've been irritated about the fact that I cant click on Spotify URIs in the terminal like I can with mailto: and http: tags.
So I fixed it. Its a rather simple fix, but very useful. Here's how I did it. Oh and btw, since Lenny's version of gnome-terminal is rather old, this fix works only on gnome-terminal version 2.22.3- the version which comes with Lenny.
Anyway, quick summary of what we'll do. We download the source for gnome-terminal, apply a little patch to it, compile the code, and register the spotify: URI with gnome.
- Download and unpack the source code
$ wget http://ftp.acc.umu.se/pub/gnome/sources/gnome-terminal/2.22/gnome-terminal-2.22.3.tar.gz
$ tar zxvf gnome-terminal-2.22.3.tar.gz
$ cd gnome-terminal-2.22.3/
- Apply patch
$ cat > gnome-terminal-spotify.diff <<EOF
87c87,88
< FLAVOR_EMAIL
---
> FLAVOR_EMAIL,
> FLAVOR_SPOTIFY
314c315
< #define SCHEME "(news:|telnet:|nntp:|file:/|https?:|ftps?:|webcal:)"
---
> #define SCHEME "(news:|telnet:|nntp:|file:/|https?:|ftps?:|webcal:|spotify:)"
332a334,337
> "\\<(spotify:)[^<>\ \t\n\r]*\\>",
> FLAVOR_SPOTIFY);
>
> terminal_widget_match_add (screen->priv->term,
1438a1444,1446
> case FLAVOR_SPOTIFY:
> url = g_strdup (orig_url);
> break;
EOF
$ patch src/terminal-screen.c gnome-terminal-spotify.diff
- Compile the code
$ ./configure
$ make
$ sudo make install
- Register the spotify: URI
$ gconftool-2 --set --type=string /desktop/gnome/url-handlers/spotify/command " wine 'c:\Program Files\Spotify\Spotify.exe' '-uri' '%s'"
$ gconftool-2 --set --type=bool /desktop/gnome/url-handlers/spotify/enabled true
$ gconftool-2 --set --type=bool /desktop/gnome/url-handlers/spotify/need-terminal false
Remember that all the different gnome-terminals run under the same process, so when testing you'll want to spawn one as a separate process:
/usr/local/bin/gnome-terminal --disable-factory
All done!