From 87550541e745627cc78507ce573d68b8453959c9 Mon Sep 17 00:00:00 2001 From: ailin-nemui Date: Tue, 24 Oct 2017 22:04:13 +0200 Subject: [PATCH 1/6] fix key length checker to actually do some work --- autogen.sh | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/autogen.sh b/autogen.sh index 60eb4fb8..a9e354c9 100755 --- a/autogen.sh +++ b/autogen.sh @@ -29,20 +29,6 @@ cat docs/help/in/Makefile.am.gen|sed "s/@HELPFILES@/$files/g"|sed 's/?/\\?/g'|tr files=`echo $files|sed 's/\.in//g'` cat docs/help/Makefile.am.gen|sed "s/@HELPFILES@/$files/g"|sed 's/?/\\?/g'|tr '!?' '\t\n' > docs/help/Makefile.am -# .html -> .txt with lynx or elinks -echo "Documentation: html -> txt..." -if type lynx >/dev/null 2>&1 ; then - LC_ALL=en_IE.utf8 lynx -dump docs/faq.html|perl -pe 's/^ *//; if ($_ eq "\n" && $state eq "Q") { $_ = ""; } elsif (/^([QA]):/) { $state = $1 } elsif ($_ ne "\n") { $_ = " $_"; };' > docs/faq.txt -elif type elinks >/dev/null 2>&1 ; then - elinks -dump docs/faq.html|perl -pe 's/^ *//; if ($_ eq "\n" && $state eq "Q") { $_ = ""; } elsif (/^([QA]):/) { $state = $1 } elsif ($_ ne "\n") { $_ = " $_"; };' > docs/faq.txt -elif type links >/dev/null 2>&1 ; then - links -dump docs/faq.html|perl -pe 's/^ *//; if ($_ eq "\n" && $state eq "Q") { $_ = ""; } elsif (/^([QA]):/) { $state = $1 } elsif ($_ ne "\n") { $_ = " $_"; };' > docs/faq.txt -else - echo "**Error**: No lynx or elinks present" - echo "Install lynx or elinks, then run autogen.sh again" - exit 1 -fi - if test x$NOCONFIGURE = x && test -z "$*"; then echo "**Warning**: I am going to run \`configure' with no arguments." echo "If you wish to pass any to it, please specify them on the" @@ -65,4 +51,4 @@ else fi # make sure perl hashes have correct length -find src/perl -name *.c -o -name *.xs | xargs grep -n hv_store | perl -ne 'if (/"(\w+)",\s*(\d+)/) { print unless $2 == length $1 }' +find src/perl -name '*.c' -o -name '*.xs' -exec grep -n hv_store {} + | perl -l -ne 'if (/"(\w+)",\s*(\d+)/ && $2 != length $1) { $X=1; print "Incorrect key length in $_" } END { exit $X }' From 245bd5579cc680e8eeba4769da87bccb8a4d0de3 Mon Sep 17 00:00:00 2001 From: ailin-nemui Date: Tue, 24 Oct 2017 22:12:34 +0200 Subject: [PATCH 2/6] remove lynx from autogen and make a separate syncdocs script --- .gitignore | 1 - docs/Makefile.am | 3 +- docs/faq.html | 4 +- docs/faq.txt | 124 +++++++ docs/startup-HOWTO.html | 512 ++++++++++++++------------ docs/startup-HOWTO.txt | 797 ++++++++++++++++++++++++++++++++++++++++ syncdocs.sh | 101 +++++ 7 files changed, 1295 insertions(+), 247 deletions(-) create mode 100644 docs/faq.txt create mode 100644 docs/startup-HOWTO.txt create mode 100755 syncdocs.sh diff --git a/.gitignore b/.gitignore index 9af0c4b1..efc579cb 100644 --- a/.gitignore +++ b/.gitignore @@ -11,7 +11,6 @@ config.status configure default-config.h default-theme.h -faq.txt irssi-config irssi-config.h irssi-config.h.in diff --git a/docs/Makefile.am b/docs/Makefile.am index 32722391..8998ffb4 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -11,7 +11,8 @@ doc_DATA = \ perl.txt \ signals.txt \ special_vars.txt \ - startup-HOWTO.html + startup-HOWTO.html \ + startup-HOWTO.txt EXTRA_DIST = $(doc_DATA) $(man_MANS) diff --git a/docs/faq.html b/docs/faq.html index 345060dc..70e90bb5 100644 --- a/docs/faq.html +++ b/docs/faq.html @@ -1,4 +1,6 @@ +

Frequently Asked Questions

+

Q: Why doesn’t irssi display colors even when ircii etc. displays them?

A: They force ANSI colors even if terminal doesn’t support them. By default, irssi uses colors only if terminfo/termcap so says. The correct way to fix this would be to change your TERM environment to a value where colors work, like xterm-color or color_xterm (eg. TERM=xterm-color irssi). If this doesn’t help, then use the evil way of /SET term_force_colors ON.

@@ -77,4 +79,4 @@

Q: How to pronounce Irssi?

-

A: Check here

+

A: Check here

\ No newline at end of file diff --git a/docs/faq.txt b/docs/faq.txt new file mode 100644 index 00000000..719fbb9a --- /dev/null +++ b/docs/faq.txt @@ -0,0 +1,124 @@ + Frequently Asked Questions + +Q: Why doesn’t irssi display colors even when ircii etc. displays them? +A: They force ANSI colors even if terminal doesn’t support them. By default, + irssi uses colors only if terminfo/termcap so says. The correct way to fix this + would be to change your TERM environment to a value where colors work, like + xterm-color or color_xterm (eg. TERM=xterm-color irssi). If this doesn’t help, + then use the evil way of /SET term_force_colors ON. + +Q: How do I easily write text to channel that starts with ‘/’ character? +A: / /text + +Q: Why doesn’t irssi update my realname (or whatever) after I change it with / + SET realname and reconnect with /RECONNECT or /SERVER? +A: Irssi is trying to be too smart. This will be fixed in future, but for now + you should use /DISCONNECT and /CONNECT. + +Q: I connected to some server which isn’t responding but now irssi tries to + connect back to it all the time! How can I stop it? +A: Two ways. The “good way” to do it is with /DISCONNECT. Check the server tags + first with /SERVER without giving it any parameters, reconnections are those + that have tag starting with “recon” text. So most probably you’re going to do / + DISCONNECT recon-1. The other way is to remove all the reconnections with / + RMRECONNS, easier but may remove some connections you actually wanted to + reconnect (if you used multiple servers..). + +Q: How do I add seconds to timestamp? +A: /FORMAT timestamp {timestamp %%H:%%M:%%S} - and remember to add the trailing + space :) + +Q: Why does irssi say “Irssi: Channel not fully synchronized yet, try again + after a while” when I try to use /BAN etc? +A: Possibly a bug in irssi, or ircd you’re using does something that irssi + didn’t really notice. The new code should make this happen far less often than + before, but one known reason for this is when irssi doesn’t notice that you + were unable to join some channel. Currently however I don’t know of any such + events irssi doesn’t know about. + + Anyway, if this does happen, do /RAWLOG SAVE ~/rawlog soon after joining to + channel, and either try to figure out yourself why irssi didn’t get reply to + WHO request, or open a Github issue with the full log included. Note that the + rawlog is by default only 200 lines and it may not be enough to show all needed + information, so you might want to do /SET rawlog_lines 1000 or so. + + MODE +b still works fine though. + +Q: Where’s the GUI version? +A: There was one on [1]irssi-import/xirssi but it has not been maintained for a + long time. + +Q: How do I autorejoin channels after being kicked? +A: That’s evil and you shouldn’t do it. If you get kicked, you should stay out, + at least until the channel forgot you existed :) Most channels I’ve joined just + ban you if you autorejoin after kick. If you’re joined to channels who kick + people for fun, try changing channels or something. + + Anyway, if you REALLY want to do that, and you understand that you’re doing + evilness, you can use the autorejoin.pl script that comes with irssi. You’ll + still need to specify the channels you wish to rejoin with /SET + autorejoin_channels #chan1 #chan2 ... + +Q: How do I announce that I’m away/back in all channels I’ve joined? Or how do + I change my nick when setting myself away/back? +A: That’s even worse than autorejoin. Who could possibly care every time you + come and go? Many channels will kick you for using this, and I for example have + added several ignores so I’d never need to see these messages. Learn to use / + AWAY command properly and tell its existence to people who don’t know about it. + /WII yournick shows your away reason much better for people who actually want + to know if you’re there or not. + +Q: Why does irssi autojoin on invite by default? +A: The setting is /SET join_auto_chans_on_invite - it’s not the same as regular + autojoin-on-invite, which irssi doesn’t even have. The only channels that are + joined on invite, are the ones you’ve added to config with /CHANNEL ADD -auto. + This is very useful with +i channels when you need to first send an invite + request to bot, or if you get accidentally kicked from channel, the kicker can + invite you back immediately. + + I don’t see any bad side effects with this feature, so it’s ON by default. I + guess someone could start kicking/inviting you all the time but server + connection shouldn’t drop because of that, and you shouldn’t join channels + whose operators are that evil. + +Q: How to make UTF-8 support work with irssi? +A: Make sure your terminal supports UTF-8 (for example, xterm -u8). If you use + screen, you may have to do screen -U. And in Irssi do /SET term_charset utf-8. + (for 0.8.9 and older: /SET term_type utf-8) + +Q: Will there be /DETACH-like feature? +A: [2]tmux, [3]screen and [4]dtach can be used to do it just fine. + +Q: How do I run scripts automatically at startup? +A: Put them into ~/.irssi/scripts/autorun/ directory. Or better would be if you + placed them in ~/.irssi/scripts/ and created symlinks to autorun directory (eg. + cd ~/.irssi/scripts/autorun/ ; ln -s ../script.pl .) + +Q: How do I execute commands automatically at startup? +A: Put them into ~/.irssi/startup file, each command on its own line. The + preceding slash (/) is not necessary. + +Q: How do I easily edit existing topic? +A: /TOPIC + +Q: How can I have /WHOIS replies to active window? +A: You can disable the status window, or do /WINDOW LEVEL -CRAP in it which + would also make several other messages show up in active window. You can also + use a [5]script. + +Q: How do I add the active network to the statusbar +A: Modify the window-line in statusbar section in config file to window = "{sb + $winref:$tag/$T{sbmode $M}}"; + +Q: How to pronounce Irssi? +A: Check [6]here + + + References: + + [1] https://github.com/irssi-import/xirssi + [2] http://tmux.github.io/ + [3] http://www.gnu.org/software/screen/screen.html + [4] http://dtach.sf.net/ + [5] http://dgl.cx/irssi/hack-whois-in-current-window.pl + [6] https://irssi.org/assets/irssi.wav diff --git a/docs/startup-HOWTO.html b/docs/startup-HOWTO.html index 07a9f47c..aaf9e5fe 100644 --- a/docs/startup-HOWTO.html +++ b/docs/startup-HOWTO.html @@ -1,4 +1,6 @@ -

Startup How-To

+ +

Startup How-To

+

To new Irssi users (not to new IRC users ..)

Copyright (c) 2000-2002 by Timo Sirainen, release under GNU FDL 1.1 license.

@@ -6,11 +8,7 @@

Index with some FAQ questions that are answered in the chapter:

    -
  1. For all the ircII people -
      -
    • This window management is just weird, I want it exactly like ircII
    • -
    -
  2. +
  3. First steps
  4. Basic user interface usage
    • Split windows work in weird way
    • @@ -50,7 +48,11 @@
  5. Proxies and IRC bouncers
  6. -
  7. Irssi’s settings
  8. +
  9. Irssi’s settings + +
  10. Statusbar
    • I loaded a statusbar script but it’s not visible anywhere!
    • @@ -58,169 +60,176 @@
