Irssi tricks: join channels automatically

Today, we shall learn how to make irssi connect to servers, join channels and open queries on startup.

Let’s assume that we want irssi to automatically connect to the following networks, join these channels and open these queries:

  • EFnet
    • use server efnet.xs4all.nl or irc.underworld.no
    • use nickname TheJustin
    • join channel #irssitest in window 2
    • join channel #quartix with channel password oodle in window 4
    • open query with Chang_X in window 6
  • QuakeNet
    • use server irc.quakenet.org
    • use nickname Justin^^
    • join channel #monogaming in window 3
    • open query with Smyter1 in window 7
  • CNQNet
    • use server irc.carnique.nl
    • use nickname Justin^^
    • join channel #carnique in window 5
    • open query with Garion in window 8

To accomplish this all, we shall first configure the irc networks, then the servers of each network, and then the channels and queries in the correct windows.

Let’s get to work. First of all, start irssi in a screen or tmux.

Network configuration

To list all IRC networks that irssi knows by default, type

The output is:

As you can see, EFnet and QuakeNet are already there, but CNQnet is not. Let’s add that network:

We also want to make sure that irssi uses the correct nickname, username and realname on EFnet and QuakeNet:

Note that you need to use /network add to change the settings of an already existing network. The network configuration should be good now; let’s verify that with /network list:

Looking good! Time to configure the servers.

Server configuration

When you type

you can see the servers per network that have already been defined in the default configuration of irssi:

The QuakeNet configuration already uses the correct server. However, it does not automatically connect on startup, so we need to fix that. Also, the EFnet config uses the wrong server for us (irc.efnet.org instead of the 2 servers we want to use), and CNQnet does not have any servers at all. To change all this, we type:

Just like changing the settings of an existing network, we use /server add to overwrite the existing server entry with the new settings. After these commands, /server list shows:

Channel configuration

Let’s start by adding the channels to the configuration.

With /channel list, we can see all currently configured channels:

The last step of configuration is to actually join the channels and open the queries. This seems to be the easiest way to do it:

We have to make sure to do this in the right order, so the channels and queries end up in the right windows. If, for whatever reason, we end up with the windows in a different order than we want, we can move windows around until the order is as we desire. For example, to move window 6 to position 2, we would do:

There is one last, and very important, thing that we have to do: we have to make sure that irssi stores our hard work, so we won’t have to do it again. We do this by the following two commands:

The command /layout save tells irssi to store which channels and queries are in which windows when next we use /save, and
/save stores the configuration (which networks and servers we defined, and which channels and queries were open in which windows).

From now on, whenever we type irssi to start irssi, irssi will automatically connect to EFnet, QuakeNet and CNQnet, join the 4 channels we defined and open the 3 queries, all in the correct windows!

This entry was posted in irssi and tagged , , , , , , , , , , , , , , , . Bookmark the permalink.

9 Responses to Irssi tricks: join channels automatically

  1. dH says:

    Thanks for the nice summary! =)

  2. I’ve been using Irssi for *years* and not known this trick. Thanks for the tip! I love not having to edit the config manually and reposition the windows 😀

  3. Jonas says:

    Thanks for this! I’ve been editing my config file manually for years now :)
    But no longer!

  4. Rico P says:

    Really, really, really appreciate the write up. I have been IRCing for over a decade and ever since I started using a server for it, …. I would manually reconnect to the places I wanted to go.

    Anyway, I just had to say thanks! Best IRSSI guide for this on the internet

  5. Krzysztof Szumny says:

    Very helpful. Thanks!

  6. Dmitry says:

    Thank you a lot, that’s much more useful than official documentation.

  7. Integralist says:

    I found this long after you wrote it. But thank you nonetheless. Extremely clear and useful :-)

  8. max says:

    thanks for the straightforward doc on adding networks, servers and channels. always needed to look this up when doing a new irssi config, but now i got this.

Leave a Reply

Your email address will not be published.