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 trigger.pl. 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
and it will automatically fork.
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
/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 firstname.lastname@example.org mypasswd talk.google.com:5223:ssl
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 http://www.irssi.org/themes to pick one if you so desire.
$ wget http://irssi.org/themefiles/bluu.theme -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 http://scripts.irssi.org/scripts/nickcolor.pl -O ~/.irssi/scripts/autorun/nickcolor.pl
Sets you to away when you detach the tmux session irssi is running inside.
$ wget http://cybione.org/~cdidier/code/misc/tmux_away.pl -O ~/.irssi/scripts/autorun/tmux_away.pl
There is also a screen_away.pl script.
$ wget http://scripts.irssi.org/scripts/screen_away.pl -O ~/.irssi/scripts/autorun/screen_away.pl
Make a special window for all your highlighted messages (and private messages).
$ wget http://scripts.irssi.org/scripts/hilightwin.pl -O ~/.irssi/scripts/autorun/hilightwin.pl
A better window list.
$ wget http://anti.teamidiot.de/static/nei/*/Code/Irssi/adv_windowlist.pl -O ~/.irssi/scripts/autorun/adv_windowlist.pl
Now lets start irssi and configure these scripts. They will load automatically. (Make sure to start this in tmux, otherwise tmux_away.pl won’t load)
Turn tmux_away.pl on
/set tmux_away_active ON
Make the window for hilightwin.pl
/win new split /win rename hilight /win size 6
Make adv_windowlist.pl look pretty
/set awl_display_key $Q%K|%n$H$C$S
Finally, lets save everything!
/layout save /save
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.