Monday, March 3, 2008

URL Highlighting in rxvt-unicode

urxvt is a lightweight X terminal emulator, with Unicode support. I use it instead of gnome-terminal for various reasons - none of these are important enough to mention here.

urxvt can be extended with perl, and one of the extension scripts that ship with it on Debian does URL highlighting - any text on the console window that looks like a URL is underlined, and can be opened in a browser by clicking on it. I saw this first in gnome-terminal, and was surprised - apart for being rather useful, it's an example of (original) thinking applied to an old concept.

In order to activate this feature add the following lines to ~/.Xdefaults

URxvt*perl-ext-common: default,matcher
URxvt*matcher.button: 3
URxvt*urlLauncher: x-www-browser

This will cause URLs to be underlined, and clicking mouse button 3 (left right-click on a normal right-handed mouse) while the pointer hovers over it will launch x-www-browser (which is setup as iceweasel on my box).

[24 Jun. 2008] UPDATE: I just found out that GPM doesn't work in urxvt if the URL matcher Perl extension is enabled. I can live with that - can you?

No comments:

Post a Comment