Use Lynx Browser with Image Support in X11 for Fast Low Bandwidth Web Browsing
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:
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:
- Get Xcode from the App Store, or install GCC without the entire Xcode package by getting command line tools from the Apple Dev Center
- Get X11 with Xquartz and install it in OS X to be able to run X11 on the Mac if you haven’t done so yet
- Download the Links tar ball (direct link, currently version 2.7)
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 https://osxdaily.com
You’ll now have lynx running 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:
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
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:
- Now you can type “linksgui” at the command line to quickly launch links in X11 too
alias linksgui='links -g https://osxdaily.com &'
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!
I tried and installed, but it does not support jpeg and tiff, how to enable that, in your tutorial, your configure ends with jpeg and tiff image formats support, I tried, they do not have the 2 formats, I even tried installed libjpeg and libtiff, nothing works. How to fix the issue.
try to install and got an exeptional error during make:
Configuration results:
UTF-8 terminal: YES
GPM support: NO
SSL support: OPENSSL
Supported compression: ZLIB BZIP2 LZMA
Graphics enabled: YES
Graphics drivers: X
Image formats: GIF PNG XBM TIFF
———————————————————
links-2.7pre1 $ sudo make install
Password:
gcc -DHAVE_CONFIG_H -I. -I. -I. -I/usr/local/include -I/usr/include/X11/ -I/usr/local/Cellar/libpng/1.6.21/include/libpng16 -g -O2 -c af_unix.c
gcc -DHAVE_CONFIG_H -I. -I. -I. -I/usr/local/include -I/usr/include/X11/ -I/usr/local/Cellar/libpng/1.6.21/include/libpng16 -g -O2 -c auth.c
gcc -DHAVE_CONFIG_H -I. -I. -I. -I/usr/local/include -I/usr/include/X11/ -I/usr/local/Cellar/libpng/1.6.21/include/libpng16 -g -O2 -c bfu.c
gcc -DHAVE_CONFIG_H -I. -I. -I. -I/usr/local/include -I/usr/include/X11/ -I/usr/local/Cellar/libpng/1.6.21/include/libpng16 -g -O2 -c block.c
gcc -DHAVE_CONFIG_H -I. -I. -I. -I/usr/local/include -I/usr/include/X11/ -I/usr/local/Cellar/libpng/1.6.21/include/libpng16 -g -O2 -c bookmarks.c
gcc -DHAVE_CONFIG_H -I. -I. -I. -I/usr/local/include -I/usr/include/X11/ -I/usr/local/Cellar/libpng/1.6.21/include/libpng16 -g -O2 -c cache.c
gcc -DHAVE_CONFIG_H -I. -I. -I. -I/usr/local/include -I/usr/include/X11/ -I/usr/local/Cellar/libpng/1.6.21/include/libpng16 -g -O2 -c charsets.c
gcc -DHAVE_CONFIG_H -I. -I. -I. -I/usr/local/include -I/usr/include/X11/ -I/usr/local/Cellar/libpng/1.6.21/include/libpng16 -g -O2 -c compress.c
gcc -DHAVE_CONFIG_H -I. -I. -I. -I/usr/local/include -I/usr/include/X11/ -I/usr/local/Cellar/libpng/1.6.21/include/libpng16 -g -O2 -c connect.c
connect.c:187:23: error: incomplete definition of type ‘struct ssl_st’
if (c->no_tsl) c->ssl->options |= SSL_OP_NO_TLSv1;
~~~~~~^
/usr/local/include/openssl/ossl_typ.h:144:16: note: forward declaration of ‘struct ssl_st’
typedef struct ssl_st SSL;
^
connect.c:391:24: error: incomplete definition of type ‘struct ssl_st’
if (c->no_tsl) c->ssl->options |= SSL_OP_NO_TLSv1;
~~~~~~^
/usr/local/include/openssl/ossl_typ.h:144:16: note: forward declaration of ‘struct ssl_st’
typedef struct ssl_st SSL;
^
2 errors generated.
make: *** [connect.o] Error 1
any idea
st
Facing this same issue:
“`
incomplete definition of type ‘struct ssl_st’
if (c->no_tsl) c->ssl->options |= SSL_OP_NO_TLSv1;
“`
it seems the use of SSL has changed without backward compatibility. It’s a pain. I hate that.
It should be possible to comment out this line in the program in case we know c->no_tsl is false in order to compile, or always use SSL_OP_NO_TLSv1 in all cases. But if we want TLSv1 then we are skrewed, I guess.
Do you really really need the version 1 of TLS, for some reason?
Use homebrew for installing these options. Never do manual making and compilation when the recipe is available via brew: http://brew.sh/
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??
You need to install Xcode or gcc from command line tools first
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
i installed that libpng thing and now this error :
configure: error: No graphics drivers found.
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
With the new XQuartz, /opt/X11 is used instead of /usr/lib etc. I tried /opt, it works.
I also got “You need libpng to compile Links in graphics mode” error. What would be next steps?
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.
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.
The names Lynx and Links can’t be used interchangeably. Other than both being web browsers and homophones, they’re unrelated.
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/
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 ;)