Irssi

From Ambernet
Jump to: navigation, search

Irssi is a powerful and terminal based IRC client which runs on most UNIX-like operating systems.

Amongst other things, Irssi supports:

  • Perl scripting - there are plenty of scripts
  • Modules - there is also support for loadable c modules
  • irssi-proxy - a powerful built-in bouncer (/load proxy) which you can connect to using any IRC client.
  • Logging - Irssi can be set to automatically log whatever channels, queries or other windows you want.
  • Themes - there are plenty of themes


Contents

Advantages

  • All the things already listed
  • Large user base, active coders
  • Terminal based - one can IRC anywhere using ssh and screen.

Disadvantages

  • As far as I know, there is no GUI available[1]

Example usage

Listed below are examples of Irssi usage. Please remember to issue /save when you have modified your Irssi configuration. Neglicting to /save will cause Irssi to revert to the latest saved settings next time you start the client.

For more information on the commands listed in the examples below, use Irssi's /help command, eg. /help server

Adding networks and servers

In order to have Irssi connect to Ambernet (and be able to autolog properly) we will have to add Ambernet to Irssi's list of networks. We use /network to do this:

/network add Ambernet

We will use /server to add an IRC server to our network. We could go ahead and add every Ambernet server to the list, but since Ambernet has a round-robin address, irc.ambernet.org, we might as well just use that to connect to a random Ambernet server:

/server add -network Ambernet irc.ambernet.org

Now you can connect to Ambernet:

/connect Ambernet

Automatically joining channels

One can make Irssi automatically join a channel by adding the channel to Irssi's channel list. We do this using /channel:

/channel add -auto #beginner Ambernet

The -auto switch will make Irssi automatically join the channel upon connect. It will also automatically join the channel upon /invite[2].

One can also use /channel to send commands to bots upon joining a specified channel, see /help channel for more information.

Logging

I use the following settings to automatically log all channels and queries into ~/irclogs/Network/#channel/#channel-YYYY-MM-DD.log and ~/irclogs/Network/nick/nick-YYYY-MM-DD.log respectively. To achieve this, use the following commands:

/set autolog_path ~/irclogs/$tag/$0/${0}-%Y-%m-%d.log
/set autolog on

Compressing logs

You may find, after a couple of months of logging, that your logs are starting to take up a lot of disk space. In that case you may want to consider compressing your log files. To compress my Irssi log files I use find, date and bzip2 in conjunction:

find ~/irclogs/ -type f ! -iname '*bz2' ! -path '*`date +%Y-%m-%d`.log' -exec bzip2 {} \;

The above command is supposed to be issued on your shell, not in irssi. It would compress all logs in the ~/irclogs/ directory, along with its subdirectories, except the logs of the current day (in case Irssi needs to write more data to them.)

There is an script that does this automatically upon log rotation, but I do not know if it works.

Tips and tricks

Starting Irssi at boot

One can use crontab's special string @reboot to make Irssi start at system boot. For example:

@reboot    /usr/local/bin/screen -d -m -S irssi /usr/local/bin/irssi
Note: On some machines the above crontab entry results in a screened irssi session without colour support. If anyone know of a solution, please speak up.

Notes

  1. At least not one with active developers
  2. To prevent Irssi from joining added channels upon invite, /set join_auto_chans_on_invite OFF

See also

External links

Personal tools