IRC Client IRSSI

Since the Internet has reached the masses a couple of years ago and the whole online-world is continuously going up and down through an ever-changing landscape of changing networks and applications, it’s sometimes wonderful to see that some things are preserved and still work like in the good, old days when only Nerds were living in the Internet. One of those old Titans or a relict as others might call them is the IRC - the Internet Relay chat. Since 1988 (which I personally remember as one of my best years, but this is totally unrelated to this) IRC is online and after 23 years still working and operational. Most I’d say because of its beautiful simplicity and reliability. From the layout-perspective it can’t compete with the graphical interfaces like social media offers. And that’s not the focus of it either.  On the other hand it’s completely free of any advertising and any distractions in usage (Except the web-based IRC-Clients, which run in a browser).

Therefore IRC is basically my preferred place to contact and talk to people. And the application I currently use for that most is irssi. Mostly because of it’s flexibility and the (so-looking) endless possibilities of extending it and using it the way I prefer.

For just getting in an out, a web-client will do or every simple IRC client than you can find. A classic one for windows will probably also be mIRC But if you tend it on an everyday bases, you get the idea that you want a bit more functionality, maybe even comfort. Unfortunately that’s the moment where manual configuration come into the game.  Once you’ve learned this, you don’t experience it as heard as it seems in the beginning any more.

All the following commands are related to irssi.

Automation

The great thing about full control about your system is, that you can do whatever you want and you’re just limited by your own abilities. If you’re used to hang around on specific servers and in specific channels it’s getting tiring to connect and join all the channels manually.

The basic configuration you’ll do with the file ~/.irssi/config

The file is structured in a couple of sections:

  • servers

  • chatnets

  • channels

  • aliases

  • statusbar

  • settings

  • logs

If you normally connect to freenode you need to modify the subsection of freenode in the section servers. If you prefer different IRC network - there you go:

servers = (
{
address = "irc.freenode.net";
chatnet = "freenode";
port = "6697";
password = "******";
use_ssl = "yes";
ssl_verify = "yes";
ssl_capath = "/etc/ssl/certs";
autoconnect = "yes";
}
);

The entries with SSL are modified by me for securing my connection. The important parameter is autoconnect which opens a connection to the server you’ve specified in the parameter “address”. If you’ve registered your Nickname on that server you want to specify the password as well. Just starting IRSSI will connect you the server. The parameter chatnet gives it an internal name which you will later reference in the section channels. But you still have to make changes in the section settings and channels.

In the settings-section you can specify the username, nick, real name and whatever you want:

settings = {
core = {
real_name = "Your Name";
user_name = "username";
nick = "Your Nick";
timestamp_format = "%H:%M:%S";
};
};

These settings are the same for all servers. That’s why you specified the password in the server-section.

Now you only have to specify which channels to open on which server. Modify the section _channels_ accordingly:

channels = (
{ name = "#irssi"; chatnet = "ircnet"; autojoin = "No"; },
{ name = "#silc"; chatnet = "silc"; autojoin = "No"; },
{ name = "#mat"; chatnet = "freenode"; autojoin = "Yes"; },
{ name = "#drikke"; chatnet = "freenode"; autojoin = "Yes"; },
{
name = "#channel3";
chatnet = "freenode";
autojoin = "Yes";
}
);

The first two channels #irssi and #silc are configured not to be joined automatically (autojoin = “No”). The channels #mat and #drikke will be joined automatically (autojoin = “Yes”) when connecting to the server freenode (chatnet = “freenode”). This is the reference I was talking about before. When connecting to the server with the parameter chatnet = “freenode” the channels including this parameter will be automatically joined as well.

So what happens when you start IRSSI?

  1. irssi reads the user config file in ~/.irssi/config.

  2. It opens a connection to all servers specified in the section “_servers_” with the parameter autojoin = “Yes”.

  3. The credentials and the identity from the section “settings” and the server specific password from the section “_servers_” are used for authentication (if necessary).

  4.  irssi joins all the channels on the server specified in the section channels.

This is just very basic automation, but I gained a new level of comfort from it, since  I just start irssi and it just puts me where where I left.

Log a Conversation

A very basic thing to do. You’re at the end of a chat session and you wonder if you can save the whole conversation, it could be for semantic reasons or  for picking out some links that were mentioned during a conversation. So here you go:

/window log on
/lastlog [-force]`

The parameter -force is necessary if your log is already  bigger than 1000 lines. After enabling the logging the output will be constantly added to the log-file in your home folder until you leave the channel or disable the logging.

This will create a log file of the current chat window in your home folder. The naming isn’t unique, so every time you run these commands again in the same window, irssi will overwrite the file.

Sound

irssi gives you (as any good IRC client) the possibility to open several windows at the same time. Therefore you can just have a focus on one at a time and you might somebody mentioning some of your highlighted Nicks/Words. It happens to me a lot, especially when I’m at the same time running around, away from the Computer and don’t look at the Chat all the time. Playing a sound file calls me then back to the screen.

Download the Perl-Script beep_beep.pl and integrate it into IRSSI.

cd $HOME/.irssi/scripts
wget http://scripts.irssi.org/scripts/beep_beep.pl
wget http://www.andrews-corner.org/tmp/ding_dong.wav
mkdir $HOME/.irssi/scripts/autorun
cd $HOME/.irssi/scripts/autorun
ln -s ../beep_beep.pl

Now install sox (you can use another sound program if you want):

$ sudo apt-get install sox

Now open up IRSSI and run the following:

/set bell_beeps
/set beep_msg_level MSGS DCC DCCMSGS HILIGHT NOTICES
/set beep_cmd play -q ~/.irssi/scripts/ding_dong.wav &
/save

Whenever one of you highlighted words is mentioned in any windows - you hear that sound file. I can just recommend to choose it wisely and not tell anybody about the words you have trigger on. They might annoy the shit out of you then by just typing it over and over again.

Ignoring Trolls

Occasionally you have to ignore some trolls on the channel. Either because they don’t like or because you don’t like them.

It takes about two seconds:

/IG <Nickname>  # or /IGNORE <Nickname>
/Save

Word replacement

There are two requirements I’d like to have

  1. Correct my stupid typos.

  2. Give me the possibility to make abbreviations.

There’s a word replace script that does exactly this.

IsaacG has already written it and put it on Github long ago.

The script word-replacement.pl does basically two things:

  1. Read the list of word it’s supposed to correct.

  2. Replace those words with others when the message is sent.

It’s basically quite easy to installing

  • First: Drop the file word-replace.pl into ~/.irrsi/scripts and the file pxdict.ini into ~/.irssi.

  • Second: Load the script from within IRSSI: with

irssi> /load word-replace.pl

If you want to make any changes to the dictionary file pxdict.ini you need to reload the script file again.