Kompx.com or Compmiscellanea.com

ELinks. Configuration

Operating systems : Windows, Linux

Jump to:

ELinks - Text-based or console web browser. Description: features, screenshots, download links.

ELinks. Use - How to use ELinks.


What ELinks can and what can not, i.e. what may be configured depends on several things. The most common are capability of the console it is run on and support of what was chosen during the compilation process of an ELinks browser source code. Under certain operating systems (Windows for instance) it is easier and more reliable to omit some possible features.

The configuration of ELinks 0.12pre2 from Package Database of Zenwalk Linux (originally based on Slackware, still keeping compatibility with its binary packages) is discussed here. It is quite representative in its qualities among other Linux ELinks browser versions for desktop PC computers. User interface of Windows ELinks and that of Linux / some other *nix systems ELinks of comparable versions are the same. If an ELinks package has been compiled without some feature or the console is not capable of something then it just will not be possible to choose the feature in the configuration process; or possible, but it will not work. For example, if this ELinks is compiled without support of 256 colors or your console is not capable of displaying them, then it just will only be possible to choose 16 or "No colors (mono)" in the menu. And the ELinks will work as much well in the rest.

The whole configuration of ELinks may be done through the menu of the browser - there is no need to edit config files. Even if some fine-tuning may require editing of elinks.conf or even source code files - but that is not the issue for average use.

The menu of ELinks is hidden when it is displaying a web page:

[ Image ] : ELinks - 1

To access the menu, press Esc on the keyboard:

[ Image ] : ELinks - 2

Configuration options are in "Setup" group:

[ Image ] : ELinks - 3

1 ) "Language" - set a language of ELinks user interface. It is possible to set it to the system language or to several others. System and terminal emulator / console have to be prepared for this change - corresponding localization / internationalization files installed and configured. Choose a language (English in this example):

[ Image ] : ELinks - 4

To keep it, press Esc again, then Setup, then Save options, then confirm by clicking OK. It is also possible to choose for Do not show anymore, but when OK is used, the path to the config file of ELinks (elinks.conf) is shown - that maybe useful:

[ Image ] : ELinks - 5 [ Image ] : ELinks - 6

This mode of action is used across the whole configuration process of ELinks web browser: Esc - to access the menu, Setup - to access configuration options, browsing through the lists to find the option, hitting the option chosen, then again Esc, Setup, Save options and clicking OK.

Esc --> Setup --> <option> - to select an option.

Esc --> Setup --> Save options --> OK - to confirm it.

2 ) "Character set" - choose what character encoding is to be used when displaying text of web pages. System and terminal emulator / console have to be prepared for some options to work. Try it by experimenting with web document texts in languages other then English. Unicode UTF-8 is used in this example.

Esc --> Setup --> Character set --> Unicode UTF-8 - to select Unicode UTF-8 character encoding.

Esc --> Setup --> Save options --> OK - to confirm it.

3 ) "Terminal options" - several options concerning terminal emulator / console characteristics. Ordinarily, it is enough to make changes in "Color mode" - how many colors are to be used by ELinks browser displaying text in web pages. ELinks can employ up to 256, but in practice it depends on terminal emulator / console capabilities. ELinks web browser and GNOME Terminal used here are capable of 16 colors or "No colors (mono)".

Esc --> Setup --> Terminal options --> 16 colors or "No colors (mono)" in Color mode section - to select how many colors are to be used by ELinks.

Esc --> Setup --> Save options --> OK - to confirm it.

4 ) "Options manager" - it contains all the rest options possible to set. They are quite numerous, many of the options are self-explanatory, so just some of them are discussed:

URI passing - Passing a URI to an external application when running ELinks in a terminal emulator. The most obvious possibilities are another browser and clipboard. There are two options: passing the URI of the web page ELinks is displaying at the moment or passing the URI of a highlighted link in a web page. Since passing a URI to clipboard is the most multipurpose - like URI may be taken from clipboard and put into a browser address bar, so ending up to be opened in another web browser anyway - it is this variant that explained further on.

First, xclip has to be installed. If the system does not have it already, download and install xclip: source code download page or look for xclip in the repository of your Linux distribution.

Esc --> Setup --> Options manager --> Document --> [ press Space bar to open options ] --> URI passing --> Add --> [ Enter a name for the action. Here "Clipboard" is used ] --> OK --> Edit --> [ Enter a value: echo -n %c | xclip -i ] --> OK --> Save --> OK

