ii irc client
Over the years in my Linux journey, I’ve been slowly developing a soft spot for simple, lightweight (preferably terminal-based) applications over complicated bulky ones, why I’ve been slowly going through the process of substituting bulky, GUI-heavy apps for minimalist ones in my workflow; ranger for thunar, vim (with plugins) for Microsoft Code, etc.
Which brings me onto IRC clients, I’ve transitioned from irssi to weechat and back over recent years and as someone who loves discovering new apps, I came across a little gem called Irc it (ii), part of a collection of tools on the suckless site. What makes ii special is that it is a bare minimal FIFO filesystem-based IRC client and all you need to do is to use
tail -f to follow conversations and
echo to send your replies or commands to an IRC server.
To install ii, first clone its repo:
then, copy the binary (ii) to your bin folder.
The command syntax for running ii is:
for example, for the freenode IRC network, the command will be:
and to identify your nick, the command will be:
If you didn’t specify a directory where you you want your ii files stored, ii will by default store your files in a folder named
irc on your user home directory, once connected to the freenode network, you can join a channel by echoing the name of the channel you want to join to the
in file which would have been created by ii as follows:
The newly created
irc folder structure would look like this once you’ve connected to an IRC server and added some chat channels:
Following the above commands will get you up and running with ii and connected to an IRC network like freenode but without SSL/TLS support as ii by itself doesn’t support it. So trying to connect to freenode on port 7000 for an SSL-encrypted connection will not work.
To get SSL/TLS support for ii, we need to use a program that can add SSL/TLS functionality to a program, I came across a guide online that used OpenBSD’s relayd, unfortunately, I couldn’t find any package for ArchLinux so I settled for stunnel instead. Using stunnel for ii on ArchLinux is pretty straight-forward. Install from the official Arch repo and then create a config file as follows:
Afterwards, start the stunnel systemd service by running:
You can then start ii and connect for example to freenode using port 6697(6667) for a SSL-encrypted connection:
Now, entering the above command everytime you need to connect to an IRC network seems cumbersome, I wrote a small script to automate the process of connecting to a typical IRC network like freenode, identifying your nick, and then connecting to any chat channel of your choosing. The script below connects to the freenode IRC network through SSL (you must have the stunnel service running before running this script), and connects to the archlinux and android freenode channels.
Once you get ii up and running, you can watch conversations on a chat channel by running:
in a terminal.
Now the above screenshot only shows one channel, meaning one would need to have multiple windows open for multiple chat channels, this is not a good way to work. Enter Multitail, which is a program that according to its website - “allows one to monitor logfiles and command output in multiple windows in a terminal, colorize, filter and merge”
Multitail is available in the official Arch repo and once installed, create a
.multitailrc file in your home directory with the following contents:
Afterwards, with the stunnel systemd service and ii running in the background, run the following in your terminal:
Screenshot of the above command in action is show below:
I run i3-wm on my Arch system, so I find it convenient to use a keybind for the multitail command , in my i3 config I have this line:
The line above launches a multitail window showing the archlinux and android IRC channels.
You can of course use multitail to monitor more than two IRC chat channels at the same time and also use it to manipulate colors and window positioning as you deem fit.
If you don’t want to ‘echo’ every IRC message, you can use vim, just cd into the
irc folder and open vim from there, type your message(s) and then switch to vim’s normal mode and press
: on your keyboard to enter command mode, then for example to post what you’ve just written in vim to the archlinux channel, type this
.w >> \#archlinux/in and press
Enter. That’s it, you can keep the vim window open to post messages to any other IRC chat channel..
I have to admit that setting IRC it (ii) up hasn’t been totally straight-forward and easy as I’d hoped mostly because it required taking some extra steps to get it working safely and securely, one positive is that the setting-up process led me to discover some amazing new handy applications like multitail, exciting to think of many other ways that I can utilize it in my workflow.