Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".
This documentation describes KSirc 1.1, the KDE IRC client.
Table of Contents
Simply put, IRC is a chat protocol, defined by official Internet standards, and capable of stealing many hours of your life. To use IRC, you must connect to a server, and then join a channel (equivalent to a chat room).
To connect to a server, open KSirc and select Connections->New Server or press F2. In the dialog box that is displayed, select a group from the leftmost drop-down box and then a server from the middle drop-down box. The port, shown on the right, will almost always be 6667. A new window will be displayed showing the messages sent by the server to the client. When these messages have finished scrolling past, you want to choose your channel. To display a list of available channels, type /list. To join a channel, type: /join #channelname. To leave a channel, just type /part.
That's the basics, for more detailed information, read on...
KSirc allows you to connect to an arbitrary number of servers. To connect to a server, select Connections->New Server or press F2.The Connection Dialog appears, and you can select a Group, then a Server, and also a Port to connect to.
Just click Connect when you're done, and a new window for the server is displayed. You can keep track of the servers you're connected to in the KSirc Server Control window.
You can connect to channels with the normal /join, by selecting Connections->Join Channel or by pressing F3.
Channels you are connected to are shown in the Server Control window under the server to which the they belong. To leave a channel, you can /part, select Channel->Close or press Ctrl+W.
The Channel menu, available in any channel window, contains some useful options:
Displays the channel like a stock or a news ticker. Note that this mode does not allow you to enter text into the channel. To exit Ticker Mode, right click the ticker, and select Hide....
Saves the contents of the channel to a file.
Prepends each thing said in the channel with the time it was said, in the form HH:MM:SS
In a channel, the user list is displayed along the right hand side. Right-clicking a nick in that list gives you some options, most of which are self-explanatory:
Sends a message to the server to request the list of users in the channel.
Follows the user into whatever channels he goes to.
Stops following the user.
Sends a CTCP whois query to the user, which provides information about the user, such as his hostname and what server he is connected to.
Sends a CTCP Ping to the user, to determine his echo time.
Sends a CTCP Version to the user, to determine what software he is using.
Abuses the user in one of various amusing ways.
The following commands are only available if you are an operator on the channel:
Kicks the user off the channel.
Bans the user from joining the channel.
Removes the ban on the user joining the channel.
Gives the user operator privileges.
Removes operator privileges from the user.
The KSirc configuration dialog is available from Options->Preferences in the KSirc Server Control window.
Causes KSirc to use single document interface mode, in which each new channel or /query window has its own, separate window.
Causes KSirc to use multiple document interface mode, in the style of XChat, in which each new channel or /query window has a tab in one main KSirc window. Each window can be brought to the front by clicking its tab.
If selected, KSirc will automatically create a new window for each user who /msg's you. If not selected, any text sent to you with /msg is displayed in the current window and you can use /query username to create a window to chat to that user.
If selected, switches nickname completion on. Nick completion works as follows:
Type the first letters of a user's nickname.
Press tab. The text you typed will be completed to match the username, including changes in capitalization if necessary. e.g. phi<TAB> becomes PhilRod if there is a user called “PhilRod” on the channel.
If more than one nickname on the channel matches the text you have typed, the first name in the list is chosen. Pressing tab subsequent times displays the next nickname in the list. For example, if there are users “PhilA” and “PhilRod” on a channel, and you type phi<TAB>, the text will first be completed to PhilA, and if you press tab again, it will change to PhilRod.
Display the topic of the current channel in the window caption. If not selected, the topic is only displayed inside the window.
Prepends each thing said in the channel with the time it was said, in the form [HH:MM:SS].
If selected, a system beep will be generated whenever a user on your /notify list signs onto the IRC server you are on.
If selected, a popup window from which to select the color of your text is presented when you press Ctrl+K. If not, you have to type the color codes manually. See also Chapter 4.
Rejoins channels automatically if you are disconnected.
Stores up to this many lines of chat from each window, allowing you to scroll upwards and see what has already been said.
In the Wallpaper section, you can change the image placed in the background of your KSirc windows. You can enter the name of the file to use in the text box, or browse for files using the button to the right of the textbox. Image files used must be in GIF, JPEG or PNG format. A preview of the image is shown at the right of the dialog box.
Here you can configure KSirc's startup settings.
Set your IRC nickname.
Set the nickname to use if your first choice is already in use by another user.
Your real name, as returned by a /whois query on you.
Here you can configure KSirc's use of color.
Here you can set colors for each of the types of text. Clicking the color button to the right of each text type's label will display a color picker box in which you can choose the color in which you want this type of text to be displayed.
Foreground and Background set the colors for the foreground and background of users' nicknames in chat windows. The Color for messages containing your nick option sets the color for any message appearing in a channel which contains your nickname.
Here you can set whether KSirc allows native color codes (see Chapter 4) and also whether mIrc color codes are allowed.
KSirc follows the color scheme used by mIrc and a slight modification for more powerful in house use.
<fg> == foreground <bg> == background [] == optional
Format:
0x03<fg>[,<bg>] sets the foreground and background
0x03 resets to defaults for that line
Format:
˜<fg>[,<bg>] sets the foreground and background
˜c resets to defaults
˜b sets bold font
˜u sets underline
˜i sets italics
˜r sets reverse video
Why did I change KSirc to use ˜ instead of 0x03 (Ctrl+C)? Well, it's hard to use 0x03 in scripts and not all C functions seem to like it. ˜letter also allows more commands while not stomping on mIrc's future changes.
To underline a single word in a sentence:
Procedure 4.1.
Type Ctrl+U
Type in the word
Type Ctrl+U again
Only the text that is enclosed by the start and end codes will be affected. You can use this method with all of the other control codes.
The Ctrl+K control code is slightly different because it allows you to specify a color number. To color a single word in a sentence:
Procedure 4.2.
Type Ctrl+K
Type a number between 0 and 15
Type the word
Type Ctrl+K again
If you also want to change the background color of a word, you would need to type two numbers separated by a comma instead of just one number. The first number is the text color, the second number is the background color. The colors range from 0 to 15, the index is in the previous section.
You can enclose text in multiple control codes, so for example you could have a bold, underlined, and colored word.
If you just can't figure it out, wait. I want to build a nice “filter builder” where you can just click your way through it. Though, it might be a while.
The filter tries to find the “match” string then use the “From” and “To” as a substitution. The match, from and to are all Perl regex expressions. Rules are evaluated in descending order. The top rule is evaluated first, then the second from the top, etc. All strings are evaluated as:
$name is expanded to the environment variable name. This is done immediately when you insert the rule, and will not change after that time. Therefore it's probably of limited value.
$$name is substituted with the Perl $name variable during the match. This can be substrings such as $1, $2 in the substitution, or normal variables available under sirc (such as $nick, $channel, etc.).
˜name˜ prepended once and only once to the line will send the line of text to the window called name. If the window does not exist it will go to the last window which had focus. There are several special windows, all prefixed by a single !:
The current default window. Guaranteed to exist.
Send to every window. This might not show up on all windows, depending on how the text is parsed. For example, channel windows won't show a /part or /quit unless the nick is on the channel.
discards the text.
The rest of the expression is dealt with as normal Perl regex. A good understanding of the perlre man page will definitely help, but a basic understanding of regex is most certainly required.
Want to convert all boren from boren to BoreN
Match: .* From: boren To: BoreN
Pretty straight forward, match anything, then substitute boren with BoreN.
You want to match everything with boren in it and send to the window called “boren”
Match: boren From: ^ To: ˜boren˜
Looks for “boren” if found, substitutes the beginning of the string (^) with ˜boren˜.
Though the previous example works, if the string already has ˜somewindow˜ on it, you'll now have two ˜boren˜˜somewindow˜... So you can do this instead.
Match: boren From: ^(?:˜\S+˜) To: ˜boren˜
Ok, the from line is a little bit more complicated. It means: match 0 or 1 copies of ˜\S+˜. Which is 1 tilde, one or more non-whitespaces, and then another tilde. The paranoid might do (*:˜\S+˜), which means: match 0 or more channel directives in case prior rules are broken.
Server kill messages tend to be long, ugly, annoying, etc. A basic message on dalnet looks like:
*** Notice -- Received KILL message for BOBO!ANDY@line82-basel.datacomm.ch from NickServ Path: empire.ny.us.dal.net[209.51.168.14]!trapdoor.ca.us.dal.net [206.86.127.252]!caris.ca.us.dal.net[208.1.222.221] !services.dal.net[2008.1.222.222]!services.dal.net (NickServ Enforcement)
When you're +s you get tons of them; you don't want all of them flying across your screen. I'm going to make 3 rules to deal with them one bit at a time. You could do it in less rules, but it'll show you the basic rule structure, in nice steps, and how to use multiple rules to parse a message. The first step is to remove the Path: portion of the message:
Match: ^\*\*\*.* KILL message for.* From: Path: \S+ To: .
Match looks for the message starting with ***, the *'s have to be quoted with \ since by themselves they mean 0 or more of the prior character. .* means: match anything until you find KILL message for. This allows us to avoid typing in -- Received... etc. The trailing .* means: match anything to the end of the line. (not needed, I think)
The From line means: substitute " Path: " and any non-whitespace characters with the To. To is a "." therefore the entire path turns into a single period.
The message now looks like:
*** Notice -- Received KILL message for BOBO!ANDY@line82-basel.datacomm.ch from NickServ. (NickServ Enforcement)
Notice the new "." after NickServ?
Ok, the message is a lot cleaner, but KILLs from nickserv aren't really that important, so let's forward them to the !discard window.
Match: ^\*\*\*.*KILL message.*\(NickServ Enforcement\) From: ^(?:˜\S+˜) To: ˜!discard˜
Match rule searches for the KILL message and makes sure it's from NickServ. Notice the \( and \) are both used in regex, therefore we have to quote them. This is very similar to what we said two examples before.
We've now filtered out all the nickserv kills, but the message is still pretty hard to read by simply glancing at it. So let's reorder it to something like:
*** [KILL] KILLER; killed KILLED; (REASON)
Match: \*\*\*.*KILL message From: \*\*\*.*for (.*?) from (.*?)\. \((.*?)\).* To: *** [KILL] $$2 killed $$1 ($$3)
Ok, the match looks for ***something KILL message. We can't use ^ since we may have just appended ˜<window>˜.
The from line gets a little more interesting. The "for (.*?) " looks for the word "for" then some text. .*? means: match zero or more of anything except newline, but isn't greedy. The rule is to stop when the first terminating condition is found, not the last. In other words it matches anything until a space is encountered. The surrounding () means: save the contents. Each () saves the matched data in $# where # starts at 1 for the first substring, etc. In this case, $1 gets the nick/user-info of the person killed. $2 is then filled with the name of the killer. Between the () we have the reason for the kill. Here the ( and \( get a little confusing. Remember \( matches the actual character '('.
How to colorize your life.
Ok, you want to add some color to KSirc. See the Colors section for color info, but here's a filter rule to highlight the nick between <NICK> on each line:
Match: ^(?:˜\S+˜)<\S+> From: <(\S+)> To: <˜4$$1˜c>
Takes the nick and adds color #4 between the two <>. ˜c clears the color.
This is a listing of the short cut and command keys available under KSirc.
Table 6.1. Keybindings
Keybinding | Action |
---|---|
Alt+F | Open the File menu. |
Alt+E | Open the Edit menu. |
Ctrl+N | Open a new Channel/Query Window |
Ctrl+T | Ticker Mode |
Ctrl+Q | Quit |
Ctrl+X | Cut |
Ctrl+V | Paste |
Ctrl+Enter | Begin a message to the most recent person to send you a message |
Ctrl+Shift+Enter | Begin a message to the next to last person to send you a message |
Ctrl+K | Start color code (with a number, text you type after this will be colored) |
Ctrl+U | Begin or end underlining text. Text after the first occurrence of this will be underlined until you type it again. |
Ctrl+I | Begin or end italic text. Text after the first occurrence of this will be italic until you type it again. |
Ctrl+B | Begin or end bold text. Text after the first occurrence of this will be bold until you type it again. |
Ctrl+R | Begin or end reverse video text. Text after the first occurrence of this will be reversed until you type it again. |
Tab | Tries to complete the nickname of someone on the channel, based on the text you entered. You are probably familiar with this from your commandline shell. |
KSirc copyright 1997-2001, the KSirc developers.
Portions of documentation copyright 1997, Andrew Stanley Jones
Documentation updated for KDE 2.2 by Philip Rodrigues <phil.rod@ntlworld.com>
This documentation is licensed under the terms of the GNU Free Documentation License.
This program is licensed under the terms of the GNU General Public License.
KSirc is part of the KDE project http://www.kde.org/.
KSirc can be found in the kdenetwork package on ftp://ftp.kde.org/pub/kde/, the main FTP site of the KDE project.
In order to compile and install KSirc on your system, type the following in the base directory of the KSirc distribution:
% ./configure % make % make install
Since KSirc uses autoconf and automake you should have no trouble compiling it. Should you run into problems please report them to the KDE mailing lists.