The process is done by keyboard shortcuts, so now a keystroke sequence must be assigned. Keyboard shortcut may be any combination starting with Shift, Ctrl or Alt. Here Alt-p for passing the URI of the web page ELinks is displaying at the moment and Alt-l for the URI of a link chosen in a web page are used.

For passing the URI of the web page ELinks is displaying at the moment to clipboard ( N.B. "Pass URI of current tab to external command" option may be displayed under the name of "tab-external-command". This is handled by Toggle display ):

Esc --> Setup --> Keybinding manager --> Main mapping --> [ press Space bar to open options ] --> Pass URI of current tab to external command --> Add --> [ Enter a keystroke sequence: Alt-p ] --> OK --> Save --> OK

For passing the URI of a highlighted link in a web page to clipboard ( N.B. "Pass URI of current link to external command" option may be displayed under the name of "link-external-command". This is handled by Toggle display ):

Esc --> Setup --> Keybinding manager --> Main mapping --> [ press Space bar to open options ] --> Pass URI of current link to external command --> Add --> [ Enter a keystroke sequence: Alt-l ] --> OK --> Save --> OK

If there is a need to use more common Ctrl-V shortcut for pasting from clipboard to GUI applications - not clicking mouse wheel or middle mouse button - put "echo -n %c | xclip -i -selection clipboard" instead of "echo -n %c | xclip -i".

External Editor - If ELinks is compiled with external editor support, it is possible to use an external editor for handling textarea of forms more conveniently. A GUI editor also may be used when in a X environment:

Esc --> Setup --> Options manager --> Document --> [ press Space bar to open options ] --> Browsing --> [ press Space bar to open options ] --> Forms --> [ press Space bar to open options ] --> External editor --> Edit --> [ Enter a value: geany ] --> OK --> Save --> OK

If value of "External editor" is left blank, ELinks will use the value of the $EDITOR variable of the environment. If $EDITOR is not set or empty, then it will fall to vi editor.

Default download directory - Setting the directory ELinks saves files to. May be any, for instance a common directory for all downloads and savings. Or home directory of the user, so that it is faster to add a required folder to it in the "Download" dialogue box:

Esc --> Setup --> Options manager --> Document --> [ press Space bar to open options ] --> Downloading --> [ press Space bar to open options ] --> Default download directory --> Edit --> [ Enter a value: /home/user1 ] --> OK --> Save --> OK

Set original time - Setting or not the timestamp of the downloaded / saved file to be the same as when the file was on the server it is downloaded / saved from. "1" for setting, "0" - for not:

Esc --> Setup --> Options manager --> Document --> [ press Space bar to open options ] --> Downloading --> [ press Space bar to open options ] --> Set original time --> Edit --> [ Enter a value: 1 ] --> OK --> Save --> OK

Prevent overwriting - When ELinks saves / downloads a file which happens to be the same as there already is, it can overwrite it without notice, ask what to do or automatically add a certain suffix to it: ".[number]". ELinks adds the ".[number]" not to the name of a file, but rather to its extension, like a.rar downloaded second time to the same folder with a.rar there becomes a.rar.1. The value of "0" is for files to be silently overwritten, "1" for the suffix of ".[number]" to be added. And "2" for "ask the user" for what to do - the options will be either to "Save under the alternative name" (adds the aforementioned suffix of ".[number]") or "Overwrite the original file" or "Resume download of the original file":

Esc --> Setup --> Options manager --> Document --> [ press Space bar to open options ] --> Downloading --> [ press Space bar to open options ] --> Prevent overwriting --> Edit --> [ Enter a value: 2 ] --> OK --> Save --> OK

Notify download completion by bell - Since ELinks can download files in background, with the download dialogue box hidden out of sight it may be convenient to be informed when download is complete. If notification by beeper is selected, there are two options: get audio notification when the way of "Background with notify" in the download dialogue is chosen or always get audio notification:

Esc --> Setup --> Options manager --> Document --> [ press Space bar to open options ] --> Downloading --> [ press Space bar to open options ] --> Notify download completion by bell --> Edit --> [ Enter a value: 2 ] --> OK --> Save --> OK

Clock - Displaying a digital clock in the status bar of ELinks. The value of "1" is to enable:

Esc --> Setup --> Options manager --> User interface --> [ press Space bar to open options ] --> Clock --> [ press Space bar to open options ] --> Enable --> Edit --> [ Enter a value: 1 ] --> OK --> Save --> OK

