• 

Using the 'Catgirl' IRC with Multiple Servers (Kind of)

Technology, IRC, Catgirl, Causal.Agency

0 Comments

Many people who use IRC have something in common: they usually participate in channels across multiple IRC servers and networks. Unfortunately for those users, the catgirl IRC client may seem too limited since it can only connect to a single SSL-enabled IRC server at a time.

A (Possible) Solution

After a bit of trial and error, a little while ago already, I wrote a simple script providing a suitable workaround. The workaround uses TMUX(1) and lets me take full advantage of the catgirl client while being on multiple servers.

The manpage for catgirl says you can specify config files when launching the IRC client, which I recommend using.

For example, you'll use the following command to load catgirl while auto-connecting to an example IRC network:

catgirl -e /home/<username>/.config/catgirl/example.cfg

The config file can have any extension, as long as the file is readable by catgirl. The contents of the sample config file would look like this:

host = irc.example.net
join = #example,#channel2,#cats
cert = /home/<username>/.config/catgirl/example.pem
timestamp = %X

Using TMUX(1)

I like using tmux over screen nowadays. It's simple to use, good with my machine's low system resources, and so on. To connect to one network, opening it in tmux, you will use the following command:

tmux new-session -d -s catgirl -n example 'catgirl -e /home/<username>/.config/catgirl/example.cfg'

To load multiple servers that you can switch between easily, you will use these commands:

tmux new-session -d -s catgirl -n example 'catgirl -e /home/<username>/.config/catgirl/example.cfg'
tmux new-window -n freenode -t catgirl: 'catgirl /home/<username>/.config/catgirl/freenode.cfg'
tmux new-window -n efnet -t catgirl: 'catgirl /home/<username>/.config/catgirl/efnet.cfg'
tmux new-window -n oftc -t catgirl: 'catgirl -e /home/<username>/.config/catgirl/oftc.cfg'
tmux new-window -n mynetwork -t catgirl: 'catgirl -e /home/<username>/.config/catgirl/mynetwork.cfg'

To make it easier, you can make a shell script to load all of your servers at one time, like the example below:

#!/bin/bash
tmux new-session -d -s catgirl -n example 'catgirl -e /home/<username>/.config/catgirl/example.cfg'
tmux new-window -n freenode -t catgirl: 'catgirl /home/<username>/.config/catgirl/freenode.cfg'
tmux new-window -n efnet -t catgirl: 'catgirl /home/<username>/.config/catgirl/efnet.cfg'
tmux new-window -n oftc -t catgirl: 'catgirl -e /home/<username>/.config/catgirl/oftc.cfg'
tmux new-window -n mynetwork -t catgirl: 'catgirl -e /home/<username>/.config/catgirl/mynetwork.cfg'

(Feel free to copy and paste that to a shell file and chmod +x filename.bash.)

And if you want to load this script as your server boots, as I've done in the past, you will use this command:

@reboot /home/<username>/.local/bin/catgirl.bash

Conclusion

Hopefully, this helped you get catgirl working on all your favorite IRC servers. If you want a more generic example for working with tmux, you can see my guide: Starting Programs on Boot/Reboot with Cron and Tmux.

Happy IRCing!


Copyright © 2021, Anton McClure. All Rights Reserved.



Recent Posts: