nicklist.pl

Version: 0.4.6
Download
View source
signature

This script draws a nicklist to another terminal, or at the right of your irssi in the same terminal.

There are 2 'modes' for this script: fifo and screen.

  • The fifo mode is the 'cleanest' way to do it, works better, faster, but is only possible in X: it needs 2 terminal windows (one for your irssi, one for the nicklist). Here's a screenshot
  • The screen mode is a bit easier, works in 1 terminal, but does more redrawing (using more bandwidth if you run it remote), flickers a little bit, and doesn't work perfectly (sometimes some lines in the nicklist will be blank for a short while) . (note that the screen mode has improved a lot). Here's a screenshot of this mode.

Usage

fifo

In this mode, the scripts writes its output to a fifo. You should open another terminal window for the nicklist, put it at the right (or left) of the one with your irssi in it, and cat the fifo there.

The first time you use the script, the fifo has to be created, you can do that with /NICKLIST FIFO
Next, you start reading the fifo with cat, in a terminal window, where you want the nicklist. (This will initialy give no output at all, the script isn't using it yet)
$ cat ~/.irssi/nicklistfifo
Because the script needs to know how big it can draw the nicklist, you need to give it the size of the other terminal:

/SET nicklist_height <height of nicklist>
/SET nicklist_width <width of nicklist>

Then, the script can start using it: /NICKLIST FIFO
Now the nicklist should appear in the terminal window where you are catting the fifo.

Next time you want to start using the script, first start cat, then do /nicklist fifo

screen

In this mode the script constantly (every time irssi prints a line) has to redraw the nicklist, so actualy, it's not really good, but it works and looks fine most of the time.

As the name suggest, this only works from inside of screen. Before version 0.4 you had to do a lot of configuring manualy, so if you have an older version, please update.
Just start your irssi inside screen (screen irssi), load the script, and /NICKLIST SCREEN

That should work in linux console, xterm or Konsole. But it doesn't work in Eterm, rxvt, aterm or gnome-terminal (and probably some others too): for them you'll need to run screen within screen. So you start your screen, and within that, do screen -m irssi (DON'T forget the -m) (or reattach your screen where you already have an irssi running). (this will be fixed some day...)

You can change the width of the nicklist:
/SET nicklist_width <width of nicklist> (the default, 11 is probably enough)

After switching to another window in screen and back, it takes some time for the nicklist to reappear, to prevent this delay, run irssi in a screen within another screen if you want multiple screen-windows.
If your irssi doesn't resize properly, and the text from irssi and the nicklist overlap, make sure you're running the latest version.

There's a problem with split windows: the script doesn't know which window is visible in another split window, so it doesn't know when it needs to redraw (every time a line that's visible on the screen is printed, the nicklist needs to redraw). If you don't use split windows, leave this setting empty
So, the script asumes the only visible windows are the currently active window, or a window in nicklist_screen_split_windows.
If you don't add the windows that should be in it, 'holes' can apear in the nicklist. If you add too many, it'll do more redrawing and become slower.
So, if you, for example, have a split window with a status window, and a msgs window, and all channels are in the other split window, you should:
/set nicklist_screen_split_windows (status) (msgs)
(It's a space-seperated list of window names or number, or if you set it to * it always redraws (very inefficient))

automode

When the script is loaded, it starts in the OFF mode, if you want the screen mode to start automaticly do:
/set nicklist_automode SCREEN

scrolling

You can scroll up and down in the nicklist with /nicklist scroll. You probably want to bind a key to it.
/bind something command nicklist scroll -10
/bind something command nicklist scroll +10

Bugs

  • Doesn't work with all terminals (cursor jumping to wrong place, stuff drawn wrong...) without the screen-within-screen workaround explained above
  • screen in multi display mode can cause some problems while resizing the terminal
  • after renaming your already running screen session, nicklist can't resize it anymore. can be fixed with /script exec $ENV{STY}="name-of-your-screen" (you can see the full name with screen -ls
  • if it prints "Possible memory corruption: ioctl overflowed 3rd argument", install the Term::ReadKey Perl module. If nicklist doesn't find that module, it tries an ugly thing to work without it anyways, but on some systems it might fail like this.

If you experience any other bugs, just mail me and I'll look into it.

Todo

  • use termcap or sth instead of ansi
  • new joins/parts/quits/kicks other colour, keep netsplitted nicks
  • show away-status/friends/... with colors
  • either fix, or remove nicklist_screen_prefix (e.g. add a "|", recalc width...)
  • remember position of nicklist when switching channels
  • show list of common channels / nicklist of one common channel when in query?

Changelog

current SVN version (0.4.6+, download location is temporary)

  • Add support for 'other' modes (&~,...)
  • Give different (configurable) colors to friends, dependant on flags.
  • Fix another screen sizing issue

0.4.6

  • work around (screen?) bug in recent systems that caused resizing the screen to fail
  • Fix /NICKLIST OFF by Alejandro Mery

0.4.5

  • fixed to work with silc too by c0ffee
  • fixed to work in bsd, thanks to Sander Plas
  • detect if trying to use screen mode outside screen
  • fixed changing the color of the prompt sometimes with long nicks by Casper Kvan Clausen