Use Lynx Browser with Image Support in X11 for Fast Low Bandwidth Web Browsing

Feb 22, 2013 - 12 Comments

Longtime command line users are probably familiar with the text based web browser lynx, which strips down the web to text-only format and allows for super-fast web browsing. But lynx (links, technically) can be compiled to support graphics and run within x11, which creates a highly effective web browser for low-bandwidth situations because it strips all formatting, css, javascript, flash, java, ads, and ajax from web sites, all you get is standard html with images, with everything loading lightning fast. Here is what the Google home page looks like in Lynx running in X11 with image support:

Lynx x11 with graphic support

To get Lynx running in X11 with support for images, you’ll need Xcode (or at least gcc) and Xquartz to be installed, plus the links source to compile:

Though it’d be best to have some experience with compiling and using the command line, if you don’t we’ll walk through each necessary command to get this working:

Change to the directory which you downloaded links (let’s assume ~/Desktop/)
cd ~/Desktop

Uncompress links with tar
tar -xvf links-2.7.tar.gz

Change to the newly created directory:
cd links-2.7/

Configure links to support common image formats, rendering, x11, graphics, and openssl:

./configure --x-includes=/usr/include/X11/ --x-libraries=/usr/X11/lib/ --enable-graphics --with-ssl=openssl

You’ll see a ton of config checks scroll by, and at the bottom you should see something like the following:

Configuration results:
IPv6: YES
Supported compression: ZLIB BZIP2
SSL support: OPENSSL
UTF-8 terminal: YES
GPM support: NO
Graphics enabled: YES
Graphics drivers: X
Image formats: GIF PNG XBM JPEG TIFF

The key thing to look for is the “Graphics Enabled” and support of image formats, this is what allows you to still view images on the web.

Now you just need to compile and install links:

sudo make install

Once installed you can now use links either in text-only mode, or better yet, with graphics support by running it within X11. Note that if you installed X11 in this process, you may need to log in and out first before X11 will function properly.

Launch links with graphic support in x11 by using the -g flag:

links -g http://osxdaily.com

You’ll now have lynx running in x11 with image support:

Lynx browser in X11 with image support

Obviously no web pages look particularly great in this format, but that’s not the point, the point is a low bandwidth experience that is very fast to use, not a fancy web browser:

Text-based web browser Lynx in X11 with Images

Pictures only show so much, the brief video below shows what it’s like to browse the web with X11 Lynx built with graphic support:

Lynx does not use the mouse cursor to navigate, everything is handled by the keyboard.

Basic Lynx Navigation Shortcuts

Using lynx in X11 with image support is basically the same as the command line. Here are a few essential lynx keyboard shortcuts to get around.

  • Up & Down arrows to navigate page content and on page links
  • Left arrow to move back a page
  • Right arrow to follow highlighted link (same as Enter)
  • Page Up & Page Down to navigate full webpage screen at a time
  • Return key to follow links
  • G to go to a new URL
  • Control-R to refresh
  • / to search

Lynx browser in X11

Finally, let’s make a few shortcuts to speed up launching X11 Lynx:

Create a X11 Applications Menu Shortcut for GUI Lynx

  • Pull down the X11 “Applications” menu and choose “Customize”
  • Click “Add Item” and under “Command” fill in “links -g” and under “Name” put something like ‘LynxGUI’
  • Close the Customize window and find the short link under the X11 Application menu

Create a Command Line Alias for GUI Lynx

  • Open .bash_profile and place something like the following as an alias:
  • alias linksgui='links -g http://osxdaily.com &'

  • Now you can type “linksgui” at the command line to quickly launch links in X11 too

X11 Lynx shortcut

Enjoy your new super-fast low bandwidth web experience.

This article is obviously geared towards Mac users and OS X, but lynx can also be compiled with x11 support within linux too. Ditch the Xcode and Xquartz portion of the walkthrough and the config is otherwise identical.

Alternatively: Use MacPorts to Install Links with X11 & Image Support

For those who have MacPorts installed, the installation process is even easier and can be done in just four simple commands:

$ sudo port -v install xorg-server
$ sudo port -v install links +x11
$ /opt/local/bin/startx &
$ links -g

Thanks to Eric for the original submission and great tip idea, and thanks to Tyson W for the macports trick by way of Facebook!

Enjoy this tip? Subscribe to the OSXDaily newsletter to get more of our great Apple tips, tricks, and important news delivered to your inbox! Enter your email address below:

Related articles:

Posted by: Paul Horowitz in Command Line, Mac OS X, Tips & Tricks

12 Comments

» Comments RSS Feed

  1. David M says:

    Nice tip! Not to be pedantic, but Links split from Lynx, so though everyone knows the name “lynx” this is technically “Links”.

    Not that anyone will care ;)

  2. peter says:

    For anyone who doesn’t want to deal with the Xcode overhang and compiling, Lynxlet makes it super simple to install Lynx on the Mac. Free, of course.

    http://habilis.net/lynxlet/

  3. Eliot says:

    The names Lynx and Links can’t be used interchangeably. Other than both being web browsers and homophones, they’re unrelated.

  4. Theo Vosse says:

    I guess you can get the same speed and low bandwidth by disabling Javascript (which usually triggers more loading) and blocking flash and videos. Firefox can do that with one or two plugins, and will still render the rest of the page correctly.

    • Stian says:

      Yepp! Make a keyboard shortcut to enable/disable javascript. I use it all the time, huge differanse in cpu usage. Specially when opening many tabs at the same time.

  5. voji91 says:

    hi thanks for this post.
    i get this error after “./configure –x-includes=/usr/include/X11/ –x-libraries=/usr/X11/lib/ –enable-graphics –with-ssl=openssl” :

    configure: error: You need libpng to compile Links in graphics mode

    • voji91 says:

      i installed that libpng thing and now this error :

      configure: error: No graphics drivers found.

      • Jean Rikly says:

        Hello, I got the same problem on my iMac. Then I try to install on my MacBook Pro and it’s works. I copy the libraries from /opt/local/lib and I copy all the *.dylib in the same folder to my iMac. Then I compile and now it’s works

    • Noor says:

      I also got “You need libpng to compile Links in graphics mode” error. What would be next steps?

  6. glhmedic says:

    I get this message when I run config command

    ding cache ./config.cache
    checking for a BSD compatible install… /usr/bin/install -c
    checking whether build environment is sane… yes
    checking whether make sets ${MAKE}… no
    checking for working aclocal… missing
    checking for working autoconf… missing
    checking for working automake… missing
    checking for working autoheader… missing
    checking for working makeinfo… found
    checking for gcc… no
    checking for cc… no
    Then I run “sudo make install” and get this:

    sudo: make: command not found

    so what gives??

  7. Adam Nelson says:

    Use homebrew for installing these options. Never do manual making and compilation when the recipe is available via brew: http://brew.sh/

Leave a Reply

 

Shop for Apple & Mac Deals on Amazon.com

Subscribe to OSXDaily

Subscribe to RSS Subscribe to Twitter Feed Follow on Facebook Subscribe to eMail Updates