Edit History Actions Discussion

Diff for "Howto/IRC"

Differences between revisions 2 and 18 (spanning 16 versions)
Revision 2 as of 2006-07-28 15:49:03
Size: 2918
Comment:
Revision 18 as of 2008-08-13 11:35:33
Size: 7390
Comment: Lots of cleanup
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
#pragma keywords howto, irc, irssi, screen, gnu screen, tutorial
Line 2: Line 3:
== Lesson 1 ==
In this lesson, you will learn how to make some basic usage out of your new shell account. We will concentrate on how to connect to IRC with the IRC-client irssi and how to stay connected even when your computer is turned off via a helper program called screen. Start by logging in to your shell account and type the following command:
<<TableOfContents>>

== Screen + irssi = <3 ==
In this howto you will learn how to use your shell account for possibly the best IRC solution possible ;)
We will concentrate on how to connect to IRC with the IRC-client [[http://www.irssi.org/|irssi]] and how to stay connected even when your computer is turned off via a program called [[http://www.gnu.org/software/screen/|Screen]].

=== Screen ===

Screen is a program that creates a virtual terminal inside your shell. You can then "detach" or "attach" this virtual terminal when you log in and out from your shell account. The programs you have running inside the virtual terminal (screen) will keep running on the server after you've logged off. Perfect for IRC, this way you will always be able to see what's been said in the chat while you were away/sleeping etc.

Start by logging in to your shell account and type the following command:
Line 6: Line 16:
screen}}}
This will create a new screen. A screen is like a window that you can leave open on the server even when you disconnect. This is so that you can stay connected to IRC even when you disconnect from the shell server. You can now start a program in this new screen. Start the IRC-client irssi for examlple:
scr}}}

Scr is a little helper program for Screen that will either create a new screen, or if there already is one, resume the previous one.

You can now start a program in this new screen. You can start irssi for example:
Line 11: Line 24:
You can now start using IRC. But before you start using IRC let's see how you can disconnect from the shell and then resume the same screen as you just started! Start by closing the window you are connected with. Now let's connect to the shell again. When you have logged in, type this command to resume the screen you previously started:
You can now start chatting away, but before you start learning more about irssi let's see how you can disconnect from the shell and then resume the same screen as you just started!

You can either just close the terminal window, or press and hold ctrl and then press a followed by d (ctrl-a d) to detach the screen, and then type `exit` or `logout` to log out.

Now let's connect to the shell again. When you're in, use the `scr` command again to resume the previously started screen.
Line 14: Line 32:
screen -r}}}
Now you will be back in the program irssi you started before. This program kept running on the server the whole time you were disconnected! Let's now learn some basics of irssi. Start by logging in to the shell and resuming the screen if you're not already connected. In irssi there is a command promt at the bottom. This is where you write messages and type in commands. Before you can start chatting, you have to connect to an IRC server and join a channel. To do this, type the following commands:
scr}}}

Now you will be back in the program irssi you started before. This program kept running on the server the whole time you were disconnected!

To exit a screen (destroy it, not just detach), exit the programs running inside it (`/quit` in irssi) and then type `exit` or `logout`.

It's possible to have multiple screens running, but this is not recommended. It can get very confusing if you are new to screen. If you accidentaly do, just retach them one at a time and exit them. You can list all your screens with this command: `screen -ls`

To learn more about screen, take a look at the [[Howto/Screen| Screen Howto]].

=== Irssi ===

Let's now learn some basics of irssi. Start by logging in to the shell and resuming the screen if you're not already connected. In irssi there is a command promt at the bottom. This is where you write messages and type in commands.

Before you can start chatting, you have to connect to an IRC server and join a channel. If you use the standard config for irssi (which you probably do), then you won't have to connect manually. Instead you should automatically get connected to our home IRC network and joined into #blinkenshell.

I
f not (or if you want to learn how to connect to other IRC networks), use these commands to connect and join:
Line 18: Line 51:
/connect irc.shellsnet.org
/join #blinkenshell}}}
The first command connects to shellsnet IRC-server. This might take a couple of seconds, so wait a bit before typing in the next command. The next command will connect you to our IRC channel #blinkenshell. Now you are connected, and you have two "tabs" open in irssi. One with the server messages and one with our IRC-channel. To change between them press and hold the ALT-key while pressing the 1-9 on your keyboard. ALT-2 will change to the IRC-channel so you can start chatting. ALT-1 will change back to the server message tab. Go to the second tab with ALT-2 and say hello to us! When you want to turn off the computer just close the window and then resume the screen the next time you want to use IRC and your session of irssi will be there waiting for you, running at the server att all times!
/CONNECT mimas.blinkenshell.org
/JOIN #blinkenshell}}}