-

1. For all the ircII people

+

1. First steps

-

These settings should give you pretty good defaults (the ones I use):

+

IRC Networks are made of servers, and servers have channels. The default config has a few predefined networks, to list them:

-

If colors don’t work, and you know you’re not going to use some weird non-VT compatible terminal (you most probably aren’t), just say:

+
/NETWORK LIST
+
-
 /SET term_force_colors ON
-
+

And to connect to one of those networks and join a channel:

-

I don’t like automatic query windows, I don’t like status window, I do like msgs window where all messages go:

+
/CONNECT Freenode
+/JOIN #irssi
+
-
 /SET autocreate_own_query OFF
- /SET autocreate_query_level DCCMSGS
- /SET use_status_window OFF
- /SET use_msgs_window ON
-
+

To add more networks:

-

Disable automatic window closing when /PARTing channel or /UNQUERYing query:

+
/NETWORK ADD ExampleNet
+
-
 /SET autoclose_windows OFF
- /SET reuse_unused_windows ON
-
+

Then add some servers (with -auto to automatically connect):

-

Here’s the settings that make irssi work exactly like ircII in window management (send me a note if you can think of more):

+
/SERVER ADD -auto -network ExampleNet irc.example.net
+
-
 /SET autocreate_own_query OFF
- /SET autocreate_query_level NONE
- /SET use_status_window OFF
- /SET use_msgs_window OFF
- /SET reuse_unused_windows ON
- /SET windows_auto_renumber OFF
+

Automatically join to channels after connected to server:

- /SET autostick_split_windows OFF - /SET autoclose_windows OFF - /SET print_active_channel ON -
+
/CHANNEL ADD -auto #lounge ExampleNet
+
-

And example how to add servers:

+

To modify existing networks (or servers, or channels) just ADD again using the same name as before. This configures a network to identify with nickserv and wait for 2 seconds before joining channels:

-

(OFTC network, identify with nickserv and wait for 2 seconds before joining channels)

+
/NETWORK ADD -autosendcmd "/^msg nickserv ident pass;wait 2000" ExampleNet
+
-
 /NETWORK ADD -autosendcmd "/^msg nickserv ident pass;wait 2000" OFTC
-
+

If you have irssi 0.8.18 or higher and the irc network supports it, you can use SASL instead of nickserv, which is more reliable:

-

(NOTE: use /IRCNET with 0.8.9 and older)

+
/NETWORK ADD -sasl_username yourname -sasl_password yourpassword -sasl_mechanism PLAIN Freenode
+
-

Then add some servers to different networks (network is already set up for them), irc.kpnqwest.fi is used by default for IRCNet but if it fails, irc.funet.fi is tried next:

+

These commands have many more options, see their help for details:

-
 /SERVER ADD -auto -network IRCnet irc.kpnqwest.fi 6667
- /SERVER ADD -network IRCnet irc.funet.fi 6667
- /SERVER ADD -auto -network efnet efnet.cs.hut.fi 6667
-
- -

Automatically join to channels after connected to server, send op request to bot after joined to efnet/#irssi:

- -
 /CHANNEL ADD -auto #irssi IRCnet
- /CHANNEL ADD -auto -bots *!*bot@host.org -botcmd "/^msg $0 op pass" #irssi efnet
-
+
/HELP NETWORK
+/HELP SERVER
+/HELP CHANNEL
+/HELP
+

If you want lines containing your nick to hilight:

-
 /HILIGHT nick
-
+
/HILIGHT nick
+
+ +

Or, for irssi 0.8.18 or higher:

+ +
/SET hilight_nick_matches_everywhere ON
+
+ +

To get beeps on private messages or highlights:

+ +
/SET beep_msg_level MSGS HILIGHT DCCMSGS
+
+ +

No other irssi settings are needed (don’t enable bell_beeps), but there may be settings to change in your terminal multiplexer (screen/tmux), your terminal, or your desktop environment.

2. Basic user interface usage

Windows can be scrolled up/down with PgUp and PgDown keys. If they don’t work for you, use Meta-p and Meta-n keys. For jumping to beginning or end of the buffer, use /SB HOME and /SB END commands.

-

By default, irssi uses “hidden windows” for everything. Hidden window is created every time you /JOIN a channel or /QUERY someone. There’s several ways you can change between these windows:

+

By default, irssi uses “hidden windows” for everything. Hidden windows are created every time you /JOIN a channel or /QUERY someone. There’s several ways you can change between these windows:

-
 Meta-1, Meta-2, .. Meta-0 - Jump directly between windows 1-10
- Meta-q .. Meta-o          - Jump directly between windows 11-19
- /WINDOW <number>          - Jump to any window with specified number
- Ctrl-P, Ctrl-N            - Jump to previous / next window
-
+
Meta-1, Meta-2, .. Meta-0 - Jump directly between windows 1-10
+Meta-q .. Meta-o          - Jump directly between windows 11-19
+/WINDOW <number>          - Jump to any window with specified number
+Ctrl-P, Ctrl-N            - Jump to previous / next window
+
-

Clearly the easiest way is to use Meta-number keys. And what is the Meta key? ESC key always works as Meta, but there’s also easier ways. ALT could work as Meta, or if you have Windows keyboard, left Windows key might work as Meta. If they don’t work directly, you’ll need to set a few X resources (NOTE: these work with both xterm and rxvt):

+

Clearly the easiest way is to use Meta-number keys. Meta usually means the ALT key, but if that doesn’t work, you can use ESC.

-
 XTerm*eightBitInput:   false
+

Mac OS X users with ALT key issues might prefer using iTerm2 instead of the default terminal emulator.

+ +

Alt key as meta, for xterm/rxvt users

+ +

If you use xterm or rxvt, you may need to set a few X resources:

+ +
 XTerm*eightBitInput:   false
  XTerm*metaSendsEscape: true
-
+

With rxvt, you can also specify which key acts as Meta key. So if you want to use ALT instead of Windows key for it, use:

-
 rxvt*modifier: alt
-
+
 rxvt*modifier: alt
+

You could do this by changing the X key mappings:

-
 xmodmap -e "keysym Alt_L = Meta_L Alt_L"
-
+
 xmodmap -e "keysym Alt_L = Meta_L Alt_L"
+

And how exactly do you set these X resources? For Debian, there’s /etc/X11/Xresources/xterm file where you can put them and it’s read automatically when X starts. ~/.Xresources and ~/.Xdefaults files might also work. If you can’t get anything else to work, just copy and paste those lines to ~/.Xresources and directly call xrdb -merge ~/.Xresources in some xterm. The resources affect only the new xterms you start, not existing ones.

-

Many windows SSH clients also don’t allow usage of ALT. One excellent client that does allow is putty, you can download it from http://www.chiark.greenend.org.uk/~sgtatham/putty/.

+

Split windows and window items

+ +

Note: this guide might be a better introduction to window splits

Irssi also supports split windows, they’ve had some problems in past but I think they should work pretty well now :) Here’s some commands related to them:

-
 /WINDOW NEW                    - Create new split window
- /WINDOW NEW HIDE               - Create new hidden window
- /WINDOW CLOSE                  - Close split or hidden window
+
/WINDOW NEW                    - Create new split window
+/WINDOW NEW HIDE               - Create new hidden window
+/WINDOW CLOSE                  - Close split or hidden window
 
- /WINDOW HIDE [<number>|<name>] - Make the split window hidden window
- /WINDOW SHOW <number>|<name>   - Make the hidden window a split window
+/WINDOW HIDE [<number>|<name>] - Make the split window hidden window
+/WINDOW SHOW <number>|<name>   - Make the hidden window a split window
 
- /WINDOW SHRINK [<lines>]       - Shrink the split window
- /WINDOW GROW [<lines>]         - Grow the split window
- /WINDOW BALANCE                - Balance the sizes of all split windows
-
+/WINDOW SHRINK [<lines>] - Shrink the split window +/WINDOW GROW [<lines>] - Grow the split window +/WINDOW BALANCE - Balance the sizes of all split windows +

By default, irssi uses “sticky windowing” for split windows. This means that windows created inside one split window cannot be moved to another split window without some effort. For example you could have following window layout:

-
 Split window 1: win#1 - Status window, win#2 - Messages window
+
 Split window 1: win#1 - Status window, win#2 - Messages window
  Split window 2: win#3 - IRCnet/#channel1, win#4 - IRCnet/#channel2
  Split window 3: win#5 - efnet/#channel1, win#6 - efnet/#channel2
-
+

When you are in win#1 and press ALT-6, irssi jumps to split window #3 and moves the efnet/#channel2 the active window.

With non-sticky windowing the windows don’t have any relationship with split windows, pressing ALT-6 in win#1 moves win#6 to split window 1 and sets it active, except if win#6 was already visible in some other split window irssi just changes to that split window. This it the way windows work with ircii, if you prefer it you can set it with

-
 /SET autostick_split_windows OFF
-
+
/SET autostick_split_windows OFF
+

Each window can have multiple channels, queries and other “window items” inside them. If you don’t like windows at all, you disable automatic creating of them with

-
 /SET autocreate_windows OFF
-
+
/SET autocreate_windows OFF
+

And if you keep all channels in one window, you most probably want the channel name printed in each line:

-
 /SET print_active_channel ON
-
+
/SET print_active_channel ON
+

If you want to group only some channels or queries in one window, use

-
 /JOIN -window #channel
- /QUERY -window nick
-
+
/JOIN -window #channel
+/QUERY -window nick
+

3. Server and channel automation

Irssi’s multiple IRC network support is IMHO very good - at least compared to other clients :) Even if you’re only in one IRC network you should group all your servers to be in the same IRC network as this helps with reconnecting if your primary server breaks and is probably useful in some other ways too :) For information how to actually use irssi correctly with multiple servers see the chapter 6.

-

First you need to have your IRC network set, use /NETWORK command to see if it’s already there. If it isn’t, use /NETWORK ADD yournetwork. If you want to execute some commands automatically when you’re connected to some network, use -autosendcmd option. (NOTE: use /IRCNET with 0.8.9 and older.) Here’s some examples:

+

First you need to have your IRC network set, use /NETWORK command to see if it’s already there. If it isn’t, use /NETWORK ADD yournetwork. If you want to execute some commands automatically when you’re connected to some network, use -autosendcmd option. Here’s some examples:

-
 /NETWORK ADD -autosendcmd '^msg bot invite' IRCnet
- /NETWORK ADD -autosendcmd "/^msg nickserv ident pass;wait 2000" OFTC
-
+
/NETWORK ADD -autosendcmd '^msg bot invite' IRCnet
+/NETWORK ADD -autosendcmd "/^msg nickserv ident pass;wait 2000" OFTC
+

After that you need to add your servers. For example:

-
 /SERVER ADD -auto -network IRCnet irc.kpnqwest.fi 6667
- /SERVER ADD -auto -network worknet irc.mycompany.com 6667 password
-
+
/SERVER ADD -auto -network IRCnet irc.kpnqwest.fi 6667
+/SERVER ADD -auto -network worknet irc.mycompany.com 6667 password
+

The -auto option specifies that this server is automatically connected at startup. You don’t need to make more than one server with -auto option to one IRC network, other servers are automatically connected in same network if the -auto server fails.

And finally channels:

-
 /CHANNEL ADD -auto -bots *!*bot@host.org -botcmd "/^msg $0 op pass" #irssi efnet
- /CHANNEL ADD -auto #secret IRCnet password
-
+
/CHANNEL ADD -auto -bots *!*user@host -botcmd "/^msg $0 op pass" #irssi efnet
+/CHANNEL ADD -auto #secret IRCnet password
+

