April 15, 2007

Using screen and irssi to connect to multiple IRC servers and channels

Filed under: Technology — Cory @ 11:46 pm

I never was really big into the whole IRC scene, but I do have a few channels that I like to keep an eye on, mainly because they are just groups of friends from different points in my life. For a while now I have been using irssi in a screen session from a server I maintain, so that I always have a history of the conversations even when I am offline. Tonight I decided I wanted to figure out how to get irssi to keep separate windows for each of the channels I follow across multiple servers.

First, you don’t need to edit a config file, because irssi can save out its configuration via the /save command.

I want to connect to efnet and freenode upon startup, and join a couple channels right away. We first define a couple “networks”:

/NETWORK ADD Efnet
/NETWORK ADD Freenode

Then define the servers for those networks, and tell irssi to automatically connect to those servers:

/SERVER ADD -auto -network Efnet irc.efnet.org 6667
/SERVER ADD -auto -network Freenode irc.freenode.net 6667

Then tell irssi which channels to join by default:

/CHANNEL ADD -auto #ubuntu-houston Freenode
/CHANNEL ADD -auto #blahblah Efnet

To make it easier to switch from window to window without having to type /window goto 2 or /window goto #ubuntu-houston I added a couple aliases:

/alias ubuntu /window goto #ubuntu-houston
/alias blah /window goto #blahblah

This allows me to simply type /ubuntu and /blah (using tab completion) to switch between channels.

Now that I have the settings the way I want them, I can save them to the startup config by running:

/save

And that’s it. The next time I run irssi it will automatically connect to the right servers and join the channels I want it to.

• • •

1 Comment »

  1. Thanks loads for this, just did it and it works a dream.

    Comment by Luke — July 4, 2007 @ 2:23 am

Comments RSS

Leave a comment

Powered by: WordPress • Template by: Priss