It is also possible to set the format of the digital clock. See strftime docs for details.


Aliosque subditos et thema

 

Renaming folders in DOS

 

Renaming a folder in DOS by MOVE command: MOVE FOLDER1 FOLDER2 - Renames FOLDER1 into FOLDER2 The method works in Windows command prompt as well. [ 1 ] MS-DOS 6.0+ tested - but it also may happen to work well under other versions of MS-DOS or other DOS'es.

Lynx browser. Creating sitemap.xml

 

There are more than few online services for sitemap.xml generation. But it is also possible to do it yourself, by means of lynx web browser and several Linux command line utilities. An example bash script employing them, named "sitemap.sh" is described below. Bash script creating a sitemap.xml file: #!/bin/bash cd /home/me/sitemap/www/ lynx -crawl -traversal -accept_all_cookies -connect_timeout=30 http://www.compmiscellanea.com/ > /dev/null cd /home/me/sitemap/www2/ lynx -crawl -traversal -accept_all_cookies -connect_timeout=30 http://compmiscellanea.com/ > /dev/null cat /home/me/sitemap/www2/traverse.dat >> /home/me/sitemap/www/traverse.dat cat /home/me/sitemap/www/traverse.dat | sed -e 's/\<www\>\.//g' | sort | uniq > /home/me/sitemap/sitemap/sitemap.xml sed -i 's/\&/\&amp\;/g' /home/me/sitemap/sitemap/sitemap.xml sed -i "s/'/\&apos\;/g" /home/me/sitemap/sitemap/sitemap.xml sed -i 's/"/\&quot\;/g' /home/me/sitemap/sitemap/sitemap.xml sed -i 's/>/\&gt\;/g' /home/me/sitemap/sitemap/sitemap.xml sed -i 's/</\&lt\;/g' /home/me/sitemap/sitemap/sitemap.xml sed -i 's/http:\/\//http:\/\/www\./g' /home/me/sitemap/sitemap/sitemap.xml sed -i -e 's/^/<url><loc>/' /home/me/sitemap/sitemap/sitemap.xml sed -i -e 's/$/<\/loc><\/url>/' /home/me/sitemap/sitemap/sitemap.xml sed -i -e '1 i <?xml version="1\.0" encoding="UTF-8"?>\r\r<urlset xmlns="http:\/\/www\.sitemaps\.org\/schemas\/sitemap\/0\.9" xmlns:xsi="http:\/\/www\.w3\.org\/2001\/XMLSchema-instance" xsi:schemaLocation="http:\/\/www\.sitemaps\.org\/schemas\/sitemap\/0\.9 http:\/\/www\.sitemaps\.org\/schemas\/sitemap\/0\.9\/sitemap\.xsd">\r\r<!-- created by sitemap.sh from http:\/\/www.compmiscellanea.com\/en\/lynx-browser-creating-sitemap.xml\.htm -->\r\r' /home/me/sitemap/sitemap/sitemap.xml sed -i -e '$ a \\r</urlset>' /home/me/sitemap/sitemap/sitemap.xml sed -i '/static/d' /home/me/sitemap/sitemap/sitemap.xml echo "...Done" After the bash script file is prepared: "chmod +x sitemap.sh" to make it executable. Download sitemap.sh in sitemap.sh.tar.gz archive ( After downloading and unpacking it, put a web site name with "www" instead of http://www.compmiscellanea.com/ and a web site name without "www" instead of http://compmiscellanea.com/ in the file. Replace "static" in the last line of the file by a string unnecessary links should possess to be removed. Then "chmod +x sitemap.sh". Then run sitemap.sh ). Commentary Download sitemap2.sh with line by line commentary in sitemap2.sh.tar.gz archive. Before running the bash script, three folders should be created. Since lynx browser may miss some links if a web site domain name to be crawled is put with or without "www", bash script runs lynx twice, crawling the web site by its name with "www" and crawling the web site by its name without "www". The two result files are put into two of these separate folders, here they are "/home/me/sitemap/www/" and "/home/me/sitemap/www2/". And "/home/me/sitemap/sitemap/" is for sitemap.xml created in the end. 1. Path to bash: #!/bin/bash 2. Going to a folder - lynx browser is going to put there the files obtained from crawling a web site with "www" in its name: cd /home/me/sitemap/www/ 3. Running lynx browser to crawl a web site.