Adventures in Irssi

Irssi is a great terminal-based IRC client. I'd been meaning to switch to it for awhile, but couldn't be bothered until my ZNC bouncer's config got wiped out, and I would have had to poke around Pidgin to get it working again anyway. So instead I took the plunge and I've been using Irssi for about 3 months now with basically just default settings. I haven't regretted it for a minute.

I recently had some trouble with my router, and my flapping in the channels I haunt prompted a friend to recommend using a bouncer. Now, one of the reasons I wanted to try out Irssi to begin with was because it could also act as a proxy (bouncer), but hadn't gotten around to it yet.

Basically, this involved copying ~/.irssi/config from my laptop up to a shell server, as this contained all it would need to log in to the networks and channels I usually frequent. I then ran Irssi in a screen session, so it would remain running after I logged out. I then ran the following commands:

/load proxy
/set irssiproxy_password = MySuperSecretPassword
/set irssiproxy_ports indymedia=44444 freenode=44445

On my laptop, I commented out the settings for the direct connections to my networks & channels, and instead added connections to each of the proxy server's ports I had just configured. The Irssi client would automatically connect to the various channels.

I also wanted to log messages when I wasn't connected to the proxy, which is easily accomplished with the script. As with any Irssi script, this just involves downloading it to .irssi/scripts and running /script load awayproxy. Most Irssi scripts come with some documentation available from within Irssi, as well as the ability to set variables, which can then be saved to .irssi/config, as I did with the proxy settings above. But not this one, which actually involves hacking the script to change some config options. It's well documented in the code though, so I'll leave it to anyone interested and intrepid enough to go ahead and take a look.

N.B.: This approach (writing config options in code) means that updating the script (such as with scriptassist, see below) could wipe out your configuration for this script.

I also wanted to ensure that if I ever had to restart irssi (e.g., after a shell server reboot) all proxy settings would be automatically loaded. Scripts can be loaded automatically by putting them (or a symlink to them) in .irssi/scripts/autorun:

ln -s ~.irssi/scripts/ ~.irssi/scripts/autorun/

Also, the irssi-proxy setting themselves had already been saved to .irssi/config by the /save command. However, I would still have had to start the proxy by hand, except that Irssi allows you to specify a list of commands to run on startup:

echo /load proxy > ~/.irssi/startup

So, now I had my proxy set up, I could disconnect from the screen session (CTRL-a CTRL-d), and just leave Irssi running as a proxy. Also, if I ever find myself unfortunate enough to be using a Windows system, I can always log in and have access to Irssi via ssh (or putty, or whatever).

But I couldn't very well stop there! So, I've spent some time configuring my local Irrsi to my liking, and adding some helpful scripts. A good script to start with is which makes it easier to download other scripts. allows for right-aligning and custom colouring of nicknames, which when used sparingly can improve readability. allows for automatically setting you away after a certain time, which is polite, if you aren't in the habit of setting yourself /away. is a must-have script, that alerts you to highlighted messages using you OS's alert mechanism (otherwise, you might find yourself obsessively checking Irssi to see if anyone's trying to talk to you).

I'm quite excited by, which integrates Twitter into Irssi, but has a ton of settings and options that I've really only scratched the surface of. It's also a bit of a challenge to set up, as it requires a perl library, Net::Twitter (hint: check out cpanm, and don't be afraid to use '--force').

Finally, I've always been annoyed at having to copy/paste links from Irssi into a browser, but with the script, this is greatly simplified. It basically builds a list of links mentioned in messages, which you can then access by running /openurl #. The only problem I had was that, by default, it'll open a screen session and open the url in w3m. Now, I'm a fan of terminal-based and CLI tools, but with very few exceptions, this does not extend to browsing the web. So, I figured out that you can change the default client the url will be sent to, and so I can now have new Chromium windows opened automatically from within Irssi:

/set openurl_app_http /usr/bin/chromium-browser --new-window $1

I also tried several themes, but have yet to find one I like better than the default. I'm using ash.theme right now, but it's not great IMHO. Eventually, I'll probably look at tweaking the colours and layout and such, but at this point I've spent enough time on Irssi customization.

Anyway, that's as far as I've gotten so far, but I expect I'll have to start running a couple channel myself soon, and so I'll be revisiting Irssi scripts as my needs change. I'll post a follow-up when that's the case.


/openurl outputs chromium's confirmation message into Irssi, which is kinda messy. But instead we can redirect the output so it doesn't show up:

openurl_app_http = /usr/bin/chromium-browser --new-window $1 >/dev/null 2>&1