Difference between revisions of "Irssi"

From ArchWiki
Jump to: navigation, search
m (Installation: typo)
(Replaced with working systemd unit)
 
(102 intermediate revisions by 32 users not shown)
Line 1: Line 1:
 
[[Category:Internet Relay Chat]]
 
[[Category:Internet Relay Chat]]
 
[[bg:Irssi]]
 
[[bg:Irssi]]
 +
[[de:Irssi]]
 
[[es:Irssi]]
 
[[es:Irssi]]
 
[[fr:Irssi]]
 
[[fr:Irssi]]
 +
[[ja:Irssi]]
 
[[sv:Irssi]]
 
[[sv:Irssi]]
 
[[tr:Irssi]]
 
[[tr:Irssi]]
 
[[zh-CN:Irssi]]
 
[[zh-CN:Irssi]]
 
[[zh-TW:Irssi]]
 
[[zh-TW:Irssi]]
{{Article summary start}}
+
{{Related articles start}}
{{Article summary text|This article covers irssi installation and configuration.}}
+
{{Related|IRC channels}}
{{Article summary heading|Related}}
+
{{Related|IRC}}
{{Article summary wiki|IRC Channels}}
+
{{Related|WeeChat}}
{{Article summary wiki|IRC Channel}}
+
{{Related|HexChat}}
{{Article summary end}}
+
{{Related articles end}}
 +
