Firefox did not have to prevent this site from opening a pop-up window.

A Quick Guide to Lynx

Date/Time Permalink: 03/29/10 07:12:14 pm
Category: HOWTOs and Guides

Who on Earth would bother to use a text-only web browser in 2010? Actually, it's one of the important tools in the accessibility toolkit for the disabled, being easily coupled with a screen reader. And OK, for those times when you have graphics-card problems. But when else? I could go on all day about the times when Lynx comes in handy:

  • Best for viewing hyperactive websites. No Flash, no Javascript, no blinking, flashing ads, no bother.
  • Best for fast browsing. Sometimes its important to get in, get the key piece of data you need, and get out.
  • Browsing a guide when you're playing a game. The game runs fullscreen, but you're stuck, can't save, and need to look up the game guide? Just Ctrl-Alt-F2 to the console and look it up in Lynx.
  • Can be scripted. For instance, to search for the term "bash script", "lynx -dump 'http://www.google.com/search?q=bash+script'" will dump the results page right to the command line. Use this power only for good and not evil.
  • Best to check for web page errors. What counts for search engine spiders is how they see the text. Viewing your site in Lynx tells you exactly what the search engine sees.

Now then, Lynx out of the box is somewhat annoying. You can change its default behavior in "lynx.cfg", a file found lurking in places like /etc/lynx-cur/lynx.cfg. You can either copy this to your home directory for just one user's preferences, or go root and edit it for the whole system.

lynx.cfg is huge, but well-documented. Here's the changes I find most useful; these are a matter of preference, so alter them to taste:

STARTFILE:http://www.google.com/
(This is your 'home page', what Lynx goes to automatically on start-up.)

DEFAULT_INDEX_FILE:http://penguinpetes.com/
(This can be your alternate home page, the page you go to when you hit 'I' for index.)

SAVE_SPACE:~/Downloads/
(This sets the directory to save all downloaded files to.)

SHOW_CURSOR:TRUE
(Having the cursor blinking and visible helps with navigating through a document.)

SCROLLBAR:TRUE
SCROLLBAR_ARROW:TRUE
USE_MOUSE:TRUE
(Interesting mouse usage and scrolling options, for the keyboard-averse. A curses-drawn scrollbar and arrow set appears to the right; if you have enabled console-mouse support, this will work just like a GUI. Although it's still slower than just using the keyboard.)

SET_COOKIES:TRUE
ACCEPT_ALL_COOKIES:TRUE
PERSISTENT_COOKIES:TRUE
COOKIE_FILE:~/.lynx_cookies
(This will make it quit bothering you with all those micromanaging cookie details!)

DEFAULT_BOOKMARK_FILE:.lynx_bookmarks.html
(See what I did there? I put a dot in front of the file so it's hidden. No need to look at it in my home directory.)

DEFAULT_USER_MODE:ADVANCED
(This will make it work more like a normal browser, eliminating the two lines of help, and showing the current page or link URL in the status bar.)

By the way, you use the cursor-arrow keys to move the pointer around (the cursor will hop from hyperlink to hyperlink). The number-pad's 'Ins' and 'del' scrolls the whole page up and down.

Ancient Chinee Secret!

Follow me on Twitter for an update every time this blog gets a post.
Stumble it Reddit this share on Facebook

suddenly the moon