Difference between revisions of "ELinks"

From ArchWiki
Jump to: navigation, search
m (ELinks froze and i can't start it without it freezing again: Capitalized the I)
 
(33 intermediate revisions by 10 users not shown)
Line 1: Line 1:
[[Category:Web Browser]]
+
[[Category:Web browser]]
[http://elinks.or.cz/ ELinks]is an advanced and well-established feature-rich text mode web (HTTP/FTP/..) browser. ELinks can render both frames and tables, is highly customizable and can be extended via Lua or Guile scripts. It features tabs and some support for CSS.
+
[[de:Elinks]]
 +
[[fr:ELinks]]
 +
[http://elinks.or.cz/ ELinks] is an advanced and well-established feature-rich text mode web (HTTP/FTP/...) browser. ELinks can render both frames and tables, is highly customizable and can be extended via Lua or Guile scripts. It features tabs and some support for CSS.
  
 
== Installing ==
 
== Installing ==
ELinks is available in the [community] repository.
+
{{Pkg|elinks}} is available from the official repositories.
# pacman -S elinks
+
== Basic Usage ==
== Usage ==
+
 
Start elinks with
 
Start elinks with
  elinks
+
 
 +
  $ elinks
 +
 
 
or, if you want to start a specific website:
 
or, if you want to start a specific website:
elinks foo.bar.org
 
Some basic keys are
 
  
  g Open URL-dialog
+
  $ elinks foo.bar.org
t Open new tab
+
 
> Change tab
+
=== Navigation ===
c Close current tab
+
 
Esc Show toolbar
+
Navigating the web with a text browser is more or less the same as a graphical browser, just without the 'distractions'.
 +
Once you've started ''elinks'', you can press '''g''' and type in the web page you would like to request.
 +
Then you can navigate the page using arrow keys to navigate by line, the space bar to navigate by page, or the
 +
'''j''', '''k''' keys to navigate by link.
 +
 
 +
 
 +
{{Expansion|Basic scripting and CSS.}}
 +
{{Expansion|automation and boting.}}
  
 
==Configuration==
 
==Configuration==
ELinks is capable of using external programs for various tasks, one of them is showing pictures.
+
Almost everything in ELinks can be configured to suit your fancy.
The %-sign is handled as filename (or URL).
+
 
 +
ELinks provides to two menus, accessable through ELinks, to customize options and
 +
keybinds respectivly.
 +
 
 +
It is recommened to use these tools as opposed to hand-editing the config files (which are placed in ~/.elinks)
 +
It is both much easier and safer this way.
 +
 
 +
By default, access to the option manager is through the '''o''' key and access to the keybind-manager is through
 +
the '''k''' key.
 +
 
 +
{{Note| The organization of the option-manager is not always obvious and takes a bit of memorization to use
 +
efficiently once you eventually find what you were looking for}}
 +
 
 +
== Tips ==
 +
=== Defining URL-handlers ===
 +
 
 +
ELinks is capable of using external programs for various tasks,
 +
 
 +
Defining URL-handlers through the option menu can be a little confusing at first, but once you get it, its fine.
 +
 
 +
To do this, go into the option manager and navigate to '''MIME'''. All the submenus have '''I'''nfo pages to help you.
 +
 
 +
This is one of the few cases where it might be easier just to edit the conf file.  
 +
 
 +
For example, to get ELinks to automatically launch your image-viewer when you click on a jpeg file, you can
 +
add the following to your ~/.elinks/elinks.conf file,
 
{{hc|~/.elinks/elinks.conf|<nowiki>set mime.extension.jpg="image/jpeg"
 
{{hc|~/.elinks/elinks.conf|<nowiki>set mime.extension.jpg="image/jpeg"
 
set mime.extension.jpeg="image/jpeg"
 
set mime.extension.jpeg="image/jpeg"
Line 42: Line 75:
 
set mime.type.image.bmp = "image_viewer"</nowiki>}}
 
set mime.type.image.bmp = "image_viewer"</nowiki>}}
  
== ToDo ==
+
=== Using ELinks with [[Tor]] ===
Passing Youtube-links through external player
+
ELinks does not support SOCKS directly, so alternatives are to either invoke ELinks thus {{ic|torify elinks}} or install {{Pkg|privoxy}} from the [[official repositories]] and use it for forwarding to Tor's SOCKS proxy, first by adding the following line to your {{ic|/etc/privoxy/config}}:
 +
forward-socks5 / localhost:9050 .
 +
Restart {{ic|privoxy.service}}
 +
and then entering the following lines to your {{ic|~/.elinks/elinks.conf}}:
 +
set protocol.http.proxy.host = "127.0.0.1:8118"
 +
set protocol.https.proxy.host = "127.0.0.1:8118"
 +
{{Note|The above assumes that ''Tor'' is using port '''9050''' and that ''privoxy'' is listening on port '''8118'''}}
 +
 
 +
=== Passing URL's to external commands ===
 +
You can define commands which ELinks will pass the the current URL to.
 +
 
 +
To do this, go into the options menu, navigate under '''Document''', then to '''URI-passing'''.
 +
Then press '''A''' to add a new command name. Then navigate to the new command name and press '''E''' to
 +
edit. Type in the name of command, enter and save.
 +
 
 +
Assuming the command "tab-external-command" is mapped to '''KEY''', whenever you press '''KEY''', a menu containing your commands
 +
will appear. Select the one you want, and ELinks passes the current URL to that command
 +
{{Note| Elinks allows you to define your own mappings for navigating this menu}}
 +
 
 +
Here are some useful commands to get you started...
 +
==== Saving link to the X clipboard ====
 +
echo -n %c | xclip -i
 +
 
 +
==== Passing YouTube-links through external player ====
 +
For strictly YouTube-links, {{Pkg|mpv}} has built-in support. Just use the following,
 +
mpv %c
 +
 
 +
For a more general approach that can handle many 'tube' sites, you will need {{Pkg|youtube-dl}}. Then add the following command,
 +
youtube-dl -o - %c | mplayer -
 +
I used {{Pkg|mplayer}} because i couldn't get it to work with mpv. Anyway, this is not as nice as mpv's support for YouTube links.
 +
Mpv gives you full control of position in the stream which is wonderful!
 +
 
 +
== Troubleshoot ==
 +
=== ELinks froze and I can't start it without it freezing again ===
 +
By default, every time you start ELinks you are connecting to an existing instance. Thus, if that instance
 +
freezes, all current and future instances will freeze as well.
 +
 
 +
You can prevent ELinks from connecting to an existing instance by starting it like so
 +
elinks -no-connect
 +
 
 +
If this happens a lot, you might consider making this your default startup by making an alias in your shell
 +
alias elinks="elinks -no-connect"
 +
 
 +
== See Also ==
  
Basic scripting and CSS
+
*[http://elinks.or.cz/ Official web site]
 +
*[http://kmandla.wordpress.com/2007/05/06/howto-use-elinks-like-a-pro/ Howto: Use elinks like a pro]

Latest revision as of 22:22, 20 October 2015

ELinks is an advanced and well-established feature-rich text mode web (HTTP/FTP/...) browser. ELinks can render both frames and tables, is highly customizable and can be extended via Lua or Guile scripts. It features tabs and some support for CSS.

Installing

elinks is available from the official repositories.

Basic Usage

Start elinks with

$ elinks

or, if you want to start a specific website:

$ elinks foo.bar.org

Navigation

Navigating the web with a text browser is more or less the same as a graphical browser, just without the 'distractions'. Once you've started elinks, you can press g and type in the web page you would like to request. Then you can navigate the page using arrow keys to navigate by line, the space bar to navigate by page, or the j, k keys to navigate by link.


Tango-view-fullscreen.pngThis article or section needs expansion.Tango-view-fullscreen.png

Reason: Basic scripting and CSS. (Discuss in Talk:ELinks#)

Tango-view-fullscreen.pngThis article or section needs expansion.Tango-view-fullscreen.png

Reason: automation and boting. (Discuss in Talk:ELinks#)

Configuration

Almost everything in ELinks can be configured to suit your fancy.

ELinks provides to two menus, accessable through ELinks, to customize options and keybinds respectivly.

It is recommened to use these tools as opposed to hand-editing the config files (which are placed in ~/.elinks) It is both much easier and safer this way.

By default, access to the option manager is through the o key and access to the keybind-manager is through the k key.

Note: The organization of the option-manager is not always obvious and takes a bit of memorization to use efficiently once you eventually find what you were looking for

Tips

Defining URL-handlers

ELinks is capable of using external programs for various tasks,

Defining URL-handlers through the option menu can be a little confusing at first, but once you get it, its fine.

To do this, go into the option manager and navigate to MIME. All the submenus have Info pages to help you.

This is one of the few cases where it might be easier just to edit the conf file.

For example, to get ELinks to automatically launch your image-viewer when you click on a jpeg file, you can add the following to your ~/.elinks/elinks.conf file,

~/.elinks/elinks.conf
set mime.extension.jpg="image/jpeg"
set mime.extension.jpeg="image/jpeg"
set mime.extension.png="image/png"
set mime.extension.gif="image/gif"
set mime.extension.bmp="image/bmp"

set mime.handler.image_viewer.unix.ask = 1
set mime.handler.image_viewer.unix-xwin.ask = 0
 
set mime.handler.image_viewer.unix.block = 1
set mime.handler.image_viewer.unix-xwin.block = 0 
 
set mime.handler.image_viewer.unix.program = "ADDYOURTERMINALPICTUREVIEWERHERE %"
set mime.handler.image_viewer.unix-xwin.program = "ADDYOURXPICTUREVIEWERHERE %"

set mime.type.image.jpg = "image_viewer"
set mime.type.image.jpeg = "image_viewer"
set mime.type.image.png = "image_viewer"
set mime.type.image.gif = "image_viewer"
set mime.type.image.bmp = "image_viewer"

Using ELinks with Tor

ELinks does not support SOCKS directly, so alternatives are to either invoke ELinks thus torify elinks or install privoxy from the official repositories and use it for forwarding to Tor's SOCKS proxy, first by adding the following line to your /etc/privoxy/config:

forward-socks5 / localhost:9050 .

Restart privoxy.service and then entering the following lines to your ~/.elinks/elinks.conf:

set protocol.http.proxy.host = "127.0.0.1:8118"
set protocol.https.proxy.host = "127.0.0.1:8118"
Note: The above assumes that Tor is using port 9050 and that privoxy is listening on port 8118

Passing URL's to external commands

You can define commands which ELinks will pass the the current URL to.

To do this, go into the options menu, navigate under Document, then to URI-passing. Then press A to add a new command name. Then navigate to the new command name and press E to edit. Type in the name of command, enter and save.

Assuming the command "tab-external-command" is mapped to KEY, whenever you press KEY, a menu containing your commands will appear. Select the one you want, and ELinks passes the current URL to that command

Note: Elinks allows you to define your own mappings for navigating this menu

Here are some useful commands to get you started...

Saving link to the X clipboard

echo -n %c | xclip -i 

Passing YouTube-links through external player

For strictly YouTube-links, mpv has built-in support. Just use the following,

mpv %c 

For a more general approach that can handle many 'tube' sites, you will need youtube-dl. Then add the following command,

youtube-dl -o - %c | mplayer - 

I used mplayer because i couldn't get it to work with mpv. Anyway, this is not as nice as mpv's support for YouTube links. Mpv gives you full control of position in the stream which is wonderful!

Troubleshoot

ELinks froze and I can't start it without it freezing again

By default, every time you start ELinks you are connecting to an existing instance. Thus, if that instance freezes, all current and future instances will freeze as well.

You can prevent ELinks from connecting to an existing instance by starting it like so

elinks -no-connect

If this happens a lot, you might consider making this your default startup by making an alias in your shell

alias elinks="elinks -no-connect"

See Also