irssi, ultimate configuration

This is a post about my (almost perfect and completely wonderful) irssi rig. Nothing is perfect, but this is pretty damn close in my opinion.

There are two main ways for IRCnuts like us to keep a permanent connection to IRC; irssi/weechat in a terminal multiplexer like screen or tmux, and a bnc. Both have their advantages and disadvantages; bnc’s are cheap, simple, allow for GUI clients while terminal multiplexers keep huge logs, timestamps/messages remain intact, and with irssi it’s easy to add scripts and actions with tools like On the negative side, bnc’s destroy timestamps, logs are horrible to read, scripts are harder to write, while terminal multiplexers are dependant on a stable internet connection and require an ssh client (hard to use on you phone for example).

My ultimate configuration uses both a bnc, and irssi running in a tmux session. I am going to briefly discuss how I set this up, and why it rocks.

You will need:

  • A vps (running Linux)
  • Cup of tea

We’ll need a terminal multiplexer

I use tmux because it’s lovely, but you can use whatever you want (GNU screen).
I have a post about tmux you might like to read.

Install and configure znc

First, lets configure znc. Install znc on your system of choice. Mine is Gentoo so I just

# emerge znc

(Don’t forget to check your useflags!)
Switch to the login you normally use (not root!!) and configure znc. Luckily znc provides us with a tool to do this easily.

$ znc --makeconf

Answer the questions and write your config to ~/.znc/configs/znc.conf. Note, you can only have one server per user. For multiple servers, add multiple users. A good way to do this is create passwords with the pattern “nickname:commonpassword”.

If you use the module nickserv, then now you should set your nickserv password. You can either start znc, connect with irssi and do

/msg *nickserv set pass

or you can run

echo 'Password pass' >> ~/.znc/users/youruser/moddata/nickserv/.registry

Once this was done, I copied the USER block in the znc.conf file for all my other users (for other servers) and also copied (and changed the password for) the ~/.znc/users/firstuser/. Use znc –makepass to generate a password hash.

Now znc is correctly configured, you can fire it up by typing

$ znc

and it will automatically fork.

Using znc

You can control znc from your IRC client when connected. To see a list of commands type

/msg *status help

You may want to execute some commands when you connect (such as /oper). For this we can use the perform module.

/msg *status LoadMod perform

And then

/msg *perform help

You can find a list of modules here.

Install, configure and set up bitlbee

There is no better way to use MSN/Gtalk/etc than Bitlbee. All your contacts appear as users on a special IRC channel, allowing you to communicate with them using an IRC client like irssi. Excellent. I would recommend using libpurple with bitlbee, since you get many more account types. Add purple to your useflags if you’re using Gentoo. Then emerge, configure and start.

# emerge -a bitlbee
# vim /etc/bitlbee/bitlbee.conf
# /etc/init.d/bitlbee start

Now, connect to bitlbee using the port you configure above and create an account. It’ll automatically join you to a channel called &bitlbee. The first step is to register,

/msg &bitlbee register yourpass

To add an MSN/Google Talk account:

/msg &bitlbee account add msn email password
/msg &bitlbee account add jabber mypasswd

You can always try “help” for more information. Now you’re done, start your accounts and don’t forget to add this server to your znc config. You can also add your identify command to the znc perform module to have it automatically log you in on start.

Install and configure irssi

Install irssi and tmux. Again do this with whatever package manager your distribution uses.

# emerge irssi

(Don’t forget to check your useflags!)

For irssi, I like to first get a theme. Look at to pick one if you so desire.

$ wget -O ~/.irssi/default.theme

There are a few scripts that I absolutely cannot live without. We want them to start automatically.

$ mkdir -p ~/.irssi/scripts/autorun/

Now any scripts in this directory will be loaded automatically.

This will colour all nicknames and remember them, I find it easier to follow a conversation at a glance this way.

$ wget -O ~/.irssi/scripts/autorun/

Sets you to away when you detach the tmux session irssi is running inside.

$ wget -O ~/.irssi/scripts/autorun/

There is also a script.

$ wget -O ~/.irssi/scripts/autorun/

Make a special window for all your highlighted messages (and private messages).

$ wget -O ~/.irssi/scripts/autorun/

A better window list.

$ wget*/Code/Irssi/ -O ~/.irssi/scripts/autorun/

Now lets start irssi and configure these scripts. They will load automatically. (Make sure to start this in tmux, otherwise won’t load)

Turn on

/set tmux_away_active ON

Make the window for

/win new split
/win rename hilight
/win size 6

Make look pretty

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

Finally, lets save everything!

/layout save

Final thoughts

This configuration is the ultimate configuration, but it’s still not great. while this configuration is still far from perfect – it is (imo) the best one I’ve seen so far. If you found this useful, it’d be great to hear from you. If you found a bug, it would be even better to hear from you.

One thought on “irssi, ultimate configuration

  1. RichTea

    Thanks for the config guide I really like this setup

    I added and scripts to irssi too

    Also is very nice if your a twit too


Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>