-bots and -botcmd should be the only ones needing a bit of explaining. They’re used to send commands automatically to bot when channel is joined, usually to get ops automatically. You can specify multiple bot masks with -bots option separated with spaces (and remember to quote the string then). The $0 in -botcmd specifies the first found bot in the list. If you don’t need the bot masks (ie. the bot is always with the same nick, like chanserv) you can give only the -botcmd option and the command is always sent.

@@ -228,9 +237,9 @@

First connect to all the servers, join the channels and create the queries you want. If you want to move the windows or channels around use commands:

-
 /WINDOW MOVE LEFT/RIGHT/number    - move window elsewhere
- /WINDOW ITEM MOVE <number>|<name> - move channel/query to another window
-
+
/WINDOW MOVE LEFT/RIGHT/number    - move window elsewhere
+/WINDOW ITEM MOVE <number>|<name> - move channel/query to another window
+

When everything looks the way you like, use /LAYOUT SAVE command (and /SAVE, if you don’t have autosaving enabled) and when you start irssi next time, irssi remembers the positions of the channels, queries and everything. This “remembering” doesn’t mean that simply using /LAYOUT SAVE would automatically make irssi reconnect to all servers and join all channels, you’ll need the /SERVER ADD -auto and /CHANNEL ADD -auto commands to do that.

@@ -240,32 +249,32 @@

By default, all the “extra messages” go to status window. This means pretty much all messages that don’t clearly belong to some channel or query. Some people like it, some don’t. If you want to remove it, use

-
 /SET use_status_window OFF
-
+
/SET use_status_window OFF
+

This doesn’t have any effect until you restart irssi. If you want to remove it immediately, just /WINDOW CLOSE it.

Another common window is “messages window”, where all private messages go. By default it’s disabled and query windows are created instead. To make all private messages go to msgs window, say:

-
 /SET use_msgs_window ON
