Auto connect and authenticate to irc server in irssi

Posted on January 14, 2019

If you find yourself doing the same thing repeatedly on a regular basis then its best to think of a way to automate it.

Words that I want to live by as a Software Engineer.

One of the things I do after starting up or logging into my computer is to connect to irc. I like to be on the xmonad(since I need help with setting certain things the way I want and this is the best place to ask and get answers quickly - huge shoutout to the helpful people at that channel), haskell(I am learning it, like to just see what goes around), python, and archlinux(try to help out others in ways I can) channels.

Up until now I had always typed in the /connect freenode and /msg nickserv identify ****. I was enjoying it, because who doesn’t like to type on their Thinkpad keyboard? But it got annoying when I wake my computer and it connects back to the channels but this time to their respective ‘unregistered’ channels because I didn’t authenticate. I went through the documentation of irssi to see if there was a way to autoconnect, which I was certain there was and found it!

Following commands will auto connect, auto authenticate and auto join channels(if you wnant) when you start irssi.

/SERVER ADD -auto -network freenode irc.freenode.net 6667 <password>

/CHANNEL ADD -auto #<channel_name> freenode

The above commands assumes that you have the right nick set in your config file. If not then go into the irssi config file(usually ~/.irssi/config), search for nick and change it the name that you have registered with the server.