The first command connects to Allshells IRC-server. This might take a couple of seconds, so wait a bit before typing in the next command. The next command will join you to our IRC channel #blinkenshell.

Now you are connected, and you have two "windows" open in irssi. One with the server messages and one with #blinkenshell. To change between them press and hold the ALT-key while pressing the 1-9 on your keyboard. ALT-2 will change to the second window, which should be the #blinkenshell channel. ALT-1 will change back to the server message tab. Go to the second tab with ALT-2 and say hello to us! (You can also change windows by typing `/win 2` etc.)

When you want to turn off the computer just close the window and you can then resume the screen the next time you want to use IRC and your session of irssi will be there waiting for you, running at the server at all times!

You can connect to multiple networks by issuing the `/connect <server>` command several times. When you issue the join command, it will join the channel on the network that is currently selected. You can switch between the networks by pressing ctrl-x. To list all active connections to IRC networks, type `/server`.

If you have a couple of channels in irssi that you have configured with autoconnect, you might want them to appear in the same windows every time you start irssi. You can move your windows around by changing to the window you want to move, and issuing the command: `/window move 3` to move that window to position 3 for exmaple. You can then save the "layout" of your windows with the command: `/layout save`.
Line 23: Line 65:
Again, you don't have to do this if you already automatically gets connected to IRC.
Line 26: Line 70:
/SERVER ADD -auto -network ShellsNet irc.shellsnet.org 6667
/CHANNEL ADD -auto #blinkenshell ShellsNet
/SERVER ADD -auto -network Allshells mimas.blinkenshell.org 6667
/CHANNEL ADD -auto #blinkenshell Allshells
Line 29: Line 73:
Next time you start irssi, the program will automatically connect you to shellsnet and join our IRC channel. Next time you start irssi, the program will automatically connect you to Allshells and join our IRC channel.

You can also specify other networks and channels ofcourse, just remember to not connect to any network twice!

You can also make irssi automatically identify with [[NickServ]] when you connect to the network with the following command:
{{{/NETWORK ADD -autosendcmd "/^msg nickserv identify <password>;wait 2000" Allshells
}}}

Replace '<password>' with your NickServ password.

Use `/save` to save your changes. The configuration will be written to the file `.irssi/config` in your home directory. If you get confused about what networks you're getting auto-connected to or want to change an address, it might be easier to change in the config file.

== Added functionality via scripts ==
You can load scripts to provide additional functionality. You can find pre-installed scripts in /usr/share/irssi/scripts

Descriptions of what the scripts does can be found by viewing the script in a text editor like nano and reading the comments at the top of the source.

To load a script, type:

{{{
/SCRIPT LOAD trackbar.pl
}}}

To add autoload scripts when starting irssi, you can add a symlink like this:

{{{
cd .irssi/scripts/autorun
ln -s /usr/share/irssi/scripts/trackbar.pl ./
}}}

You might have to create the directories scripts and autorun if you have not used scripts before.

=== Explanation of some common and useful scripts ===

 * trackerbar - Prints a line where you last left of in a channel, so you easily can pick up your reading in the log when you check back.
 * screen_away - Automatically sets your status to away if you detach your screen.
 * usercount - Adds an item that displays the number of users in the statusbar.
Line 32: Line 112:
 * ["FAQ/DeadScreen"] - What to do when you can't resume a screen because it's "dead".  * [[FAQ/DeadScreen]] - What to do when you can't resume a screen because it's "dead".
 * [[FAQ/Unicode]] - Enable unicode to make local characters work properly.
 * [[Howto/Screen]] - More on how to use screen.
 * [[Howto/Autostart]] - How to automatically start Screen+irssi when the server starts.

== External links ==
 * http://irssi.org/documentation/startup - Startup howto on irssi's website.
 * http://quadpoint.org/articles/irssi - "A Guide to Efficiently Using Irssi and Screen".

Howto: IRC

Screen + irssi = <3

In this howto you will learn how to use your shell account for possibly the best IRC solution possible ;) We will concentrate on how to connect to IRC with the IRC-client irssi and how to stay connected even when your computer is turned off via a program called Screen.

Screen

Screen is a program that creates a virtual terminal inside your shell. You can then "detach" or "attach" this virtual terminal when you log in and out from your shell account. The programs you have running inside the virtual terminal (screen) will keep running on the server after you've logged off. Perfect for IRC, this way you will always be able to see what's been said in the chat while you were away/sleeping etc.

Start by logging in to your shell account and type the following command:

scr

Scr is a little helper program for Screen that will either create a new screen, or if there already is one, resume the previous one.

