Irssi screen

From Bytesized Wiki

Revision as of 16:08, 6 January 2011 by Animazing (Talk | contribs)
Jump to: navigation, search

Irssi is a command line IRC client, GNU screen is an application that keeps your programs running even when you're not logged in. Combined with SSH, this means that you'll never have to be disconnected from IRC again :)

On linux or MacOS you can simply open a terminal (Applications -> Utilities -> Terminal in MacOS).

On Windows you can install PuTTY, a ssh client.


SSHing into your box

On Linux or MacOS

Open a terminal:

 ssh [email protected]

If it's the first time you've connected, you will be shown the RSA fingerprint for BySH, just type "yes" to continue.

then type in your password (this will not be echoed)

To Log In Without A Password

 ssh-keygen -t rsa

just press enter until the script finishes

Create a .ssh directory in your home folder on the server

 ssh [email protected] mkdir -p .ssh

Append your public key into ~/.ssh/authorized_keys

 at .ssh/ | ssh [email protected] 'cat >> .ssh/authorized_keys'

On Windows with PuTTY'

open putty.exe


enter the server as described on your Dashboard and click "Open"

If a security alert opens, click "Yes".

A command shell will then open, type in your Username and then your Password (you won't see anything as you type)

You will then get a linux command prompt

Starting Screen, some basic screen commands

To start screen for the first time, just type:
[email protected]:~$ screen
To resume a previous screen session, just type:
[email protected]:~$ screen -raAd 
(r-resume aA- some resizing d- detatch any remote sessions you may have left open elsewhere)
  • Important:* do not start multiple screens, this will just lead to insane confusion and (possibly) overuse of system resources

Your screen session behaves exactly like a normal linux TTY, except you can detach it and reattach it from anywhere, meaning anything you may be doing will not be killed when you disconnect from SSH, this is ideal for IRC ;)

Some screen commands: Ctrl-a-d: detaches your screen Ctrl-a-c: creates a new window within your screen Ctrl-a-<number>: switches to a different window within your screen Ctrl-a-a: switches back to the previous window you were viewing Ctrl-a-n: switches to the next window Ctrl-a-p: switches to the previous window

Starting irssi

irssi is a command line only IRC client, it is ideally suited for ssh shells.

To start irssi: [email protected]:~$ irssi

This will automatically connect you to the BySH IRC server, and you can start chatting instantly :)


Window 1 is the status window, this will show notices, ctcps, whoises and connection stuff (like motds) The activity alert shows you what has happened: if it's blue, someone has joined/parted/quit/changed nick if it's white, someone has said something if it's red, someone has said your nick

Some irssi commands:

PageUp: scrolls up PageDown: scrolls down Ctrl-n: moves to the next window Ctrl-p: moves to the previous window Alt-<number>: jumps to window no. <number> /wc: closes the current window /connect connects to a different IRC server, without closing current connections /n: list users in the current channel

Some irssi configuration options: Show seconds in time stamps: /set timestamp_format %H:%M:%S

Change the highlight colour: /set hilight_color %colourcode

Colours are:
%k      black           %K        dark grey
%r      red             %R        bold red
%g      green           %G        bold green
%y      yellow          %Y        bold yellow
%b      blue            %B        bold blue
%m      magenta         %M        bold magenta
%p      magenta (think: purple)
%c      cyan            %C        bold cyan
%w      white           %W        bold white

Change the activity alert colour for highlights: /set hilight_act_color %colourcode

Configuring auto-connect to networks, channels and auto-identifying to NickServ

To set up autoconnection to IRC network: on port 6667 (default for most IRC servers), auto-joining channel: #channel and identifying to NickServ when connected.

/NETWORK ADD -autosendcmd "/^msg NickServ IDENTIFY PASSWORD;wait 2000" ExampleNetwork /SERVER ADD -auto -network ExampleNetwork 6667 /CHANNEL ADD -auto #channel ExampleNetwork

Irssi advanced configuration: scripting irssi uses perl scripting to extend functionality, and basic .theme files to change colour schemes. You can find scripts at "": and themes at "": or you can even create your own :)

Some useful scripts: "screen_away": this automatically sets your status to away when you detach your screen "active_notice": prints notices in the window you are currently viewing rather than the status window "trackbar": shows a line where you last read a channel "adv_windowlist":*/Code/Irssi/ see later for description "autorejoin": auto rejoins you when kicked

to install a script, place it in ~/.irssi/scripts/ this may need to be created if it doesn't already exist [email protected]:~$ cd ~/.irssi [email protected]:~$ mkdir scripts [email protected]:~$ cd scripts [email protected]:~$ wget URL_of_script

to load the script in irssi, type: /script load

to autoload scripts when you start up irssi (not that you'll ever have to stop irssi ;)) symlink them in ~/.irssi/scripts/autorun [email protected]:~$ cd ~/.irssi/scripts [email protected]:~$ mkdir autorun [email protected]:~$ cd autorun [email protected]:~$ ln -s ../ .

Advanced Windowlist

Remove the standard activity notice element, advanced windowlist gives you a much better way to deal with the same thing :) /statusbar window remove act you may need to play around with /statusbar to get everything exactly to your liking

Highlight notifications on your local machine _This has only been tested on Linux + Gnome_ _It will definitely not work on windows_

"fnotify": is a script that writes highlights into ~/.irssi/fnotify save this in ~/.irssi/scripts/, symlink it in autorun and load it in irssi (See above).

notify-send is a linux command that sends notifications to your desktop environment, you can test that it is working/installed by typing: notify-send test into a terminal. If it doesn't work, you need to google around for how to enable notify-send on your box.

If it does work, you can then write a bash script on your local machine that will check this file for new highlights (using the tail command) Paste this "code": into ~/ on your local machine, editing the connection info appropriately

then in a terminal, type: cd chmod 755 ./

You will now get nice notifications :)

Putty copy and paste Just highlight the text you want to copy with the cursor and it will be copied to the clipboard If you want to paste into putty, just right click

Screen Troubleshooting
Q. My screen is "still attached"!
A. [email protected]:~$ screen -dr
this will detach and reattach your screen session

Personal tools