Archive

Posts Tagged ‘irssi’

Click URLs In URxvt

October 15th, 2008 No comments

Most terminals these days have the ability to click on a URL and then it opens in your browser. Needless to say some terminals aren’t as simple to setup as others. I commonly use URxvt and initially didn’t think that it was possible to do. However URxvt has a rather nice Perl plug-in which expands its range of abilities. So to setup, edit or create ~/.Xdefaults and add these lines to it:

urxvt*urlLauncher:  firefox
urxvt*matcher.button:  1
urxvt*perl-ext-common:  default,matcher,searchable-scrollback
urxvt.matcher.pattern.1:  \\bwww\\.[\\w-]\\.[\\w./?&@#-]*[\\w/-]

Now you need to make this work:

# xrdb -merge ~/.Xdefaults

You may need to add this command to ~/.xinitrc or whatever startup script that your desktop uses. Most systems should automatically load it when your X starts.

Whilst I chose to use firefox as the browser you can set it to any other browser, indeed if you are using Gnome a trick to use the default browser is:

urxvt*urlLauncher:  gnome-open

This is actually rather handy because you can click on a variety of links not just web ones and it will open the correct tool for those links. Thanks to Nion’s blog I found out that you can colour the URLs too! Finally to those that wish to be mouseless, how about Bart’s blog for an awesome example of the abilities of URxvt!

Tags: , ,