iil

All Top-level Files
Login

Files in the top-level directory in any check-in


The iil (short for iiless) is simple viewer/reader (it doesn't provide
notifications) for ii irc client [1]. It was inspired by ml [2] script.

It has minimal dependencies:
- GNU less and lesskey.  Some can argue that GNU less is far from 
  minimal, but it can be found almost everywhere, even *BSD are using
  this implementation.  It won't work with busybox less.
- Bourne shell and few commands like awk, du.  It should work with any 
  /bin/sh.

To get working iil first you will need to compile lesskeys file to 
something that less understands.  Use command like:

  $ lesskey -o iilkeys lesskeys

Copy iilkeys file where you like and then edit iil.sh script.  You will 
need to change $irc_prefix to location, where FIFO files of ii reside.  
You will need to change $less_keys to point, where compiled file with 
lesskeys can be found.  You can also change $read_cmd - e.g. some shells 
support readline option for read (-s flag).  Copy iil.sh where you like.

Now you can start iil.  Some file will be opened in less pager.  When 
specific key will be pressed, less will close and emit hook used by 
script.  Depending on value of hook, new instance of less will be opened 
and so on.

Default keys:
 ,  (Comma, same key where < is)
    Switch to previous server/channel. 

 .  (Period, same key where > is)
    Switch to next server/channel.

 ;  (Semicolon)
    Send message to server/channel or change channel, when used on
    server list page.

 0  (Zero)
    Show and refresh list of channels/servers.

 1-9
    Switch to specific channel.

By default iil creates list of channels and servers, where negative
(e.g. -1, -2, -3 ...) numbers represents servers, zero (0) is
server/channel list and the rest represents channels and private 
messages (e.g. 1, 2, 3 ...).

You can use , and . to cycle through this list.  When you will hit 
first/last item of this list, iil will jump to the other end (it works 
pretty much like a ring).  To refresh list (e.g. after joining new 
channel you need to press 0 (Zero).

You can use same numbers for starting iil, some examples:
  $ ./iil.sh 2
    will show second channel
  $ ./iil.sh -1
    will show first server
  $ ./iil.sh 0
    this is default, it will show list of servers/channels

The iil has also primitive support for sending messages using read 
builtin in /bin/sh.  Just use ; to send message to currently viewed 
server/channel.  Same key can be used on the list page - enter number to
switch to specific channel/server.

There is no problem with using iil in multiple instances.  Just remember 
to clean irc prefix from old channels/servers from time to time.  There 
is also useful option in less called forw-forever, which works like 
"tail -f" (use capital F to activate it).

I'm not sure if such short script is copyrightable, but jurisdiction of 
my country [sic!] doesn't allow me to release it into public domain.  
Read LICENSE file for details. 

TODO:
- spell check readme and rewrite it in proper english
- replace echo with printf
- qoute string inside test brackets (comparison)

Three cents about colors.  Personally I don't find usage for those, but 
probably those could be added in pretty trivial way.  Less supports 
filters with LESSOPEN and maybe few other things - check less(1) man 
page for details.

[1] http://tools.suckless.org/ii/
[2] http://dev.laptop.org/~pgf/mh/ml