You can now start a program in this new screen. You can start irssi for example:

irssi

You can now start chatting away, but before you start learning more about irssi let's see how you can disconnect from the shell and then resume the same screen as you just started!

You can either just close the terminal window, or press and hold ctrl and then press a followed by d (ctrl-a d) to detach the screen, and then type exit or logout to log out.

Now let's connect to the shell again. When you're in, use the scr command again to resume the previously started screen.

scr

Now you will be back in the program irssi you started before. This program kept running on the server the whole time you were disconnected!

To exit a screen (destroy it, not just detach), exit the programs running inside it (/quit in irssi) and then type exit or logout.

It's possible to have multiple screens running, but this is not recommended. It can get very confusing if you are new to screen. If you accidentaly do, just retach them one at a time and exit them. You can list all your screens with this command: screen -ls

To learn more about screen, take a look at the Screen Howto.

Irssi

Let's now learn some basics of irssi. Start by logging in to the shell and resuming the screen if you're not already connected. In irssi there is a command promt at the bottom. This is where you write messages and type in commands.

Before you can start chatting, you have to connect to an IRC server and join a channel. If you use the standard config for irssi (which you probably do), then you won't have to connect manually. Instead you should automatically get connected to our home IRC network and joined into #blinkenshell.

If not (or if you want to learn how to connect to other IRC networks), use these commands to connect and join:

/CONNECT mimas.blinkenshell.org
/JOIN #blinkenshell

The first command connects to Allshells IRC-server. This might take a couple of seconds, so wait a bit before typing in the next command. The next command will join you to our IRC channel #blinkenshell.

Now you are connected, and you have two "windows" open in irssi. One with the server messages and one with #blinkenshell. To change between them press and hold the ALT-key while pressing the 1-9 on your keyboard. ALT-2 will change to the second window, which should be the #blinkenshell channel. ALT-1 will change back to the server message tab. Go to the second tab with ALT-2 and say hello to us! (You can also change windows by typing /win 2 etc.)

When you want to turn off the computer just close the window and you can then resume the screen the next time you want to use IRC and your session of irssi will be there waiting for you, running at the server at all times!

You can connect to multiple networks by issuing the /connect <server> command several times. When you issue the join command, it will join the channel on the network that is currently selected. You can switch between the networks by pressing ctrl-x. To list all active connections to IRC networks, type /server.

If you have a couple of channels in irssi that you have configured with autoconnect, you might want them to appear in the same windows every time you start irssi. You can move your windows around by changing to the window you want to move, and issuing the command: /window move 3 to move that window to position 3 for exmaple. You can then save the "layout" of your windows with the command: /layout save.

Autoconnect

Again, you don't have to do this if you already automatically gets connected to IRC.

Start irssi and type these commands to automatically join the official IRC channel each time you start irssi:

/SERVER ADD -auto -network Allshells mimas.blinkenshell.org 6667
/CHANNEL ADD -auto #blinkenshell Allshells

Next time you start irssi, the program will automatically connect you to Allshells and join our IRC channel.

You can also specify other networks and channels ofcourse, just remember to not connect to any network twice!

You can also make irssi automatically identify with NickServ when you connect to the network with the following command: {{{/NETWORK ADD -autosendcmd "/^msg nickserv identify <password>;wait 2000" Allshells }}}

Replace '<password>' with your NickServ password.

Use /save to save your changes. The configuration will be written to the file .irssi/config in your home directory. If you get confused about what networks you're getting auto-connected to or want to change an address, it might be easier to change in the config file.

Added functionality via scripts

You can load scripts to provide additional functionality. You can find pre-installed scripts in /usr/share/irssi/scripts

Descriptions of what the scripts does can be found by viewing the script in a text editor like nano and reading the comments at the top of the source.

To load a script, type:

/SCRIPT LOAD trackbar.pl

To add autoload scripts when starting irssi, you can add a symlink like this:

cd .irssi/scripts/autorun
ln -s /usr/share/irssi/scripts/trackbar.pl ./

You might have to create the directories scripts and autorun if you have not used scripts before.

Explanation of some common and useful scripts

  • trackerbar - Prints a line where you last left of in a channel, so you easily can pick up your reading in the log when you check back.
  • screen_away - Automatically sets your status to away if you detach your screen.
  • usercount - Adds an item that displays the number of users in the statusbar.

More

  • FAQ/DeadScreen - What to do when you can't resume a screen because it's "dead".

  • FAQ/Unicode - Enable unicode to make local characters work properly.

  • Howto/Screen - More on how to use screen.

  • Howto/Autostart - How to automatically start Screen+irssi when the server starts.