Archive

Archive for March, 2012

Irssi and tmux (or screen)

March 24, 2012 10 comments

In my last post I described a basic setup for bitlbee and irssi. Now I’ll describe my current irssi configuration. The setup described here has been tested on my Kubuntu Oneiric laptop.

Irssi is highly configurable via Perl scripts. You can write your own scripts, use those included in your GNU/Linux distro or download them from the scripts section of the irssi website or from other places. I’ve used the last two methods.

Currently I’m using three scripts: adv_windowlist.pl (downloaded from here), nicklist.pl and hilightwin.pl (both of them from the irssi-scripts Kubuntu package).

The advanced window list script allows you to customise the channels status bar and the active windows list.

The nicklist script places all nicknames in a channel in a bar at the side of the window like many other IRC-channels. You can use it in two modes: fifo or screen.

With the hilightwin.pl script every time you get hilighted (someone types your nickname or any other higlighted word or sends you a private message) a copy of that message will be sent to a separate window.

In order to run the scripts automatically at irssi startup I’ve created the recommended ~/.irssi/scripts/autorun subtree. I’ve put adv_windowlist.pl under the scripts directory and created symbolic links to all the three scripts mentioned above under the autorun directory.

And now for the scripts configuration. Start irssi and from the status window run the following commands to setup the hilightwin.pl script so that it displays a window on the top of the terminal at all time. That way it will be difficult for you to miss important messages:

/run autorun/hilightwin.pl
/window new split
/window name hilight
/window size 6
/layout save

Next configure the adv_windowlist.pl script. The settings and explanations for them are atop the script, in the OPTIONS section. From the status window run the command:

/set awl_display_key $Q%K|%n$H$C$S
/set awl_block -15

where $Q is the meta-keymap key (ALT on my system), %K changes the color of the pipe character, %n changes the color of the window name, $H means start hilighting, $S means stop hilightning and $C is the name of the window. The second line defines the width of the status bar region dedicated to every window. Unfortunaltely the hilight part fails for me (maybe I’m misunderstanding something, suggestions are welcome 🙂

Next configure the nicklist.pl script. Here I’ll assume you’re running irssi in a tmux session. From the status window execute (comments have been added for clarity, obviously you don’t have to write them):

# split the terminal window in two panes
CTRL+b %
# resize the right pane to its minimum with
CTRL+b right_arrow_pressed until the desired width is get
# back to the pane where irsii is running
CTRL+b o
# Configure the nicklist script in FIFO mode
/nicklist fifo
# back to the right pane and get its size (rows, columns)
$ stty size
42 20
$ cat ~/.irssi/nicklistfifo
# back to the pane where irsii is running
/set nicklist_height 42
/set nicklist_width 20
/nicklist fifo

If you use screen instead of tmux the setup is easier, but it doesn’t work so smoothly:

/nicklist screen

Eventually save your configuration:

/save

Here you can see the whole thing in action:

PS: As an added bonus of running irssi inside a tmux session the nicklist script works even if you are not running a X session. It is fun to see it working in a Linux console 🙂

Advertisements