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

/network list

The output is:

EFNet: max_kicks: 4, max_msgs: 3, max_whois: 1
QuakeNet: max_kicks: 1, max_msgs: 3, max_whois: 30
[other networks not shown here]

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

 /network add -modes 4 -nick Justin^^ -user justin -realname "The Justin" CNQnet

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

/network add -nick TheJustin -user justin -realname "The Justin" EFnet
/network add -nick Justin^^ -user justin -realname "The Justin" 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:

EFNet: nick: TheJustin, username: justin, realname: The Justin,
       max_kicks: 4, max_msgs: 3, max_whois: 1
QuakeNet: nick: Justin^^, username: justin, realname: The Justin,
          max_kicks: 1, max_msgs: 3, max_whois: 30
CNQnet: nick: Justin^^, username: justin, realname: The Justin,
        max_modes: 4

Looking good! Time to configure the servers.

Server configuration

When you type

/server list

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

irc.quakenet.org     6667  QuakeNet
irc.efnet.org        6667  EFNet
[other networks not shown here]

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:

/server add -network QuakeNet -auto irc.quakenet.org
/server remove irc.efnet.org
/server add -network EFnet -auto efnet.xs4all.nl
/server add -network EFnet irc.underworld.no
/server add -network CNQnet -auto irc.carnique.nl

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:

irc.quakenet.org     6667  QuakeNet   autoconnect
efnet.xs4all.nl      6667  EFNet      autoconnect
irc.underworld.no    6667  EFNet
irc.carnique.nl      6667  CNQnet     autoconnect

Channel configuration

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

/channel add -auto #irssitest EFnet
/channel add -auto #quartix EFnet oodle
/channel add -auto #monogaming QuakeNet
/channel add -auto #carnique CNQnet

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

Channel         Network    Password   Settings
#irssitest      EFnet                 autojoin
#quartix        EFnet      oodle      autojoin
#monogaming     QuakeNet              autojoin
#carnique       CNQnet                autojoin

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:

/join -efnet #irssitest
/join -quakenet #monogaming
/join -efnet #quartix
/join -cnqnet #carnique
/query -efnet Chang_X
/query -quakenet Smyter1
/query -cnqnet Garion

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:

/win 6
/win move 2

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:

/layout save
/save

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.

14 Responses to Irssi tricks: join channels automatically

Leave a Reply

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