- /SET autocreate_query_level DCCMSGS  (or if you don't want queries to
+
/SET use_msgs_window ON
+/SET autocreate_query_level DCCMSGS  (or if you don't want queries to
  				      dcc chats either, say NONE)
-
+

use_msgs_window either doesn’t have any effect until restarting irssi. To create it immediately say:

-
 /WINDOW NEW HIDE     - create the window
- /WINDOW NAME (msgs)  - name it to "(msgs)"
- /WINDOW LEVEL MSGS   - make all private messages go to this window
- /WINDOW MOVE 1       - move it to first window
-
+
/WINDOW NEW HIDE     - create the window
+/WINDOW NAME (msgs)  - name it to "(msgs)"
+/WINDOW LEVEL MSGS   - make all private messages go to this window
+/WINDOW MOVE 1       - move it to first window
+

Note that neither use_msgs_window nor use_status_window have any effect at all if /LAYOUT SAVE has been used.

This brings us to message levels.. What are they? All messages that irssi prints have one or more “message levels”. Most common are PUBLIC for public messages in channels, MSGS for private messages and CRAP for all sorts of messages with no real classification. You can get a whole list of levels with

-
 /HELP levels
-
+
/HELP levels
+

Status window has message level ALL -MSGS, meaning that all messages, except private messages, without more specific place go to status window. The -MSGS is there so it doesn’t conflict with messages window.

@@ -273,15 +282,15 @@

ircii and several other clients support multiple servers by placing the connection into some window. IRSSI DOES NOT. There is no required relationship between window and server. You can connect to 10 servers and manage them all in just one window, or join channel in each one of them to one single window if you really want to. That being said, here’s how you do connect to new server without closing the old connection:

-
 /CONNECT irc.server.org
-
+
/CONNECT irc.server.org
+

Instead of the /SERVER which disconnects the existing connection. To see list of all active connections, use /SERVER without any parameters. You should see a list of something like:

-
 -!- IRCNet: irc.song.fi:6667 (IRCNet)
+
 -!- IRCNet: irc.song.fi:6667 (IRCNet)
  -!- OFTC: irc.oftc.net:6667 (OFTC)
  -!- RECON-1: 192.168.0.1:6667 () (02:59 left before reconnecting)
-
+

Here you see that we’re connected to IRCNet and OFTC networks. The IRCNet at the beginning is called the “server tag” while the (IRCnet) at the end shows the IRC network. Server tag specifies unique tag to refer to the server, usually it’s the same as the IRC network. When the IRC network isn’t known it’s some part of the server name. When there’s multiple connections to same IRC network or server, irssi adds a number after the tag so there could be network, network2, network3 etc.

@@ -289,63 +298,63 @@

To disconnect one of the servers, or to stop irssi from reconnecting, use

-
 /DISCONNECT network   - disconnect server with tag "network"
- /DISCONNECT recon-1  - stop trying to reconnect to RECON-1 server
- /RMRECONNS           - stop all server reconnections
+
/DISCONNECT network   - disconnect server with tag "network"
+/DISCONNECT recon-1  - stop trying to reconnect to RECON-1 server
+/RMRECONNS           - stop all server reconnections
 
- /RECONNECT recon-1   - immediately try reconnecting back to RECON-1
- /RECONNECT ALL       - immediately try reconnecting back to all
+/RECONNECT recon-1   - immediately try reconnecting back to RECON-1
+/RECONNECT ALL       - immediately try reconnecting back to all
  		       servers in reconnection queue
-
+

Now that you’re connected to all your servers, you’ll have to know how to specify which one of them you want to use. One way is to have an empty window, like status or msgs window. In it, you can specify which server to set active with

-
 /WINDOW SERVER tag    - set server "tag" active
- Ctrl-X                - set the next server in list active
-
+
/WINDOW SERVER tag    - set server "tag" active
+Ctrl-X                - set the next server in list active
+

When the server is active, you can use it normally. When there’s multiple connected servers, irssi adds [servertag] prefix to all messages in non-channel/query messages so you’ll know where it came from.

Several commands also accept -servertag option to specify which server it should use:

-
 /MSG -tag nick message
- /JOIN -tag #channel
- /QUERY -tag nick
-
+
/MSG -tag nick message
+/JOIN -tag #channel
+/QUERY -tag nick
+

/MSG tab completion also automatically adds the -tag option when nick isn’t in active server.

Window’s server can be made sticky. When sticky, it will never automatically change to anything else, and if server gets disconnected, the window won’t have any active server. When the server gets connected again, it is automatically set active in the window. To set the window’s server sticky use

-
 /WINDOW SERVER -sticky tag
-
+
/WINDOW SERVER -sticky tag
+

This is useful if you wish to have multiple status or msgs windows, one for each server. Here’s how to do them (repeat for each server)

-
 /WINDOW NEW HIDE
- /WINDOW NAME (status)
- /WINDOW LEVEL ALL -MSGS
- /WINDOW SERVER -sticky network
+
/WINDOW NEW HIDE
+/WINDOW NAME (status)
+/WINDOW LEVEL ALL -MSGS
+/WINDOW SERVER -sticky network
 
- /WINDOW NEW HIDE
- /WINDOW NAME (msgs)
- /WINDOW LEVEL MSGS
- /WINDOW SERVER -sticky network
-
+/WINDOW NEW HIDE +/WINDOW NAME (msgs) +/WINDOW LEVEL MSGS +/WINDOW SERVER -sticky network +

7. /LASTLOG and jumping around in scrollback

/LASTLOG command can be used for searching texts in scrollback buffer. Simplest usages are

-
 /LASTLOG word     - print all lines with "word" in them
- /LASTLOG word 10  - print last 10 occurances of "word"
- /LASTLOG -topics  - print all topic changes
-
+
/LASTLOG word     - print all lines with "word" in them
+/LASTLOG word 10  - print last 10 occurances of "word"
+/LASTLOG -topics  - print all topic changes
+

If there’s more than 1000 lines to be printed, irssi thinks that you probably made some mistake and won’t print them without -force option. If you want to save the full lastlog to file, use

-
 /LASTLOG -file ~/irc.log
-
+
/LASTLOG -file ~/irc.log
+

With -file option you don’t need -force even if there’s more than 1000 lines. /LASTLOG has a lot of other options too, see /HELP lastlog for details.

@@ -355,29 +364,29 @@

Irssi can automatically log important messages when you’re set away (/AWAY reason). When you set yourself unaway (/AWAY), the new messages in away log are printed to screen. You can configure it with:

-
 /SET awaylog_level MSGS HILIGHT     - Specifies what messages to log
- /SET awaylog_file ~/.irssi/away.log - Specifies the file to use
-
+
/SET awaylog_level MSGS HILIGHT     - Specifies what messages to log
+/SET awaylog_file ~/.irssi/away.log - Specifies the file to use
+

Easiest way to start logging with Irssi is to use autologging. With it Irssi logs all channels and private messages to specified directory. You can turn it on with

-
 /SET autolog ON
-
+
/SET autolog ON
+

By default it logs pretty much everything execept CTCPS or CRAP (/WHOIS requests, etc). You can specify the logging level yourself with

-
 /SET autolog_level ALL -CRAP -CLIENTCRAP -CTCPS (this is the default)
-
+
/SET autolog_level ALL -CRAP -CLIENTCRAP -CTCPS (this is the default)
+

By default irssi logs to ~/irclogs//.log. You can change this with

-
 /SET autolog_path ~/irclogs/$tag/$0.log (this is the default)
-
+
/SET autolog_path ~/irclogs/$tag/$0.log (this is the default)
+

The path is automatically created if it doesn’t exist. $0 specifies the target (channel/nick). You can make irssi automatically rotate the logs by adding date/time formats to the file name. The formats are in “man strftime” format. For example

-
 /SET autolog_path ~/irclogs/%Y/$tag/$0.%m-%d.log
-
+
/SET autolog_path ~/irclogs/%Y/$tag/$0.%m-%d.log
+

For logging only some specific channels or nicks, see /HELP log

@@ -387,16 +396,16 @@

/HELP bind tells pretty much everything there is to know about keyboard bindings. However, there’s the problem of how to bind some non-standard keys. They might differ a bit with each terminal, so you’ll need to find out what exactly the keypress produces. Easiest way to check that would be to see what it prints in cat. Here’s an example for pressing F1 key:

-
 [cras@hurina] ~% cat
+
 [user@host] ~% cat
  ^[OP
-
+

So in irssi you would use /BIND ^[OP /ECHO F1 pressed. If you use multiple terminals which have different bindings for the key, it would be better to use eg.:

-
 /BIND ^[OP key F1
- /BIND ^[11~ key F1
- /BIND F1 /ECHO F1 pressed.
-
+
/BIND ^[OP key F1
+/BIND ^[11~ key F1
+/BIND F1 /ECHO F1 pressed.
+

10. Proxies and IRC bouncers

@@ -404,20 +413,20 @@

Here’s an example: You have your bouncer (lets say, BNC or BNC-like) listening in irc.bouncer.org port 5000. You want to use it to connect to servers irc.dalnet and irc.efnet.org. First you’d need to setup the bouncer:

-
 /SET use_proxy ON
- /SET proxy_address irc.bouncer.org
- /SET proxy_port 5000
+
/SET use_proxy ON
+/SET proxy_address irc.bouncer.org
+/SET proxy_port 5000
 
- /SET proxy_password YOUR_BNC_PASSWORD_HERE
- /SET -clear proxy_string
- /SET proxy_string_after conn %s %d
-
+/SET proxy_password YOUR_BNC_PASSWORD_HERE +/SET -clear proxy_string +/SET proxy_string_after conn %s %d +

Then you’ll need to add the server connections. These are done exactly as if you’d want to connect directly to them. Nothing special about them:

-
 /SERVER ADD -auto -network dalnet irc.dal.net
- /SERVER ADD -auto -network efnet irc.efnet.org
-
+
/SERVER ADD -auto -network dalnet irc.dal.net
+/SERVER ADD -auto -network efnet irc.efnet.org
+

With the proxy /SETs however, irssi now connects to those servers through your BNC. All server connections are made through them so you can just forget that your bouncer even exists.

@@ -427,36 +436,36 @@

All proxies have these settings in common:

-
 /SET use_proxy ON
- /SET proxy_address <Proxy host address>
- /SET proxy_port <Proxy port>
-
+
/SET use_proxy ON
+/SET proxy_address <Proxy host address>
+/SET proxy_port <Proxy port>
+

HTTP proxy

Use these settings with HTTP proxies:

-
 /SET -clear proxy_password
- /EVAL SET proxy_string CONNECT %s:%d HTTP/1.0\n\n
-
+
/SET -clear proxy_password
+/EVAL SET proxy_string CONNECT %s:%d HTTP/1.0\n\n
+

BNC

-
 /SET proxy_password your_pass
- /SET -clear proxy_string
- /SET proxy_string_after conn %s %d
-
+
/SET proxy_password your_pass
+/SET -clear proxy_string
+/SET proxy_string_after conn %s %d
+

dircproxy

dircproxy separates the server connections by passwords. So, if you for example have network connection with password ircpass and OFTC connection with oftcpass, you would do something like this:

-
 /SET -clear proxy_password
- /SET -clear proxy_string
+
/SET -clear proxy_password
+/SET -clear proxy_string
 
- /SERVER ADD -auto -network IRCnet fake.network 6667 ircpass
- /SERVER ADD -auto -network OFTC fake.oftc 6667 oftcpass
-
+/SERVER ADD -auto -network IRCnet fake.network 6667 ircpass +/SERVER ADD -auto -network OFTC fake.oftc 6667 oftcpass +

The server name and port you give isn’t used anywhere, so you can put anything you want in there.

@@ -464,19 +473,17 @@

psyBNC has internal support for multiple servers. However, it could be a bit annoying to use, and some people just use different users for connecting to different servers. You can manage this in a bit same way as with dircproxy, by creating fake connections:

-
 /SET -clear proxy_password
- /SET -clear proxy_string
+
/SET -clear proxy_password
+/SET -clear proxy_string
 
- /NETWORK ADD -user networkuser IRCnet
- /SERVER ADD -auto -network IRCnet fake.network 6667 ircpass
- /NETWORK ADD -user oftcuser OFTC
- /SERVER ADD -auto -network OFTC fake.oftc 6667 oftcpass
-
+/NETWORK ADD -user networkuser IRCnet +/SERVER ADD -auto -network IRCnet fake.network 6667 ircpass +/NETWORK ADD -user oftcuser OFTC +/SERVER ADD -auto -network OFTC fake.oftc 6667 oftcpass +

So, you’ll specify the usernames with /NETWORK ADD command, and the user’s password with /SERVER ADD.

-

(NOTE: use /IRCNET with 0.8.9 and older.)

-

Irssi proxy

Irssi contains it’s own proxy which you can build giving \--with-proxy option to configure. You’ll still need to run irssi in a screen to use it though.

@@ -487,65 +494,52 @@

Usage in proxy side:

-
 /LOAD proxy
- /SET irssiproxy_password <password>
- /SET irssiproxy_ports <network>=<port> ... (eg. IRCnet=2777 efnet=2778)
-
+
/LOAD proxy
+/SET irssiproxy_password <password>
+/SET irssiproxy_ports <network>=<port> ... (eg. IRCnet=2777 efnet=2778)
+

NOTE: you MUST add all the servers you are using to server and network lists with /SERVER ADD and /NETWORK ADD. ..Except if you really don’t want to for some reason, and you only use one server connection, you may simply set:

-
 /SET irssiproxy_ports *=2777
-
- -

The special network name ? allows the client to select the -network dynamically on connect (see below):

- -
-/SET irssiproxy_ports ?=2777
-
+
/SET irssiproxy_ports *=2777
+

Usage in client side:

Just connect to the irssi proxy like it is a normal server with password specified in /SET irssiproxy_password. For example:

-
 /SERVER ADD -network IRCnet my.irssi-proxy.org 2777 secret
- /SERVER ADD -network efnet my.irssi-proxy.org 2778 secret
-
- -

Or, if you used ? in irssiproxy_ports:

- -
-/SERVER ADD -network IRCnet my.irssi-proxy.org 2777 IRCnet:secret
-/SERVER ADD -network efnet my.irssi-proxy.org 2777 efnet:secret
-
- -

I.e. the network to connect to is specified as part of the password, -separated by : from the actual proxy password.

+
/SERVER ADD -network IRCnet my.irssi-proxy.org 2777 secret
+/SERVER ADD -network efnet my.irssi-proxy.org 2778 secret
+

Irssi proxy works fine with other IRC clients as well.

SOCKS

-

Irssi can be compiled with socks support (\--with-socks option to configure), but I don’t really know how it works, if at all. /SET proxy settings don’t have anything to do with socks however.

+

Irssi can be compiled with socks support (\--with-socks option to configure), which requires “dante” and routes all connections through the proxy specified in the system-wide /etc/socks.conf. This method is known to have issues in Mac OS X.

+ +

Note that /SET proxy settings don’t have anything to do with socks.

+ +

Using proxychains-ng is recommended over recompiling irssi.

Others

IRC bouncers usually work like IRC servers, and want a password. You can give it with:

-
 /SET proxy_password <password>
-
+
/SET proxy_password <password>
+

Irssi’s defaults for connect strings are

-
 /SET proxy_string CONNECT %s %d
- /SET proxy_string_after
-
+
/SET proxy_string CONNECT %s %d
+/SET proxy_string_after
+

The proxy_string is sent before NICK/USER commands, the proxy_string_after is sent after them. %s and %d can be used with both of them.

11. Irssi’s settings

-

You probably don’t like Irssi’s default settings. I don’t like them. But I’m still convinced that they’re pretty good defaults. Here’s some of them you might want to change (the default value is shown): Also check the Settings Documentation

+

Here’s some settings you might want to change (the default value is shown): Also check the Settings Documentation

Queries

@@ -633,31 +627,61 @@ separated by : from the actual proxy password.

Completion character to use.
+

For all the ircII people

+ +

I don’t like automatic query windows, I don’t like status window, I do like msgs window where all messages go:

+ +
/SET autocreate_own_query OFF
+/SET autocreate_query_level DCCMSGS
+/SET use_status_window OFF
+/SET use_msgs_window ON
+
+ +

Disable automatic window closing when /PARTing channel or /UNQUERYing query:

+ +
/SET autoclose_windows OFF
+/SET reuse_unused_windows ON
+
+ +

Here’s the settings that make irssi work exactly like ircII in window management (send me a note if you can think of more):

+ +
/SET autocreate_own_query OFF
+/SET autocreate_query_level NONE
+/SET use_status_window OFF
+/SET use_msgs_window OFF
+/SET reuse_unused_windows ON
+/SET windows_auto_renumber OFF
+
+/SET autostick_split_windows OFF
+/SET autoclose_windows OFF
+/SET print_active_channel ON
+
+

12. Statusbar

-

/STATUSBAR displays a list of statusbars:

+

/STATUSBAR displays a list of the current statusbars, along with their position and visibility:

-
 Name                           Type   Placement Position Visible
+
 Name                           Type   Placement Position Visible
  window                         window bottom    0        always
  window_inact                   window bottom    1        inactive
  prompt                         root   bottom    100      always
  topic                          root   top       1        always
-
+
-

/STATUSBAR <name> prints the statusbar settings and it’s items. /STATUSBAR <name> ENABLE|DISABLE enables/disables the statusbar. /STATUSBAR <name> RESET resets the statusbar to it’s default settings, or if the statusbar was created by you, it will be removed.

+

/STATUSBAR <name> prints the statusbar settings (type, placement, position, visibility) as well as its items. /STATUSBAR <name> ENABLE|DISABLE enables/disables the statusbar. /STATUSBAR <name> RESET resets the statusbar to its default settings, or if the statusbar was created by you, it will be removed.

-

Type can be window or root, meaning if the statusbar should be created for each split window, or just once. Placement can be top or bottom. Position is a number, the higher the value the lower in screen it is. Visible can be always, active or inactive. Active/inactive is useful only with split windows, one split window is active and the rest are inactive. These settings can be changed with:

+

The statusbar type can be either window or root. If the type is window, then a statusbar will be created for each split window, otherwise it will be created only once. Placement can be top or bottom, which refers to the top or bottom of the screen. Position is a number, the higher the value the lower it will appear in-screen. Visible can be always, active or inactive. Active/inactive is useful only with split windows; one split window is active and the rest are inactive. To adjust these settings, the following commands are available:

-
 /STATUSBAR <name> TYPE window|root
- /STATUSBAR <name> PLACEMENT top|bottom
- /STATUSBAR <name> POSITION <num>
- /STATUSBAR <name> VISIBLE always|active|inactive
-
+
/STATUSBAR <name> TYPE window|root
+/STATUSBAR <name> PLACEMENT top|bottom
+/STATUSBAR <name> POSITION <num>
+/STATUSBAR <name> VISIBLE always|active|inactive
+
-

When loading a new statusbar scripts, you’ll need to also specify where you want to show it. Statusbar items can be modified with:

+

Statusbar items can also be added or removed via command. Note that when loading new statusbar scripts that add items, you will need to specify where you want to show the item and how it is aligned. This can be accomplished using the below commands:

-
 /STATUSBAR <name> ADD [-before | -after <item>] [-priority #] [-alignment left|right] <item>
- /STATUSBAR <name> REMOVE <item>
-
+
/STATUSBAR <name> ADD [-before | -after <item>] [-priority #] [-alignment left|right] <item>
+/STATUSBAR <name> REMOVE <item>
+
-

The item name with statusbar scripts is usually same as the script’s name. Script’s documentation should tell if this isn’t the case. So, to add mail.pl before the window activity item (see the list with /STATUSBAR window), use: /STATUSBAR window ADD -before act mail.

+

For statusbar scripts, the item name is usually equivalent to the script name. The documentation of the script ought to tell you if this is not the case. For example, to add mail.pl before the window activity item, use: /STATUSBAR window ADD -before act mail.

\ No newline at end of file diff --git a/docs/startup-HOWTO.txt b/docs/startup-HOWTO.txt new file mode 100644 index 00000000..23d7cf94 --- /dev/null +++ b/docs/startup-HOWTO.txt @@ -0,0 +1,797 @@ +Startup How-To + +To new Irssi users (not to new IRC users ..) + +Copyright (c) 2000-2002 by Timo Sirainen, release under [1]GNU FDL 1.1 license. + +Index with some FAQ questions that are answered in the chapter: + + 1. First steps + 2. Basic user interface usage + □ Split windows work in weird way + □ How can I easily switch between windows? + □ But alt-1 etc. don’t work! + 3. Server and channel automation + □ How do I automatically connect to servers at startup? + □ How do I automatically join to channels at startup? + □ How do I automatically send commands to server at connect? + 4. Setting up windows and automatically restoring them at startup + 5. Status and msgs windows & message levels + □ I want /WHOIS to print reply to current window + □ I want all messages to go to one window, not create new windows + 6. How support for multiple servers works in irssi + □ I connected to some server that doesn’t respond and now irssi keeps + trying to reconnect to it again and again, how can I stop it?? + □ I want to have own status and/or msgs window for each servers + 7. /LASTLOG and jumping around in scrollback + □ How can I save all texts in a window to file? + 8. Logging + 9. Changing keyboard bindings + □ How do I make F1 key do something? +10. Proxies and IRC bouncers +11. Irssi’s settings + □ For all the ircII people +12. Statusbar + □ I loaded a statusbar script but it’s not visible anywhere! + +1. First steps + +IRC Networks are made of servers, and servers have channels. The default config +has a few predefined networks, to list them: + +/NETWORK LIST + +And to connect to one of those networks and join a channel: + +/CONNECT Freenode +/JOIN #irssi + +To add more networks: + +/NETWORK ADD ExampleNet + +Then add some servers (with -auto to automatically connect): + +/SERVER ADD -auto -network ExampleNet irc.example.net + +Automatically join to channels after connected to server: + +/CHANNEL ADD -auto #lounge ExampleNet + +To modify existing networks (or servers, or channels) just ADD again using the +same name as before. This configures a network to identify with nickserv and +wait for 2 seconds before joining channels: + +/NETWORK ADD -autosendcmd "/^msg nickserv ident pass;wait 2000" ExampleNet + +If you have irssi 0.8.18 or higher and the irc network supports it, you can use +SASL instead of nickserv, which is more reliable: + +/NETWORK ADD -sasl_username yourname -sasl_password yourpassword -sasl_mechanism PLAIN Freenode + +These commands have many more options, see their help for details: + +/HELP NETWORK +/HELP SERVER +/HELP CHANNEL +/HELP + +If you want lines containing your nick to hilight: + +/HILIGHT nick + +Or, for irssi 0.8.18 or higher: + +/SET hilight_nick_matches_everywhere ON + +To get beeps on private messages or highlights: + +/SET beep_msg_level MSGS HILIGHT DCCMSGS + +No other irssi settings are needed (don’t enable bell_beeps), but there may be +settings to change in your terminal multiplexer (screen/tmux), your terminal, +or your desktop environment. + +2. Basic user interface usage + +Windows can be scrolled up/down with PgUp and PgDown keys. If they don’t work +for you, use Meta-p and Meta-n keys. For jumping to beginning or end of the +buffer, use /SB HOME and /SB END commands. + +By default, irssi uses “hidden windows” for everything. Hidden windows are +created every time you /JOIN a channel or /QUERY someone. There’s several ways +you can change between these windows: + +Meta-1, Meta-2, .. Meta-0 - Jump directly between windows 1-10 +Meta-q .. Meta-o - Jump directly between windows 11-19 +/WINDOW - Jump to any window with specified number +Ctrl-P, Ctrl-N - Jump to previous / next window + +Clearly the easiest way is to use Meta-number keys. Meta usually means the ALT +key, but if that doesn’t work, you can use ESC. + +Mac OS X users with ALT key issues might prefer using [2]iTerm2 instead of the +default terminal emulator. + +Alt key as meta, for xterm/rxvt users + +If you use xterm or rxvt, you may need to set a few X resources: + + XTerm*eightBitInput: false + XTerm*metaSendsEscape: true + +With rxvt, you can also specify which key acts as Meta key. So if you want to +use ALT instead of Windows key for it, use: + + rxvt*modifier: alt + +You could do this by changing the X key mappings: + + xmodmap -e "keysym Alt_L = Meta_L Alt_L" + +And how exactly do you set these X resources? For Debian, there’s /etc/X11/ +Xresources/xterm file where you can put them and it’s read automatically when X +starts. ~/.Xresources and ~/.Xdefaults files might also work. If you can’t get +anything else to work, just copy and paste those lines to ~/.Xresources and +directly call xrdb -merge ~/.Xresources in some xterm. The resources affect +only the new xterms you start, not existing ones. + +Split windows and window items + +Note: [3]this guide might be a better introduction to window splits + +Irssi also supports split windows, they’ve had some problems in past but I +think they should work pretty well now :) Here’s some commands related to them: + +/WINDOW NEW - Create new split window +/WINDOW NEW HIDE - Create new hidden window +/WINDOW CLOSE - Close split or hidden window + +/WINDOW HIDE [|] - Make the split window hidden window +/WINDOW SHOW | - Make the hidden window a split window + +/WINDOW SHRINK [] - Shrink the split window +/WINDOW GROW [] - Grow the split window +/WINDOW BALANCE - Balance the sizes of all split windows + +By default, irssi uses “sticky windowing” for split windows. This means that +windows created inside one split window cannot be moved to another split window +without some effort. For example you could have following window layout: + + Split window 1: win#1 - Status window, win#2 - Messages window + Split window 2: win#3 - IRCnet/#channel1, win#4 - IRCnet/#channel2 + Split window 3: win#5 - efnet/#channel1, win#6 - efnet/#channel2 + +When you are in win#1 and press ALT-6, irssi jumps to split window #3 and moves +the efnet/#channel2 the active window. + +With non-sticky windowing the windows don’t have any relationship with split +windows, pressing ALT-6 in win#1 moves win#6 to split window 1 and sets it +active, except if win#6 was already visible in some other split window irssi +just changes to that split window. This it the way windows work with ircii, if +you prefer it you can set it with + +/SET autostick_split_windows OFF + +Each window can have multiple channels, queries and other “window items” inside +them. If you don’t like windows at all, you disable automatic creating of them +with + +/SET autocreate_windows OFF + +And if you keep all channels in one window, you most probably want the channel +name printed in each line: + +/SET print_active_channel ON + +If you want to group only some channels or queries in one window, use + +/JOIN -window #channel +/QUERY -window nick + +3. Server and channel automation + +Irssi’s multiple IRC network support is IMHO very good - at least compared to +other clients :) Even if you’re only in one IRC network you should group all +your servers to be in the same IRC network as this helps with reconnecting if +your primary server breaks and is probably useful in some other ways too :) For +information how to actually use irssi correctly with multiple servers see the +chapter 6. + +First you need to have your IRC network set, use /NETWORK command to see if +it’s already there. If it isn’t, use /NETWORK ADD yournetwork. If you want to +execute some commands automatically when you’re connected to some network, use +-autosendcmd option. Here’s some examples: + +/NETWORK ADD -autosendcmd '^msg bot invite' IRCnet +/NETWORK ADD -autosendcmd "/^msg nickserv ident pass;wait 2000" OFTC + +After that you need to add your servers. For example: + +/SERVER ADD -auto -network IRCnet irc.kpnqwest.fi 6667 +/SERVER ADD -auto -network worknet irc.mycompany.com 6667 password + +The -auto option specifies that this server is automatically connected at +startup. You don’t need to make more than one server with -auto option to one +IRC network, other servers are automatically connected in same network if the +-auto server fails. + +And finally channels: + +/CHANNEL ADD -auto -bots *!*user@host -botcmd "/^msg $0 op pass" #irssi efnet +/CHANNEL ADD -auto #secret IRCnet password + +-bots and -botcmd should be the only ones needing a bit of explaining. They’re +used to send commands automatically to bot when channel is joined, usually to +get ops automatically. You can specify multiple bot masks with -bots option +separated with spaces (and remember to quote the string then). The $0 in +-botcmd specifies the first found bot in the list. If you don’t need the bot +masks (ie. the bot is always with the same nick, like chanserv) you can give +only the -botcmd option and the command is always sent. + +4. Setting up windows and automatically restoring them at startup + +First connect to all the servers, join the channels and create the queries you +want. If you want to move the windows or channels around use commands: + +/WINDOW MOVE LEFT/RIGHT/number - move window elsewhere +/WINDOW ITEM MOVE | - move channel/query to another window + +When everything looks the way you like, use /LAYOUT SAVE command (and /SAVE, if +you don’t have autosaving enabled) and when you start irssi next time, irssi +remembers the positions of the channels, queries and everything. This +“remembering” doesn’t mean that simply using /LAYOUT SAVE would automatically +make irssi reconnect to all servers and join all channels, you’ll need the / +SERVER ADD -auto and /CHANNEL ADD -auto commands to do that. + +If you want to change the layout, you just rearrange the layout like you want +it and use /LAYOUT SAVE again. If you want to remove the layout for some +reason, use /LAYOUT RESET. + +5. Status and msgs windows & message levels + +By default, all the “extra messages” go to status window. This means pretty +much all messages that don’t clearly belong to some channel or query. Some +people like it, some don’t. If you want to remove it, use + +/SET use_status_window OFF + +This doesn’t have any effect until you restart irssi. If you want to remove it +immediately, just /WINDOW CLOSE it. + +Another common window is “messages window”, where all private messages go. By +default it’s disabled and query windows are created instead. To make all +private messages go to msgs window, say: + +/SET use_msgs_window ON +/SET autocreate_query_level DCCMSGS (or if you don't want queries to + dcc chats either, say NONE) + +use_msgs_window either doesn’t have any effect until restarting irssi. To +create it immediately say: + +/WINDOW NEW HIDE - create the window +/WINDOW NAME (msgs) - name it to "(msgs)" +/WINDOW LEVEL MSGS - make all private messages go to this window +/WINDOW MOVE 1 - move it to first window + +Note that neither use_msgs_window nor use_status_window have any effect at all +if /LAYOUT SAVE has been used. + +This brings us to message levels.. What are they? All messages that irssi +prints have one or more “message levels”. Most common are PUBLIC for public +messages in channels, MSGS for private messages and CRAP for all sorts of +messages with no real classification. You can get a whole list of levels with + +/HELP levels + +Status window has message level ALL -MSGS, meaning that all messages, except +private messages, without more specific place go to status window. The -MSGS is +there so it doesn’t conflict with messages window. + +6. How support for multiple servers works in irssi + +ircii and several other clients support multiple servers by placing the +connection into some window. IRSSI DOES NOT. There is no required relationship +between window and server. You can connect to 10 servers and manage them all in +just one window, or join channel in each one of them to one single window if +you really want to. That being said, here’s how you do connect to new server +without closing the old connection: + +/CONNECT irc.server.org + +Instead of the /SERVER which disconnects the existing connection. To see list +of all active connections, use /SERVER without any parameters. You should see a +list of something like: + + -!- IRCNet: irc.song.fi:6667 (IRCNet) + -!- OFTC: irc.oftc.net:6667 (OFTC) + -!- RECON-1: 192.168.0.1:6667 () (02:59 left before reconnecting) + +Here you see that we’re connected to IRCNet and OFTC networks. The IRCNet at +the beginning is called the “server tag” while the (IRCnet) at the end shows +the IRC network. Server tag specifies unique tag to refer to the server, +usually it’s the same as the IRC network. When the IRC network isn’t known it’s +some part of the server name. When there’s multiple connections to same IRC +network or server, irssi adds a number after the tag so there could be network, +network2, network3 etc. + +Server tags beginning with RECON- mean server reconnections. Above we see that +connection to server at 192.168.0.1 wasn’t successful and irssi will try to +connect it again in 3 minutes. + +To disconnect one of the servers, or to stop irssi from reconnecting, use + +/DISCONNECT network - disconnect server with tag "network" +/DISCONNECT recon-1 - stop trying to reconnect to RECON-1 server +/RMRECONNS - stop all server reconnections + +/RECONNECT recon-1 - immediately try reconnecting back to RECON-1 +/RECONNECT ALL - immediately try reconnecting back to all + servers in reconnection queue + +Now that you’re connected to all your servers, you’ll have to know how to +specify which one of them you want to use. One way is to have an empty window, +like status or msgs window. In it, you can specify which server to set active +with + +/WINDOW SERVER tag - set server "tag" active +Ctrl-X - set the next server in list active + +When the server is active, you can use it normally. When there’s multiple +connected servers, irssi adds [servertag] prefix to all messages in non-channel +/query messages so you’ll know where it came from. + +Several commands also accept -servertag option to specify which server it +should use: + +/MSG -tag nick message +/JOIN -tag #channel +/QUERY -tag nick + +/MSG tab completion also automatically adds the -tag option when nick isn’t in +active server. + +Window’s server can be made sticky. When sticky, it will never automatically +change to anything else, and if server gets disconnected, the window won’t have +any active server. When the server gets connected again, it is automatically +set active in the window. To set the window’s server sticky use + +/WINDOW SERVER -sticky tag + +This is useful if you wish to have multiple status or msgs windows, one for +each server. Here’s how to do them (repeat for each server) + +/WINDOW NEW HIDE +/WINDOW NAME (status) +/WINDOW LEVEL ALL -MSGS +/WINDOW SERVER -sticky network + +/WINDOW NEW HIDE +/WINDOW NAME (msgs) +/WINDOW LEVEL MSGS +/WINDOW SERVER -sticky network + +7. /LASTLOG and jumping around in scrollback + +/LASTLOG command can be used for searching texts in scrollback buffer. Simplest +usages are + +/LASTLOG word - print all lines with "word" in them +/LASTLOG word 10 - print last 10 occurances of "word" +/LASTLOG -topics - print all topic changes + +If there’s more than 1000 lines to be printed, irssi thinks that you probably +made some mistake and won’t print them without -force option. If you want to +save the full lastlog to file, use + +/LASTLOG -file ~/irc.log + +With -file option you don’t need -force even if there’s more than 1000 lines. / +LASTLOG has a lot of other options too, see /HELP lastlog for details. + +Once you’ve found the lines you were interested in, you might want to check the +discussion around them. Irssi has /SCROLLBACK (or alias /SB) command for +jumping around in scrollback buffer. Since /LASTLOG prints the timestamp when +the message was originally printed, you can use /SB GOTO hh:mm to jump directly +there. To get back to the bottom of scrollback, use /SB END command. + +8. Logging + +Irssi can automatically log important messages when you’re set away (/AWAY +reason). When you set yourself unaway (/AWAY), the new messages in away log are +printed to screen. You can configure it with: + +/SET awaylog_level MSGS HILIGHT - Specifies what messages to log +/SET awaylog_file ~/.irssi/away.log - Specifies the file to use + +Easiest way to start logging with Irssi is to use autologging. With it Irssi +logs all channels and private messages to specified directory. You can turn it +on with + +/SET autolog ON + +By default it logs pretty much everything execept CTCPS or CRAP (/WHOIS +requests, etc). You can specify the logging level yourself with + +/SET autolog_level ALL -CRAP -CLIENTCRAP -CTCPS (this is the default) + +By default irssi logs to ~/irclogs//.log. You can change this with + +/SET autolog_path ~/irclogs/$tag/$0.log (this is the default) + +The path is automatically created if it doesn’t exist. $0 specifies the target +(channel/nick). You can make irssi automatically rotate the logs by adding date +/time formats to the file name. The formats are in “man strftime” format. For +example + +/SET autolog_path ~/irclogs/%Y/$tag/$0.%m-%d.log + +For logging only some specific channels or nicks, see /HELP log + +9. Changing keyboard bindings + +You can change any keyboard binding that terminal lets irssi know about. It +doesn’t let irssi know everything, so for example shift-backspace can’t be +bound unless you modify xterm resources somehow. + +/HELP bind tells pretty much everything there is to know about keyboard +bindings. However, there’s the problem of how to bind some non-standard keys. +They might differ a bit with each terminal, so you’ll need to find out what +exactly the keypress produces. Easiest way to check that would be to see what +it prints in cat. Here’s an example for pressing F1 key: + + [user@host] ~% cat + ^[OP + +So in irssi you would use /BIND ^[OP /ECHO F1 pressed. If you use multiple +terminals which have different bindings for the key, it would be better to use +eg.: + +/BIND ^[OP key F1 +/BIND ^[11~ key F1 +/BIND F1 /ECHO F1 pressed. + +10. Proxies and IRC bouncers + +Irssi supports connecting to IRC servers via a proxy. All server connections +are then made through it, and if you’ve set up everything properly, you don’t +need to do any /QUOTE SERVER commands manually. + +Here’s an example: You have your bouncer (lets say, BNC or BNC-like) listening +in irc.bouncer.org port 5000. You want to use it to connect to servers +irc.dalnet and irc.efnet.org. First you’d need to setup the bouncer: + +/SET use_proxy ON +/SET proxy_address irc.bouncer.org +/SET proxy_port 5000 + +/SET proxy_password YOUR_BNC_PASSWORD_HERE +/SET -clear proxy_string +/SET proxy_string_after conn %s %d + +Then you’ll need to add the server connections. These are done exactly as if +you’d want to connect directly to them. Nothing special about them: + +/SERVER ADD -auto -network dalnet irc.dal.net +/SERVER ADD -auto -network efnet irc.efnet.org + +With the proxy /SETs however, irssi now connects to those servers through your +BNC. All server connections are made through them so you can just forget that +your bouncer even exists. + +If you don’t want to use the proxy for some reason, there’s -noproxy option +which you can give to /SERVER and /SERVER ADD commands. + +Proxy specific settings: + +All proxies have these settings in common: + +/SET use_proxy ON +/SET proxy_address +/SET proxy_port + +HTTP proxy + +Use these settings with HTTP proxies: + +/SET -clear proxy_password +/EVAL SET proxy_string CONNECT %s:%d HTTP/1.0\n\n + +BNC + +/SET proxy_password your_pass +/SET -clear proxy_string +/SET proxy_string_after conn %s %d + +dircproxy + +dircproxy separates the server connections by passwords. So, if you for example +have network connection with password ircpass and OFTC connection with +oftcpass, you would do something like this: + +/SET -clear proxy_password +/SET -clear proxy_string + +/SERVER ADD -auto -network IRCnet fake.network 6667 ircpass +/SERVER ADD -auto -network OFTC fake.oftc 6667 oftcpass + +The server name and port you give isn’t used anywhere, so you can put anything +you want in there. + +psyBNC + +psyBNC has internal support for multiple servers. However, it could be a bit +annoying to use, and some people just use different users for connecting to +different servers. You can manage this in a bit same way as with dircproxy, by +creating fake connections: + +/SET -clear proxy_password +/SET -clear proxy_string + +/NETWORK ADD -user networkuser IRCnet +/SERVER ADD -auto -network IRCnet fake.network 6667 ircpass +/NETWORK ADD -user oftcuser OFTC +/SERVER ADD -auto -network OFTC fake.oftc 6667 oftcpass + +So, you’ll specify the usernames with /NETWORK ADD command, and the user’s +password with /SERVER ADD. + +Irssi proxy + +Irssi contains it’s own proxy which you can build giving \--with-proxy option +to configure. You’ll still need to run irssi in a screen to use it though. + +Irssi proxy is a bit different than most proxies, normally proxies create a new +connection to IRC server when you connect to it, but irssi proxy shares your +existing IRC connection(s) to multiple clients. And even more clearly: You can +use only one IRC server connection to IRC with as many clients as you want. Can +anyone figure out even more easier ways to say this, so I wouldn’t need to try +to explain this thing for minutes every time? :) + +Irssi proxy supports sharing multiple server connections in different ports, +like you can share network in port 2777 and efnet in port 2778. + +Usage in proxy side: + +/LOAD proxy +/SET irssiproxy_password +/SET irssiproxy_ports = ... (eg. IRCnet=2777 efnet=2778) + +NOTE: you MUST add all the servers you are using to server and network lists +with /SERVER ADD and /NETWORK ADD. ..Except if you really don’t want to for +some reason, and you only use one server connection, you may simply set: + +/SET irssiproxy_ports *=2777 + +Usage in client side: + +Just connect to the irssi proxy like it is a normal server with password +specified in /SET irssiproxy_password. For example: + +/SERVER ADD -network IRCnet my.irssi-proxy.org 2777 secret +/SERVER ADD -network efnet my.irssi-proxy.org 2778 secret + +Irssi proxy works fine with other IRC clients as well. + +SOCKS + +Irssi can be compiled with socks support (\--with-socks option to configure), +which requires “dante” and routes all connections through the proxy specified +in the system-wide /etc/socks.conf. This method is known to have issues in Mac +OS X. + +Note that /SET proxy settings don’t have anything to do with socks. + +Using [4]proxychains-ng is recommended over recompiling irssi. + +Others + +IRC bouncers usually work like IRC servers, and want a password. You can give +it with: + +/SET proxy_password + +Irssi’s defaults for connect strings are + +/SET proxy_string CONNECT %s %d +/SET proxy_string_after + +The proxy_string is sent before NICK/USER commands, the proxy_string_after is +sent after them. %s and %d can be used with both of them. + +11. Irssi’s settings + +Here’s some settings you might want to change (the default value is shown): +Also check the [5]Settings Documentation + +Queries + +/SET autocreate_own_query ON + Should new query window be created when you send message to someone (with / + MSG). +/SET autocreate_query_level MSGS + New query window should be created when receiving messages with this level. + MSGS, DCCMSGS and NOTICES levels work currently. You can disable this with + /SET -clear autocreate_query_level. +/SET autoclose_query 0 + Query windows can be automatically closed after certain time of inactivity. + Queries with unread messages aren’t closed and active window is neither + never closed. The value is given in seconds. + +Windows + +/SET use_msgs_window OFF + Create messages window at startup. All private messages go to this window. + This only makes sense if you’ve disabled automatic query windows. Message + window can also be created manually with /WINDOW LEVEL MSGS, /WINDOW NAME + (msgs). +/SET use_status_window ON + Create status window at startup. All messages that don’t really have better + place go here, like all /WHOIS replies etc. Status window can also be + created manually with /WINDOW LEVEL ALL -MSGS, /WINDOW NAME (status). +/SET autocreate_windows ON + Should we create new windows for new window items or just place everything + in one window +/SET autoclose_windows ON + Should window be automatically closed when the last item in them is removed + (ie. /PART, /UNQUERY). +/SET reuse_unused_windows OFF + When finding where to place new window item (channel, query) Irssi first + tries to use already existing empty windows. If this is set ON, new window + will always be created for all window items. This setting is ignored if + autoclose_windows is set ON. +/SET window_auto_change OFF + Should Irssi automatically change to automatically created windows - + usually queries when someone sends you a message. To prevent accidentally + sending text meant to some other channel/nick, Irssi clears the input + buffer when changing the window. The text is still in scrollback buffer, + you can get it back with pressing arrow up key. +/SET print_active_channel OFF + When you keep more than one channel in same window, Irssi prints the + messages coming to active channel as text and other channels as + text. If this setting is set ON, the messages to active + channels are also printed in the latter way. +/SET window_history OFF + Should command history be kept separate for each window. + +User information + +/SET nick + Your nick name +/SET alternate_nick + Your alternate nick. +/SET user_name + Your username, if you have ident enabled this doesn’t affect anything +/SET real_name + Your real name. + +Server information + +/SET skip_motd OFF + Should we hide server’s MOTD (Message Of The Day). +/SET server_reconnect_time 300 + Seconds to wait before connecting to same server again. Don’t set this too + low since it usually doesn’t help at all - if the host is down, the few + extra minutes of waiting won’t hurt much. +/SET lag_max_before_disconnect 300 + Maximum server lag in seconds before disconnecting and trying to reconnect. + This happens mostly only when network breaks between you and IRC server. + +Appearance + +/SET timestamps ON + Show timestamps before each message. +/SET hide_text_style OFF + Hide all bolds, underlines, MIRC colors, etc. +/SET show_nickmode ON + Show the nick’s mode before nick in channels, ie. ops have <@nick>, voices + <+nick> and others < nick> +/SET show_nickmode_empty ON + If the nick doesn’t have a mode, use one space. ie. ON: < nick>, OFF: + +/SET show_quit_once OFF + Show quit message only once in some of the channel windows the nick was in + instead of in all windows. +/SET lag_min_show 100 + Show the server lag in status bar if it’s bigger than this, the unit is 1/ + 100 of seconds (ie. the default value of 100 = 1 second). +/SET indent 10 + When lines are longer than screen width they have to be split to multiple + lines. This specifies how much space to put at the beginning of the line + before the text begins. This can be overridden in text formats with %| + format. +/SET activity_hide_targets + If you don’t want to see window activity in some certain channels or + queries, list them here. For example #boringchannel =bot1 =bot2. If any + highlighted text or message for you appears in that window, this setting is + ignored and the activity is shown. + +Nick completion + +/SET completion_auto OFF + Automatically complete the nick if line begins with start of nick and the + completion character. Learn to use the tab-completion instead, it’s a lot + better ;) +/SET completion_char : + Completion character to use. + +For all the ircII people + +I don’t like automatic query windows, I don’t like status window, I do like +msgs window where all messages go: + +/SET autocreate_own_query OFF +/SET autocreate_query_level DCCMSGS +/SET use_status_window OFF +/SET use_msgs_window ON + +Disable automatic window closing when /PARTing channel or /UNQUERYing query: + +/SET autoclose_windows OFF +/SET reuse_unused_windows ON + +Here’s the settings that make irssi work exactly like ircII in window +management (send me a note if you can think of more): + +/SET autocreate_own_query OFF +/SET autocreate_query_level NONE +/SET use_status_window OFF +/SET use_msgs_window OFF +/SET reuse_unused_windows ON +/SET windows_auto_renumber OFF + +/SET autostick_split_windows OFF +/SET autoclose_windows OFF +/SET print_active_channel ON + +12. Statusbar + +/STATUSBAR displays a list of the current statusbars, along with their position +and visibility: + + Name Type Placement Position Visible + window window bottom 0 always + window_inact window bottom 1 inactive + prompt root bottom 100 always + topic root top 1 always + +/STATUSBAR prints the statusbar settings (type, placement, position, +visibility) as well as its items. /STATUSBAR ENABLE|DISABLE enables/ +disables the statusbar. /STATUSBAR RESET resets the statusbar to its +default settings, or if the statusbar was created by you, it will be removed. + +The statusbar type can be either window or root. If the type is window, then a +statusbar will be created for each split window, otherwise it will be created +only once. Placement can be top or bottom, which refers to the top or bottom of +the screen. Position is a number, the higher the value the lower it will appear +in-screen. Visible can be always, active or inactive. Active/inactive is useful +only with split windows; one split window is active and the rest are inactive. +To adjust these settings, the following commands are available: + +/STATUSBAR TYPE window|root +/STATUSBAR PLACEMENT top|bottom +/STATUSBAR POSITION +/STATUSBAR VISIBLE always|active|inactive + +Statusbar items can also be added or removed via command. Note that when +loading new statusbar scripts that add items, you will need to specify where +you want to show the item and how it is aligned. This can be accomplished using +the below commands: + +/STATUSBAR ADD [-before | -after ] [-priority #] [-alignment left|right] +/STATUSBAR REMOVE + +For statusbar scripts, the item name is usually equivalent to the script name. +The documentation of the script ought to tell you if this is not the case. For +example, to add mail.pl before the window activity item, use: /STATUSBAR window +ADD -before act mail. + + +References: + +[1] http://www.gnu.org/licenses/fdl.html +[2] https://www.iterm2.com/ +[3] http://quadpoint.org/articles/irssisplit/ +[4] https://github.com/rofl0r/proxychains-ng +[5] https://irssi.org/documentation/settings/ diff --git a/syncdocs.sh b/syncdocs.sh new file mode 100755 index 00000000..1187eec9 --- /dev/null +++ b/syncdocs.sh @@ -0,0 +1,101 @@ +#!/bin/sh -e +# Run this to download FAQ and startup-HOWTO from irssi.org + +PKG_NAME="Irssi" + +site=https://irssi.org + +faq=$site/documentation/faq/ +howto=$site/documentation/startup/ + +# remove everything until H1 and optionally 2 DIVs before the +# FOOTER. May need to be adjusted as the source pages change +pageclean_regex='s{.*(?=\s*)?(\s*)?)}{\1\2}g;' + +srcdir=`dirname "$0"` +test -z "$srcdir" && srcdir=. + +if test ! -f "$srcdir"/configure.ac; then + echo -n "**Error**: Directory \`$srcdir' does not look like the" + echo " top-level $PKG_NAME directory" + exit 1 +fi + +# detect downloader app +downloader=false + +if type curl >/dev/null 2>&1 ; then + downloader="curl -Ssf" +elif type wget >/dev/null 2>&1 ; then + downloader="wget -nv -O-" +else + echo "**Error**: No wget or curl present" + echo "Install wget or curl, then run syncdocs.sh again" +fi + +# detect html converter app +converter=false +if [ "$1" = "-any" ]; then + any=true +else + any=false +fi + +if type w3m >/dev/null 2>&1 ; then + converter="w3m -o display_link_number=1 -dump -T text/html" + any=true +elif type lynx >/dev/null 2>&1 ; then + converter="lynx -dump -stdin -force_html" +elif type elinks >/dev/null 2>&1 ; then + converter="elinks -dump -force-html" +else + echo "**Error**: Neither w3m, nor lynx or elinks present" + echo "Install w3m, then run syncdocs.sh again" + exit 1 +fi + +if ! $any ; then + echo "**Error**: w3m not present" + echo "If you want to use lynx or elinks, run syncdocs.sh -any" + exit 1 +fi + +check_download() { + if test "$1" -ne 0 || test ! -e "$2" || test "$(wc -l "$2" | awk '{print $1}')" -le 1 ; then + rm -f "$2" + echo "... download failed ( $1 )" + exit 2 + fi +} + +download_it() { + echo "Downloading $1 from $2 ..." + ret=0 + $downloader "$2" > "$3".tmp || ret=$? + check_download "$ret" "$3".tmp + perl -i -0777 -p -e "$pageclean_regex" "$3".tmp + perl -i -0777 -p -e 's{\A}{'""'\n}' "$3".tmp + perl -i -0777 -p -e 's{\[email protected\]}{user\@host}g' "$3".tmp + mv "$3".tmp "$3" +} + +download_it "FAQ" "$faq" "$srcdir"/docs/faq.html +download_it "Startup How-To" "$howto" "$srcdir"/docs/startup-HOWTO.html + +# .html -> .txt with lynx or elinks +echo "Documentation: html -> txt..." + +cat "$srcdir"/docs/faq.html \ + | LC_ALL=en_IE.utf8 $converter \ + | perl -pe ' + s/^ *//; + if ($_ eq "\n" && $state eq "Q") { $_ = ""; } + elsif (/^([QA]):/) { $state = $1 } + elsif ($_ ne "\n") { $_ = " $_"; }; +' > docs/faq.txt + +cat "$srcdir"/docs/startup-HOWTO.html \ + | perl -pe "s/\\bhref=([\"\'])#.*?\\1//" \ + | LC_ALL=en_IE.utf8 $converter > "$srcdir"/docs/startup-HOWTO.txt From 9a3c0bce48d3f172d5638ecb37967528812129b1 Mon Sep 17 00:00:00 2001 From: ailin-nemui Date: Tue, 24 Oct 2017 22:22:39 +0200 Subject: [PATCH 3/6] add a script to sync scripts as well --- syncscripts.sh | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100755 syncscripts.sh diff --git a/syncscripts.sh b/syncscripts.sh new file mode 100755 index 00000000..eee95a5e --- /dev/null +++ b/syncscripts.sh @@ -0,0 +1,38 @@ +#!/bin/sh -e +# Run this script to sync dual lived scripts from scripts.irssi.org to scripts/ + +PKG_NAME="Irssi" + +scriptbase=https://scripts.irssi.org/scripts + +srcdir=`dirname "$0"` +test -z "$srcdir" && srcdir=. + +if test ! -f "$srcdir"/configure.ac; then + echo -n "**Error**: Directory \`$srcdir' does not look like the" + echo " top-level $PKG_NAME directory" + exit 1 +fi + +dl2='curl -Ssf' + +dl_it() { + echo "$1" + $dl2 -o "$srcdir/scripts/$1" "$scriptbase/$1" +} + +for script in \ + autoop.pl \ + autorejoin.pl \ + buf.pl \ + dns.pl \ + kills.pl \ + mail.pl \ + mlock.pl \ + quitmsg.pl \ + scriptassist.pl \ + usercount.pl \ + ; +do + dl_it $script +done From ca3498d42d29383024382b0eb983f97ab4e6b614 Mon Sep 17 00:00:00 2001 From: ailin-nemui Date: Wed, 25 Oct 2017 16:22:57 +0200 Subject: [PATCH 4/6] move some files into subdirs --- Makefile.am | 21 ++++++----------- autogen.sh | 27 +++++++++++++--------- configure.ac | 2 ++ themes/Makefile.am | 5 ++++ colorless.theme => themes/colorless.theme | 0 default.theme => themes/default.theme | 0 utils/Makefile.am | 4 ++++ file2header.sh => utils/file2header.sh | 0 irssi-version.sh => utils/irssi-version.sh | 0 syncdocs.sh => utils/syncdocs.sh | 3 ++- syncscripts.sh => utils/syncscripts.sh | 1 + syntax.pl => utils/syntax.pl | 0 12 files changed, 37 insertions(+), 26 deletions(-) create mode 100644 themes/Makefile.am rename colorless.theme => themes/colorless.theme (100%) rename default.theme => themes/default.theme (100%) create mode 100644 utils/Makefile.am rename file2header.sh => utils/file2header.sh (100%) rename irssi-version.sh => utils/irssi-version.sh (100%) rename syncdocs.sh => utils/syncdocs.sh (98%) rename syncscripts.sh => utils/syncscripts.sh (97%) rename syntax.pl => utils/syntax.pl (100%) diff --git a/Makefile.am b/Makefile.am index 75d502f1..f52ac92f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -7,33 +7,26 @@ CLEANFILES = default-config.h default-theme.h @MAINTAINER_MODE_TRUE@.PHONY: irssi-version.h default-config.h: $(srcdir)/irssi.conf - $(srcdir)/file2header.sh $(srcdir)/irssi.conf default_config > default-config.h + $(srcdir)/utils/file2header.sh $(srcdir)/irssi.conf default_config > default-config.h -default-theme.h: $(srcdir)/default.theme - $(srcdir)/file2header.sh $(srcdir)/default.theme default_theme > default-theme.h +default-theme.h: $(srcdir)/themes/default.theme + $(srcdir)/utils/file2header.sh $(srcdir)/themes/default.theme default_theme > default-theme.h irssi-version.h: - VERSION="$(VERSION)" $(srcdir)/irssi-version.sh $(srcdir) | \ - cmp -s - $@ || VERSION="$(VERSION)" $(srcdir)/irssi-version.sh $(srcdir) >$@ + VERSION="$(VERSION)" $(srcdir)/utils/irssi-version.sh $(srcdir) | \ + cmp -s - $@ || VERSION="$(VERSION)" $(srcdir)/utils/irssi-version.sh $(srcdir) >$@ -SUBDIRS = src docs scripts +SUBDIRS = src docs scripts themes utils confdir = $(sysconfdir) conf_DATA = irssi.conf -themedir = $(datadir)/irssi/themes -theme_DATA = default.theme colorless.theme - pkginclude_HEADERS = irssi-config.h irssi-version.h EXTRA_DIST = \ ChangeLog \ autogen.sh \ README.md \ - file2header.sh \ $(conf_DATA) \ - $(theme_DATA) \ irssi-config.in \ - irssi-icon.png \ - irssi-version.sh \ - syntax.pl + irssi-icon.png diff --git a/autogen.sh b/autogen.sh index a9e354c9..9feb0872 100755 --- a/autogen.sh +++ b/autogen.sh @@ -3,21 +3,24 @@ PKG_NAME="Irssi" -srcdir=`dirname $0` +srcdir=`dirname "$0"` test -z "$srcdir" && srcdir=. +mydir=`pwd` -if test ! -f $srcdir/configure.ac; then - echo -n "**Error**: Directory \`$srcdir\' does not look like the" +if test ! -f "$srcdir"/configure.ac; then + echo -n "**Error**: Directory \`$srcdir' does not look like the" echo " top-level $PKG_NAME directory" exit 1 fi +cd "$srcdir" + # create help files echo "Creating help files..." -perl syntax.pl +perl utils/syntax.pl echo "Creating ChangeLog..." -git log > $srcdir/ChangeLog +git log > ChangeLog if test "$?" -ne 0; then echo "**Error**: ${PKG_NAME} Autogen must be run in a git clone, cannot proceed." exit 1 @@ -38,17 +41,19 @@ fi rm -f aclocal.m4 echo "Running autoreconf ..." -autoreconf -i || exit 1 +autoreconf -i || exit $? + +# make sure perl hashes have correct length +find src/perl -name '*.c' -o -name '*.xs' -exec grep -n hv_store {} + | perl -l -ne 'if (/"(\w+)",\s*(\d+)/ && $2 != length $1) { $X=1; print "Incorrect key length in $_" } END { exit $X }' + +cd "$mydir" conf_flags="--enable-maintainer-mode" if test x$NOCONFIGURE = x; then - echo Running $srcdir/configure $conf_flags "$@" ... - $srcdir/configure $conf_flags "$@" \ + echo Running "$srcdir"/configure $conf_flags "$@" ... + "$srcdir"/configure $conf_flags "$@" \ && echo Now type \`make\' to compile $PKG_NAME || exit 1 else echo Skipping configure process. fi - -# make sure perl hashes have correct length -find src/perl -name '*.c' -o -name '*.xs' -exec grep -n hv_store {} + | perl -l -ne 'if (/"(\w+)",\s*(\d+)/ && $2 != length $1) { $X=1; print "Incorrect key length in $_" } END { exit $X }' diff --git a/configure.ac b/configure.ac index 9c026c5d..4b65d434 100644 --- a/configure.ac +++ b/configure.ac @@ -661,6 +661,8 @@ scripts/examples/Makefile docs/Makefile docs/help/Makefile docs/help/in/Makefile +utils/Makefile +themes/Makefile irssi-config ]) diff --git a/themes/Makefile.am b/themes/Makefile.am new file mode 100644 index 00000000..ad0707c2 --- /dev/null +++ b/themes/Makefile.am @@ -0,0 +1,5 @@ +themedir = $(datadir)/irssi/themes +theme_DATA = default.theme colorless.theme + +EXTRA_DIST = \ + $(theme_DATA) diff --git a/colorless.theme b/themes/colorless.theme similarity index 100% rename from colorless.theme rename to themes/colorless.theme diff --git a/default.theme b/themes/default.theme similarity index 100% rename from default.theme rename to themes/default.theme diff --git a/utils/Makefile.am b/utils/Makefile.am new file mode 100644 index 00000000..be24c17f --- /dev/null +++ b/utils/Makefile.am @@ -0,0 +1,4 @@ +EXTRA_DIST = \ + file2header.sh \ + irssi-version.sh \ + syntax.pl diff --git a/file2header.sh b/utils/file2header.sh similarity index 100% rename from file2header.sh rename to utils/file2header.sh diff --git a/irssi-version.sh b/utils/irssi-version.sh similarity index 100% rename from irssi-version.sh rename to utils/irssi-version.sh diff --git a/syncdocs.sh b/utils/syncdocs.sh similarity index 98% rename from syncdocs.sh rename to utils/syncdocs.sh index 1187eec9..e723edd2 100755 --- a/syncdocs.sh +++ b/utils/syncdocs.sh @@ -16,6 +16,7 @@ s{(<.*?)\sclass="(?:highlighter-rouge|highlight)"(.*?>)}{\1\2}g;' srcdir=`dirname "$0"` test -z "$srcdir" && srcdir=. +srcdir="$srcdir"/.. if test ! -f "$srcdir"/configure.ac; then echo -n "**Error**: Directory \`$srcdir' does not look like the" @@ -94,7 +95,7 @@ cat "$srcdir"/docs/faq.html \ if ($_ eq "\n" && $state eq "Q") { $_ = ""; } elsif (/^([QA]):/) { $state = $1 } elsif ($_ ne "\n") { $_ = " $_"; }; -' > docs/faq.txt +' > "$srcdir"/docs/faq.txt cat "$srcdir"/docs/startup-HOWTO.html \ | perl -pe "s/\\bhref=([\"\'])#.*?\\1//" \ diff --git a/syncscripts.sh b/utils/syncscripts.sh similarity index 97% rename from syncscripts.sh rename to utils/syncscripts.sh index eee95a5e..533b77cc 100755 --- a/syncscripts.sh +++ b/utils/syncscripts.sh @@ -7,6 +7,7 @@ scriptbase=https://scripts.irssi.org/scripts srcdir=`dirname "$0"` test -z "$srcdir" && srcdir=. +srcdir="$srcdir"/.. if test ! -f "$srcdir"/configure.ac; then echo -n "**Error**: Directory \`$srcdir' does not look like the" diff --git a/syntax.pl b/utils/syntax.pl similarity index 100% rename from syntax.pl rename to utils/syntax.pl From 8c0e0c81ee79684201020f843eeb0a4d656ed14c Mon Sep 17 00:00:00 2001 From: ailin-nemui Date: Wed, 25 Oct 2017 16:23:14 +0200 Subject: [PATCH 5/6] run syncscripts.sh --- scripts/autorejoin.pl | 49 ++++++++++++++++++++++++++++--------------- scripts/mail.pl | 1 + scripts/usercount.pl | 1 + 3 files changed, 34 insertions(+), 17 deletions(-) diff --git a/scripts/autorejoin.pl b/scripts/autorejoin.pl index 42c97da7..e5be21b2 100644 --- a/scripts/autorejoin.pl +++ b/scripts/autorejoin.pl @@ -1,6 +1,9 @@ -# automatically rejoin to channel after kick +# automatically rejoin to channel after kicked # delayed rejoin: Lam 28.10.2001 (lam@lac.pl) +# /SET autorejoin_channels #channel1 #channel2 ... +# /SET autorejoin_delay 5 + # NOTE: I personally don't like this feature, in most channels I'm in it # will just result as ban. You've probably misunderstood the idea of /KICK # if you kick/get kicked all the time "just for fun" ... @@ -9,31 +12,22 @@ use Irssi; use Irssi::Irc; use strict; use vars qw($VERSION %IRSSI); -$VERSION = "1.0.0"; +$VERSION = "1.1.0"; %IRSSI = ( authors => "Timo 'cras' Sirainen, Leszek Matok", contact => "lam\@lac.pl", name => "autorejoin", - description => "Automatically rejoin to channel after being kick, after a (short) user-defined delay", + description => "Automatically rejoin to channel after being kicked, after a (short) user-defined delay", license => "GPLv2", changed => "10.3.2002 14:00" ); - -# How many seconds to wait before the rejoin? -# TODO: make this a /setting -my $delay = 5; - -my @tags; -my $acttag = 0; - sub rejoin { my ( $data ) = @_; - my ( $tag, $servtag, $channel, $pass ) = split( / +/, $data ); + my ( $servtag, $channel, $pass ) = @{$data}; my $server = Irssi::server_find_tag( $servtag ); $server->send_raw( "JOIN $channel $pass" ) if ( $server ); - Irssi::timeout_remove( $tags[$tag] ); } sub event_rejoin_kick { @@ -48,10 +42,31 @@ sub event_rejoin_kick { my $rejoinchan = $chanrec->{ name } if ( $chanrec ); my $servtag = $server->{ tag }; - Irssi::print "Rejoining $rejoinchan in $delay seconds."; - $tags[$acttag] = Irssi::timeout_add( $delay * 1000, "rejoin", "$acttag $servtag $rejoinchan $password" ); - $acttag++; - $acttag = 0 if ( $acttag > 60 ); + # check if we want to autorejoin this channel + my $chans = Irssi::settings_get_str( 'autorejoin_channels' ); + + if ( $chans ) { + my $found = 0; + foreach my $chan ( split( /[ ,]/, $chans ) ) { + if ( lc( $chan ) eq lc( $channel ) ) { + $found = 1; + last; + } + } + return unless $found; + } + + my @args = ($servtag, $rejoinchan, $password); + my $delay = Irssi::settings_get_int( "autorejoin_delay" ); + + if ($delay) { + Irssi::print "Rejoining $rejoinchan in $delay seconds."; + Irssi::timeout_add_once( $delay * 1000, "rejoin", \@args ); + } else { + rejoin( \@args ); + } } +Irssi::settings_add_int('misc', 'autorejoin_delay', 5); +Irssi::settings_add_str('misc', 'autorejoin_channels', ''); Irssi::signal_add( 'event kick', 'event_rejoin_kick' ); diff --git a/scripts/mail.pl b/scripts/mail.pl index ded02120..23f99c01 100644 --- a/scripts/mail.pl +++ b/scripts/mail.pl @@ -6,6 +6,7 @@ $VERSION = "2.92"; contact => "tss\@iki.fi, matti\@hiljanen.com, joost\@carnique.nl, bart\@dreamflow.nl", name => "mail", description => "Fully customizable mail counter statusbar item with multiple mailbox and multiple Maildir support", + sbitems => "mail", license => "Public Domain", url => "http://irssi.org, http://scripts.irssi.de", ); diff --git a/scripts/usercount.pl b/scripts/usercount.pl index 613da1de..650f9f36 100644 --- a/scripts/usercount.pl +++ b/scripts/usercount.pl @@ -7,6 +7,7 @@ $VERSION = "1.19"; contact => 'dgl@dgl.cx, tss@iki.fi, georg@boerde.de', name => 'usercount', description => 'Adds a usercount for a channel as a statusbar item', + sbitems => 'usercount', license => 'GNU GPLv2 or later', url => 'http://irssi.dgl.cx/', changes => 'Only show halfops if server supports them', From 96c7f68b3579ae5f83b635d946dc705d6322a16c Mon Sep 17 00:00:00 2001 From: ailin-nemui Date: Thu, 26 Oct 2017 16:15:25 +0200 Subject: [PATCH 6/6] clean up file path after move --- src/perl/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/perl/Makefile.am b/src/perl/Makefile.am index 427c5492..db52744e 100644 --- a/src/perl/Makefile.am +++ b/src/perl/Makefile.am @@ -59,7 +59,7 @@ perl-signals-list.h: $(top_srcdir)/docs/signals.txt $(srcdir)/get-signals.pl cat $(top_srcdir)/docs/signals.txt | $(perlpath) $(srcdir)/get-signals.pl > perl-signals-list.h irssi-core.pl.h: irssi-core.pl - $(top_srcdir)/file2header.sh $(srcdir)/irssi-core.pl irssi_core_code > irssi-core.pl.h + $(top_srcdir)/utils/file2header.sh $(srcdir)/irssi-core.pl irssi_core_code > irssi-core.pl.h common_sources = \ common/Irssi.xs \