IRC in EKG2

This page is created basing on really nice [ to Efficiently Using Irssi and Screen].

As you probably know EKG2 is multiprotocol, plugin based, IM application. This page describes IRC plugin.

EKG2 doesn't have to be used in console, but still instructions written here should work despite of used UI plugin.

Basics

First check if you have irc plugin loaded using /plugin command. It should display list similar to the one below:

  004833 ::: rot13 - 20
  004833 ::: irc - 15
  004833 ::: gg - 15
  004833 ::: jabber - 15
  004833 ::: logsqlite - 5
  004833 ::: ncurses - 0

As you can see irc plugin is loaded, if it's not you can try loading it using /plugin +irc command.

Connection

Whole EKG2 is session based, so you have to create session for your connection using following command

  /session --add irc:IRCNet

irc: is protocol prefix, and it must be present, and IRCNet is the name of your session, name doesn't have any meaning and you can name it whatever you like. After session is added it's name should be visible in statusbar.

Now let's set up server and nickname and alternative nickname in case of collision

  /sesion server irc.ircnet.com 
  /session nickname R2D2
  /session alt_nick R2D12345

You don't have to set nickname, your system login will be used by default. Now you can finally issue:

  /connect

If everything went ok, you can try joining channel:

  /join !ekg2

Like in other IMers, you can start discussion on a channel by simply entering the text in command line and accepting it with Enter key.

Switching Windows

After joining channel the statusbar will change to something like:

   (01:09) (irc:IRCNet) (win/2:irc:!6e6wpekg2)

win/2 tells you, that current active window is window number 2.

Similarly as in irssi you can use Alt-1 through Alt-0 to switch between windows 1 through 10, and Alt-q through Alt-p to switch between windows 11 - 20.

If Alt combination are not working, it probably means your terminal is sending wrong codes. You can try using Esc-1 .. Esc-0 and Esc-q .. Esc-p instead of Alt combinations. They should work without a problem.

If you have more windows, you can use Ctrl-p and Ctrl-n for switching to previous and next window respectively.

Besides that you can try using:

  /window switch window_number

command. E.g:

  /window switch 1
  /window switch 2

Query Windows

After joining channel userlist on right side should show people present on given channel.

You can open private message window using command

  /query nickname
Irssi has /q alias, ekg2 doesn't have it but you can define it using alias command:
  /alias --add q query %1

Parting channels, closing windows

You can leave given channel using /part command. By default part leaves the window open.

You can close window using Alt-k (or Esc-k) or by using /window kill command. (Closing window forces part, so you don't have to issue /part)

irssi has /wc alias for closing windows, you can create it using command:
  /alias --add wc window kill

These were the basic now we'll learn more about ekg2 itself and irc plugin.

Gimme More

Changing settings

EKG2 has two type of variables:

  • session variables - we already saw them, they are set using session command, and
  • global variables - they are set using set command
    • global variables can be bounded to specific plugin, in that case they are preceeded with pluginname: string (e.g: ncurses: or gg:).

First let's change timestamp to a fancier one. There are two variables connected with timestamp. If you type /set time and press Tab key two times, you will see the list of possible variable names. Those are

  • timestamp - this defines a format of timestamp
  • timestamp_show - weather or not to show timestamp (on by default)

timestamp uses strftime for format, (take a look at manpage man 3 strftime) but each conversion specifier must be preceeded with '\'. I'm using the following timestamp:

  /set timestamp %C\%H%c\%M\%S%n
  • %C - tells to change colour to bright cyan
  • \%H - the hour as a decimal number using a 24-hour clock (take a look at mentioned manpage).
  • %c - tells to change colour to cyan
  • \%M - the minute as a decimal number
  • \%S - the second as a decimal number

Other fancy colours are %r%g%y%b%m%c%w (red, green, yellow, blue, magenta, cyan, white). Upper case causes use of bright colour, if you take next letter in alphabet you can change background colour, e.g:

  /set ncurses:display_transparent off
  /set timestamp %r%h\%H:\%M:\%S

will cause the trauma-looking red letters on green background ('h' is after 'g' :>)

There are some other formattes, but they will be described somewhere else.

Remember to /save your settings. You can also turn on auto saving using command:

  /set auto_save on

Tab completion

As you've been informed ekg2 has tab completion, but unfortunately curently you can't complete nicknames in the middle of sentece.

Scripting

EKG2 supports Perl and Python. Some example scripts can be found in contrib directory.

Using the built-in help

Yep, try uing it, it doesn't hurt:

  • /help itself will give you list of possible commands,
  • /help topic should give you more information about given command
  • /help set variable_name should give you information about given variable
  • /help session variable_name should give you information about given session variable
    • There's a little catch here, if your current active session is for example jid:john@doe.com asking for help about session AUTO_JOIN won't give you any help, since AUTO_JOIN is irc: session variable, (so active session must be irc session).

Encoding stuff

If you're sitting on channels with different encodings the following settings can become handy. Since ekg2 is developed in Poland

  • Assuming unicode terminal:
    /set console_charset utf-8
    /session recode_out_default_charset utf-8
    /session auto_guess_encoding utf-8,latin2
    /session recode_list LATIN2:#channel1,!32415channel2,nick_one;EBCDICUS:#channel3;KOI-8:Eugene
    
  • auto_guess_encoding causes to try to guess encoding of incoming messages,
  • recoude_out_default_charset you probably can figure it out from the name,
  • recode_list overrides default encoding per-channel, or per-person

Customizing display

themes

If you wanna REALLY customize look of EKG2, you'd have to create your own theme. There are some example themes in contrib directory.

To use given theme, first create directory themes in your ~/.ekg2 dir and copy given .theme-file there. Next set new theme using command:

  /set theme new_theme

Where new_theme is the name of the .theme-file.

ncurses UI stuff

First of all you probably want a header, and bigger statusbar so:

  /set ncurses:header_size 1
  /set ncurses:statusbar_size 2

If you're not used to contacts window you can hide it using F3 key. You can change it's size by changing ncurses:contacts_size variable.

Basic IRC Commands

Basic IRC commands works, this includes:

  • /join, /part, /cycle,
  • /op, /deop, /voice, /devoice, /halfop, /dehalfop,
  • /kick, /ban, /bankick, /kickban,
  • /names, /topic,
  • /whois, /wii, /whowas

Written by GiM, moved and formatted by Greyer