Sunday, November 22, 2009

Use Urlview with Mutt on Mac OS X

Urlview is a simple command line program that extracts urls from a text document. You can easily invoke your web-browser from Mutt to follow hyperlinks in your email.

If you use Linux, you can easily get urlview from your favorite package manger, but not on Mac Os X. However, there exists another version of urlview written in a ruby script. It is simple and safe (not written in C)

You can download a copy from this url.

Here is the Easiest way to use the urlview script with mutt on your Mac OS X.
  1. Download urlview (the ruby version) from here.
  2. Modify the file of line 26, from "BROWSER='firefox'" to "BROWSER='open'"
  3. Comment out the line 31 : $stdin.reopen 'COM1:'
  4. sudo chmod +x ~/Download/urlview.rb
  5. sudo mv ~/Download/urlview.rb /usr/bin
  6. Add the following lines in your muttrc.
    (Note that the macro is binded with f4 key. You can change it to whatever you want.)
    macro index "<f4>" "<pipe-message>urlview.rb<enter>" #URLviewer
    macro pager "<f4>" "<pipe-message>urlview.rb<enter>" #URLviewer
Now you can easily browse any web links from Mutt on Mac.

No comments:

Post a Comment

About

My photo
Hi, I am a PhD candidate at CMU. I was one of the founding members of PPP (Plaid Parliament of Pwning). I like programming in OCaml, F#, Haskell, and C++.