[http://www.irssi.org/ irssi] is a modular, ncurses based IRC (Internet Relay Chat) client. It also supports [[Wikipedia:SILC_(protocol)|SILC]] and [http://www.icb.net/_jrudd/icb/protocol.html ICB] protocols via plugins.
  
[http://www.irssi.org/ irssi] is a modular, ncurses based IRC (Internet Relay Chat) client for UNIX systems. It also supports SILC and ICB protocols via plugins.
+
== Installation ==
  
==Installation==
+
[[Install]] the {{Pkg|irssi}} package.  
[[pacman|Install]] {{Pkg|irssi}}, available in the [[Official Repositories]].
+
  
You may also want to install [https://github.com/GutenYe/systemd-units/tree/master/irssi irssi-systemd].
+
Several scripts are available in the AUR under [https://aur.archlinux.org/packages/?O=0&K=irssi-script '''irssi-script'''], and in the [http://scripts.irssi.org/ irssi script repository].
  
==Configuration==
+
== Usage ==
Personal configuration file should be located at {{ic|~/.irssi/config}}. You can start irssi with an alternate config file using the {{ic|--config}} flag.
+
  
* You can use {{ic|/save}} to save your current configuration to the config file.
+
For a detailed introduction see the [http://irssi.org/documentation official documentation].
  
* You can save the location of your currently opened windows by entering {{ic|/layout save}}
+
{{Note|This section assumes you already know the basics of [[Wikipedia:Internet Relay Chat|IRC]] and have used other clients in the past}}
  
* It sometimes might happen that umlauts are not correctly displayed. To fix this problem you have to set the right encoding with the following commands directly in irssi.
+
A terminal multiplexer such as [[tmux]] or [[Screen]] is recommended. It allows the user to easily disconnect and reconnect to a session, and scripts such as [http://wouter.coekaerts.be/site/irssi/nicklist nicklist.pl] depend on a secondary window. To start irssi, run:
  
  /set recode_autodetect_utf8 ON
+
  $ irssi
/set recode_fallback CP1252
+
/save
+
  
===Auto-connect to #archlinux on startup===
+
=== Commands ===
Start irssi and then type the following in it:
+
{{bc|/server add -auto -network fn irc.freenode.net}}
+
{{ic|fn}} is a common abbreviation for the freenode network, but any preferred word can be substituted for it (e.g. {{ic|foo}}).
+
 
+
Now to automatically identify your nick for a given password, type:
+
/network add -nick user -autosendcmd "/^msg nickserv IDENTIFY *******" fn
+
where {{ic|user}} is the nick with which you registered to nickserv and {{ic|*******}} is the password for that nick, replace {{ic|fn}} with the word that you used in the first command (e.g foo) if that is the case.
+
{{Note|Password will be visible when you type it and also it can be seen in ~/.irssi/config, so you can omit this step if you want to.}}
+
/channel add -auto #archlinux fn
+
/channel add -auto #archlinux-offtopic fn
+
/save
+
/quit
+
 
+
===Hide joins, parts, and quits===
+
In order to ignore showing of joining,leaving,quiting of users for all channels type the following in irssi:
+
/ignore * joins
+
/ignore * parts
+
/ignore * quits
+
/save
+
  
==Basic Usage==
+
{| class="wikitable"
{{Note|This section assumes you already know the basics of [[Wikipedia:Internet Relay Chat|IRC]] and have used other clients in the past. For a more detailed introduction check the [http://irssi.org/documentation official documentation].}}
+
! style="font-weight: bold;" | Command
 
+
! style="font-weight: bold;" | Description
To start irssi issue the following command in a terminal:
+
{{bc|$ irssi}}
+
 
+
Many people prefer to run irssi within a terminal multiplexer since some scripts like the [http://wouter.coekaerts.be/site/irssi/nicklist nicklist.pl] script are dependent on a secondary window. Additionally, it allows the user to easily disconnect and reconnect to a session. Therefore, it is recommended that you select a multiplexer (e.g. [[GNU Screen]] or [[tmux]]) and review how it functions.
+
 
+
===Commands===
+
{|
+
|-
+
!width= 100 |
+
!width= 65 |
+
!
+
|-
+
|colspan="3"|'''Connection'''
+
|-
+
| {{ic|/server}}
+
| {{ic|/s}}
+
| These change the server of the current network.
+
 
|-
 
|-
| {{ic|/connect}}
+
| {{ic|/server}}, {{ic|/s}}
| {{ic|/c}}
+
| Change the server of the current network.
| These open a new connection to a server. This is what you want to use in order to connect to multiple servers simultaneously (Ctrl+X switches between multiple servers).
+
 
|-
 
|-
| {{ic|/disconnect}}
+
| {{ic|/connect}}, {{ic|/c}}
| {{ic|/dc}}
+
| Open a new connection to a server. This is used to connect to multiple servers simultaneously ({{ic|Ctrl+Shift+x}} switches between multiple servers).
| These close the current connection to a server.
+
 
|-
 
|-
|colspan="3"|'''Movement'''
+
| {{ic|/disconnect}}, {{ic|/dc}}
 +
| Closes the current connection to a server.
 
|-
 
|-
| colspan="2" | {{ic|ALT+(1-0,q-p,etc)}}
+
| {{ic|ALT+(1-0,q-p,etc)}}
| Changes the currently active window. Or use Ctrl+n for the next window or Ctrl+p for the previous window.  
+
| Changes the currently active window. {{ic|Ctrl+n}} cycles to the next window, {{ic|Ctrl+p}} to the previous window.  
 
|-
 
|-
 
| {{ic|/window 1}}
 
| {{ic|/window 1}}
| {{ic|/w 1}}
+
| Go to the first window. Windows are ordered by the first two rows on the keyboard: (1-0), (q-p).
| Takes you to the first window. Windows go from are numbered across the top of your keyboard (1-0) and then start on the next row down (q-p).
+
 
|-
 
|-
| {{ic|/window close}}
+
| {{ic|/window close}}, {{ic|/wc}}
| {{ic|/wc}}
+
| Close the current window.
| These close the current window.
+
 
|-
 
|-
 
| {{ic|/window move 1}}
 
| {{ic|/window move 1}}
| {{ic|/w move 1}}
+
| Move the current window to the first window position.
| These move the current window to the first window position.
+
 
|-
 
|-
| colspan="2" | {{ic|/layout save}}
+
| {{ic|/layout save}}
| This will save the current window positions for the next time you start irssi.
+
| Save the current window positions for later use.
 
|-
 
|-
|colspan="3"|'''Miscellaneous'''
+
| {{ic|/set}}
 +
| Show a list of current settings.
 
|-
 
|-
| colspan="2" | {{ic|/set}}
+
| {{ic|/help}}
| This shows a list of all your current settings.
+
| Describe a provided parameter.
 
|-
 
|-
| colspan="2" | {{ic|/help}}
+
| {{ic|/alias}}
| This provides a helpful description/explanation for whatever parameter provided.
+
| Create a shortcut.
|-
+
| colspan="2" | {{ic|/alias}}
+
| Lets you create your own shortcuts.
+
 
|}
 
|}
  
== Script installation ==
+
== Configuration ==
As an example, this section will outline the installation of a spell checking script.
+
  
Install {{Pkg|ispell}}, an interactive spell-checking program for Unix:
+
Personal configuration file should be located at {{ic|~/.irssi/config}}; there is a template available in {{ic|/etc/irssi.conf}}. You can start irssi with an alternate config file using the {{ic|--config}} flag.
# pacman -S ispell
+
  
Create a directory to hold your irssi scripts and within that, a directory that contains scripts which will be automatically run when starting irssi:
+
* You can use {{ic|/save}} to save your current configuration to the config file.
$ mkdir -p ~/.irssi/scripts/autorun
+
* You can save the location of your currently opened windows by entering {{ic|/layout save}}
  
Download the irssi spell-checking script, {{ic|spell.pl}} into the script directory:
+
=== Authenticating with SASL ===
$ cd ~/.irssi/scripts
+
$ wget http://scripts.irssi.org/scripts/spell.pl .
+
  
As root run the following command:
+
{{Tip|Irssi version 0.8.18 now supports built-in SASL.}}
# perl -MCPAN -e 'install Lingua::Ispell'
+
If you do not want to use CPAN review [http://search.cpan.org/~jdporter/Lingua-Ispell-0.07/lib/Lingua/Ispell.pm].
+
  
Start irssi and load the spell-checking script:
+
In order to add network with sasl mechanism here's an example:
{{hc|/script load spell.pl|- - Irssi: Loaded script spell}}
+
  
Bind {{Keypress|Alt + s}} to spell check your current line.
+
/SERVER ADD -auto -ssl -ssl_verify -ssl_capath /etc/ssl/certs -network freenode -port 6697 irc.freenode.net
  /bind meta-s /_spellcheck
+
  /NETWORK ADD -sasl_mechanism plain -sasl_username <username> -sasl_password <password> freenode
  
If you want to autorun the script when you start irssi, just link the script into the autorun folder:
 
$ cd ~/.irssi/scripts/autorun/
 
$ ln -s ../spell.pl .
 
  
==HTTP Proxy==
+
 
 +
{{Note|
 +
* Make sure to use the correct capitalization for the network name.
 +
* First command line is for adding server with [[#SSL Connection]]
 +
* If you have an existing network, then type second command line only.
 +
* If your password contains {{ic|$}}, you have to prefix it with another {{ic|$}} for ''irssi'' to properly parse it.}}
 +
 
 +
Restart irssi, connect network and look for "SASL authentication succeeded".
 +
 
 +
=== Automatically connect to #archlinux on startup ===
 +
 
 +
Start irssi and then type the following in it:
 +
 
 +
/server add -auto -network freenode chat.freenode.net
 +
 
 +
{{ic|freenode}} can be substituted for any preferred word, such as the common abbreviation {{ic|fn}}.
 +
 
 +
Ensure [[#Authenticating with SASL|SASL]] is configured correctly. You may use NickServ manually with {{ic|-autosendcmd}} instead of SASL, but this causes a race condition when automatically joining channels. If desired, authenticate using SSL certificates, instead of passwords with NickServ.
 +
 
 +
/channel add -auto #archlinux freenode
 +
/channel add -auto #archlinux-offtopic freenode
 +
 
 +
=== SSL Connection ===
 +
 
 +
Freenode uses port 6697, 7000 and 7070 for SSL connections ('''not''' 6667). To connect to Freenode IRC network via SSL you have to setup an new connection. Start {{ic|irssi}} and run:
 +
 
 +
/server add -auto -ssl -ssl_verify -ssl_capath /etc/ssl/certs -network freenode -port 6697 chat.freenode.net
 +
 
 +
Save your new settings with:
 +
 
 +
/save
 +
 
 +
If everything works you will see the "Z" mode set. It should look like this: "Mode change (+Zi) for user your-nick"
 +
 
 +
==== Client certificates ====
 +
 
 +
Freenode and OFTC support authentication using SSL certificates, providing an alternative to plaintext passwords. See Freenode's [https://freenode.net/certfp/ Identifying with CERTFP] and [https://freenode.net/certfp/makecert.shtml Creating an SSL Certificate] for more extensive details.
 +
 
 +
To create an password-less certificate that is valid for 730 days (when requested to enter details like state or even Common Name (CN), you can fill anything you want):
 +
 
 +
$ openssl req -newkey rsa:2048 -days 730 -x509 -keyout irssi.key -out irssi.crt -nodes
 +
$ cat irssi.crt irssi.key > ~/.irssi/irssi.pem
 +
$ chmod 600 ~/.irssi/irssi.pem
 +
$ rm irssi.crt irssi.key
 +
 
 +
Next, find out the corresponding fingerprint:
 +
 
 +
$ openssl x509 -sha1 -fingerprint -noout -in ~/.irssi/irssi.pem | sed -e 's/^.*=//;s/://g;y/ABCDEF/abcdef/'
 +
 
 +
This will write the fingerprint to stdout. (The sed command is there to format the fingerprint correctly by removing unwanted text and characters.)
 +
Copy the fingerprint string as you will register it in irssi shortly.
 +
 
 +
In irssi, disconnect from the network and add the client certificate and keys. Omit the -ssl_pass option if your certificate was built without a password:
 +
 
 +
/disconnect Freenode
 +
/server add -ssl_cert ~/.irssi/irssi.pem  -ssl_pass <irssi.pem_password> -network freenode chat.freenode.net 6697
 +
 
 +
Now connect (not {{ic|/reconnect}}) and register your fingerprint
 +
 
 +
/connect Freenode
 +
/msg NickServ identify YOUR_PASSWORD
 +
/msg NickServ cert add YOUR_FINGERPRINT
 +
 
 +
At this point, you can remove your password from the configuration file (if you saved it in there) and save your config with:
 +
 
 +
/save
 +
 
 +
=== Automatic logging ===
 +
 
 +
/SET autolog ON
 +
/save
 +
 
 +
=== Hide joins, parts, and quits ===
 +
 
 +
In order to ignore showing of joining, leaving and quiting of users for all channels type the following in irssi:
 +
 
 +
/ignore * joins
 +
/ignore * parts
 +
/ignore * quits
 +
 
 +
See [https://github.com/lifeforms/irssi-smartfilter smartfilter] to restrict join messages to active users.
 +
 
 +
== Tips and tricks ==
 +
 
 +
=== HTTP Proxy ===
  
 
To use ''irssi'' behind a HTTP proxy, the following commands are required:
 
To use ''irssi'' behind a HTTP proxy, the following commands are required:
 +
 
  /SET use_proxy ON
 
  /SET use_proxy ON
 
  /SET proxy_address <Proxy host address>
 
  /SET proxy_address <Proxy host address>
Line 165: Line 197:
 
{{Note|SSL behind a proxy will fail with these settings.}}
 
{{Note|SSL behind a proxy will fail with these settings.}}
  
==irssi with nicklist in tmux ==
+
=== irssi with nicklist in tmux ===
  
 
The ''irssi'' plugin '[http://scripts.irssi.org/scripts/nicklist.pl nicklist]' offers to add a pane listing the users on the channel currently viewed. It has two methods to do this:
 
The ''irssi'' plugin '[http://scripts.irssi.org/scripts/nicklist.pl nicklist]' offers to add a pane listing the users on the channel currently viewed. It has two methods to do this:
Line 183: Line 215:
 
  #!/bin/bash
 
  #!/bin/bash
 
   
 
   
  T3=$(pidof irssi)
+
  T3=$(pgrep -u $USER -x irssi)
 
   
 
   
 
  irssi_nickpane() {
 
  irssi_nickpane() {
Line 208: Line 240:
 
  exit 0
 
  exit 0
  
==Virtual hostname (vhost)==
+
{{Tip|Instead of doing all this work, [http://anti.teamidiot.de/static/nei/*/Code/Irssi/tmux-nicklist-portable.pl this plugin] does all the work needed for a nice nicklist inside tmux.}}
 +
 
 +
=== Virtual hostname (vhost) ===
 +
 
 
A vhost can be used to change your hostname when connected to an IRC-server, commonly viewed when joining/parting or doing a whois. This is most commonly done on a server which have a static IP address. Without a vhost it would commonly look like so when doing a 'whois':
 
A vhost can be used to change your hostname when connected to an IRC-server, commonly viewed when joining/parting or doing a whois. This is most commonly done on a server which have a static IP address. Without a vhost it would commonly look like so when doing a 'whois':
 +
 
  nick@123.456.78.90.isp.com
 
  nick@123.456.78.90.isp.com
 +
 
The result of a successfull vhost could be like so if you have the domain example.com available:
 
The result of a successfull vhost could be like so if you have the domain example.com available:
 +
 
  nick@example.com
 
  nick@example.com
Keep in mind that not every IRC-server supports the use of vhost. This might be individually set between the servers and not the network, so if you're experiencing issues with one server try another on the same network.
 
  
===Required preconfigurations===
+
Keep in mind that not every IRC-server supports the use of vhost. This might be individually set between the servers and not the network, so if you are experiencing issues with one server try another on the same network.
irssi supports using a vhost as long as the required configurations has been set. This includes especially that your host supports [https://en.wikipedia.org/wiki/Reverse_DNS_lookup Recursive DNS Lookup (rDNS)] using [https://en.wikipedia.org/wiki/List_of_DNS_record_types Pointer record (PTR)]. Additionally you should add an appropriate line to your /etc/hosts file.  
+
 
 +
==== Required preconfigurations ====
 +
 
 +
irssi supports using a vhost as long as the required configurations has been set. This includes especially that your host supports [[wikipedia:Reverse_DNS_lookup|Recursive DNS Lookup (rDNS)]] using [[wikipedia:List_of_DNS_record_types|Pointer record (PTR)]]. Additionally you should add an appropriate line to your {{ic|/etc/hosts}} file.  
 +
 
 +
To see if this is working, test with the 'host' DNS lookup utility included in {{Pkg|bind-tools}} like so (where ''ip'' is a normal IPv4 address):
 +
 
 +
host ''ip''
  
To see if this is working, test with the 'host' DNS lookup utility included in [https://www.archlinux.org/packages/?sort=&q=dnsutils&maintainer=&last_update=&flagged=&limit=50 dnsutils] like so (where <ip> is a normal IPv4 address):
 
host <ip>
 
 
If this returns something in the lines of this then you know that your rDNS is working.
 
If this returns something in the lines of this then you know that your rDNS is working.
<ip>.in-addr.arpa domain name pointer example.com
 
  
===Enabling the vhost===
+
''ip''.in-addr.arpa domain name pointer example.com
 +
 
 +
==== Enabling the vhost ====
 +
 
 
There are a couple of ways to connect to a server with a given hostname. One is using the 'server' command with a -host argument like so:
 
There are a couple of ways to connect to a server with a given hostname. One is using the 'server' command with a -host argument like so:
 
  /server -host example.com irc.freenode.org
 
  /server -host example.com irc.freenode.org
Another way would be to set your hostname (vhost) with the 'set' command which will save your hostname to ~/.irssi/config:
+
Another way would be to set your hostname (vhost) with the 'set' command which will save your hostname to {{ic|~/.irssi/config}}:
 +
 
 
  /set hostname example.com
 
  /set hostname example.com
 
  /save
 
  /save
 
  /server irc.freenode.org
 
  /server irc.freenode.org
  
==See also==
+
== See also ==
* [http://linuxtidbits.wordpress.com/2008/01/09/setting-up-irssi/ Setting Up Irssi] post on Helpful Linux Tidbits
+
 
* [http://quadpoint.org/articles/irssi Guide to Efficiently Using Irssi & Screen] page by Matt Sparks
+
* [http://www.irssi.org/ Official website]
* [http://scripts.irssi.org/ Official List of Irssi Scripts]
+
* [http://linuxtidbits.wordpress.com/2008/01/09/setting-up-irssi/ Setting up Irssi]
* [http://jasonwryan.com/post/12460674834/inotify IRC notifications with dzen2] post by Jason Ryan
+
* [http://quadpoint.org/articles/irssi Guide to efficiently using Irssi and screen] by Matt Sparks
* [http://pthree.org/2010/02/02/irssis-channel-network-server-and-connect-what-it-means/ Irssi’s /channel, /network, /server and /connect – What It Means] post by Aaron Toponce
+
* [http://scripts.irssi.org/ Official List of Irssi scripts]
 +
* [http://jasonwryan.com/blog/2011/11/07/irc-dzen/ IRC notifications with dzen2] by Jason Ryan
 +
* [http://pthree.org/2010/02/02/irssis-channel-network-server-and-connect-what-it-means/ Irssi’s /channel, /network, /server and /connect – What it means] by Aaron Toponce
 +
* [http://awesome.naquadah.org/wiki/Irssi_tips awesome Wiki Irssi tips]
 +
* [https://gist.github.com/drye/5520101 irssi systemd unit]

Latest revision as of 12:07, 1 April 2016

Related articles

irssi is a modular, ncurses based IRC (Internet Relay Chat) client. It also supports SILC and ICB protocols via plugins.

Installation

Install the irssi package.

Several scripts are available in the AUR under irssi-script, and in the irssi script repository.

Usage

For a detailed introduction see the official documentation.

Note: This section assumes you already know the basics of IRC and have used other clients in the past

A terminal multiplexer such as tmux or Screen is recommended. It allows the user to easily disconnect and reconnect to a session, and scripts such as nicklist.pl depend on a secondary window. To start irssi, run:

$ irssi

Commands

Command Description
/server, /s Change the server of the current network.
/connect, /c Open a new connection to a server. This is used to connect to multiple servers simultaneously (Ctrl+Shift+x switches between multiple servers).
/disconnect, /dc Closes the current connection to a server.
ALT+(1-0,q-p,etc) Changes the currently active window. Ctrl+n cycles to the next window, Ctrl+p to the previous window.
/window 1 Go to the first window. Windows are ordered by the first two rows on the keyboard: (1-0), (q-p).
/window close, /wc Close the current window.
/window move 1 Move the current window to the first window position.
/layout save Save the current window positions for later use.
/set Show a list of current settings.
/help Describe a provided parameter.
/alias Create a shortcut.

Configuration

Personal configuration file should be located at ~/.irssi/config; there is a template available in /etc/irssi.conf. You can start irssi with an alternate config file using the --config flag.

  • You can use /save to save your current configuration to the config file.
  • You can save the location of your currently opened windows by entering /layout save

Authenticating with SASL

Tip: Irssi version 0.8.18 now supports built-in SASL.

In order to add network with sasl mechanism here's an example:

/SERVER ADD -auto -ssl -ssl_verify -ssl_capath /etc/ssl/certs -network freenode -port 6697 irc.freenode.net
/NETWORK ADD -sasl_mechanism plain -sasl_username <username> -sasl_password <password> freenode


Note:
  • Make sure to use the correct capitalization for the network name.
  • First command line is for adding server with #SSL Connection
  • If you have an existing network, then type second command line only.
  • If your password contains $, you have to prefix it with another $ for irssi to properly parse it.

Restart irssi, connect network and look for "SASL authentication succeeded".

Automatically connect to #archlinux on startup

Start irssi and then type the following in it:

/server add -auto -network freenode chat.freenode.net

freenode can be substituted for any preferred word, such as the common abbreviation fn.

Ensure SASL is configured correctly. You may use NickServ manually with -autosendcmd instead of SASL, but this causes a race condition when automatically joining channels. If desired, authenticate using SSL certificates, instead of passwords with NickServ.

/channel add -auto #archlinux freenode
/channel add -auto #archlinux-offtopic freenode

SSL Connection

Freenode uses port 6697, 7000 and 7070 for SSL connections (not 6667). To connect to Freenode IRC network via SSL you have to setup an new connection. Start irssi and run:

/server add -auto -ssl -ssl_verify -ssl_capath /etc/ssl/certs -network freenode -port 6697 chat.freenode.net

Save your new settings with:

/save

If everything works you will see the "Z" mode set. It should look like this: "Mode change (+Zi) for user your-nick"

Client certificates

Freenode and OFTC support authentication using SSL certificates, providing an alternative to plaintext passwords. See Freenode's Identifying with CERTFP and Creating an SSL Certificate for more extensive details.

To create an password-less certificate that is valid for 730 days (when requested to enter details like state or even Common Name (CN), you can fill anything you want):

$ openssl req -newkey rsa:2048 -days 730 -x509 -keyout irssi.key -out irssi.crt -nodes 
$ cat irssi.crt irssi.key > ~/.irssi/irssi.pem
$ chmod 600 ~/.irssi/irssi.pem
$ rm irssi.crt irssi.key

Next, find out the corresponding fingerprint:

$ openssl x509 -sha1 -fingerprint -noout -in ~/.irssi/irssi.pem | sed -e 's/^.*=//;s/://g;y/ABCDEF/abcdef/'

This will write the fingerprint to stdout. (The sed command is there to format the fingerprint correctly by removing unwanted text and characters.) Copy the fingerprint string as you will register it in irssi shortly.

In irssi, disconnect from the network and add the client certificate and keys. Omit the -ssl_pass option if your certificate was built without a password:

/disconnect Freenode
/server add -ssl_cert ~/.irssi/irssi.pem  -ssl_pass <irssi.pem_password> -network freenode chat.freenode.net 6697

Now connect (not /reconnect) and register your fingerprint

/connect Freenode
/msg NickServ identify YOUR_PASSWORD
/msg NickServ cert add YOUR_FINGERPRINT

At this point, you can remove your password from the configuration file (if you saved it in there) and save your config with:

/save

Automatic logging

/SET autolog ON
/save

Hide joins, parts, and quits

In order to ignore showing of joining, leaving and quiting of users for all channels type the following in irssi:

/ignore * joins
/ignore * parts
/ignore * quits

See smartfilter to restrict join messages to active users.

Tips and tricks

HTTP Proxy

To use irssi behind a HTTP proxy, the following commands are required:

/SET use_proxy ON
/SET proxy_address <Proxy host address>
/SET proxy_port <Proxy port>
/SET -clear proxy_string
/SET proxy_string_after conn %s %d
/EVAL SET proxy_string CONNECT %s:%d HTTP/1.0\n\n

irssi should then alter its config file correspondingly; if the proxy is not required, just set use_proxy to OFF.

Should the proxy require a password, try:

/SET proxy_password your_pass

Otherwise:

/SET -clear proxy_password
Note: SSL behind a proxy will fail with these settings.

irssi with nicklist in tmux

The irssi plugin 'nicklist' offers to add a pane listing the users on the channel currently viewed. It has two methods to do this:

  • screen, which simply adds the list to the right of irssi, but brings the disadvantage that the entire window gets redrawn every time irssi prints a line.
  • fifo, which like the name suggests writes the list into a fifo that can then be continuously read with e. g. cat ~/.irssi/nicklistfifo.

nicklist will use the more efficient fifo with:

/NICKLIST FIFO

This fifo can be used in a tmux window split vertically with irssi in its left pane and the cat from above in a small one in its right. Since the pane is dependent on its creating tmux session's geometry, a subsequent session with a different one needs to recreate it (which also implies a switch in irssi windows to refill the fifo).

E. g., the following script first checks for a running irssi, presumed to have been run by a previous execution of itself. Unless found it creates a new tmux session, a window named after and running irssi and then the pane with cat. If however irssi was found it merely attaches to the session and recreates the cat pane.

#!/bin/bash

T3=$(pgrep -u $USER -x irssi)

irssi_nickpane() {
    tmux setw main-pane-width $(( $(tput cols) - 21));
    tmux splitw -v "cat ~/.irssi/nicklistfifo";
    tmux selectl main-vertical;
    tmux selectw -t irssi;
    tmux selectp -t 0;
}

irssi_repair() {
    tmux selectw -t irssi
    (( $(tmux lsp | wc -l) > 1 )) && tmux killp -a -t 0
    irssi_nickpane
}

if [ -z "$T3" ]; then
    tmux new-session -d -s main;
    tmux new-window -t main -n irssi irssi;
    irssi_nickpane ;
fi
    tmux attach-session -d -t main;
    irssi_repair ;
exit 0
Tip: Instead of doing all this work, this plugin does all the work needed for a nice nicklist inside tmux.

Virtual hostname (vhost)

A vhost can be used to change your hostname when connected to an IRC-server, commonly viewed when joining/parting or doing a whois. This is most commonly done on a server which have a static IP address. Without a vhost it would commonly look like so when doing a 'whois':

nick@123.456.78.90.isp.com

The result of a successfull vhost could be like so if you have the domain example.com available:

nick@example.com

Keep in mind that not every IRC-server supports the use of vhost. This might be individually set between the servers and not the network, so if you are experiencing issues with one server try another on the same network.

Required preconfigurations

irssi supports using a vhost as long as the required configurations has been set. This includes especially that your host supports Recursive DNS Lookup (rDNS) using Pointer record (PTR). Additionally you should add an appropriate line to your /etc/hosts file.

To see if this is working, test with the 'host' DNS lookup utility included in bind-tools like so (where ip is a normal IPv4 address):

host ip

If this returns something in the lines of this then you know that your rDNS is working.

ip.in-addr.arpa domain name pointer example.com

Enabling the vhost

There are a couple of ways to connect to a server with a given hostname. One is using the 'server' command with a -host argument like so:

/server -host example.com irc.freenode.org

Another way would be to set your hostname (vhost) with the 'set' command which will save your hostname to ~/.irssi/config:

/set hostname example.com
/save
/server irc.freenode.org

See also