Matthew Turk avatar Matthew Turk committed 6f52c7d

Adding irssi config

Comments (0)

Files changed (8)

+### agon.theme
+
+default_color = "-1";
+info_eol = "false";
+replaces = { "[]=" = "%K$*%n"; };
+
+abstracts = {
+  ##
+  ## generic
+  ##
+
+  # text to insert at the beginning of each non-message line
+  line_start = "*** ";
+
+  # timestamp styling, nothing by default
+  timestamp = "%W$*";
+
+  # any kind of text that needs hilighting, default is to bold
+  hilight = "%_$*%_";
+
+  # any kind of error message, default is bright red
+  error = "%R$*%n";
+
+  # channel name is printed
+  channel = "%c$0-%n";
+
+  # nick is printed
+  nick = "%_%r$*%_";
+
+  # nick host is printed
+  nickhost = "$*";
+
+  # server name is printed
+  server = "%_$*%_";
+
+  # some kind of comment is printed
+  comment = "[$*]";
+
+  # reason for something is printed (part, quit, kick, ..)
+  reason = "{comment $*}";
+
+  # mode change is printed ([+o nick])
+  mode = "{comment $*}";
+
+  ##
+  ## channel specific messages
+  ##
+
+  # highlighted nick/host is printed (joins)
+  channick_hilight = "%c$0-%n";
+  chanhost_hilight = "{nickhost %c$0-%n}";
+
+  # nick/host is printed (parts, quits, etc.)
+  channick = "%C$*";
+  chanhost = "%C{nickhost $*}";
+
+  # highlighted channel name is printed
+  channelhilight = "%r$*%n";
+
+  # ban/ban exception/invite list mask is printed
+  ban = "%R$*%n";
+
+  ##
+  ## messages
+  ##
+
+  # the basic styling of how to print message, $0 = nick mode, $1 = nick
+  msgnick = "%r<%R$0%n$1-%r>%n %|";
+
+  # message from you is printed. "msgownnick" specifies the styling of the
+  # nick ($0 part in msgnick) and "ownmsgnick" specifies the styling of the
+  # whole line.
+
+  # Example1: You want the message text to be green:
+  #  ownmsgnick = "{msgnick $0 $1-}%g";
+  # Example2.1: You want < and > chars to be yellow:
+  #  ownmsgnick = "%Y{msgnick $0 $1-%Y}%n";
+  #  (you'll also have to remove <> from replaces list above)
+  # Example2.2: But you still want to keep <> grey for other messages:
+  #  pubmsgnick = "%K{msgnick $0 $1-%K}%n";
+  #  pubmsgmenick = "%K{msgnick $0 $1-%K}%n";
+  #  pubmsghinick = "%K{msgnick $1 $0$2-%n%K}%n";
+  #  ownprivmsgnick = "%K{msgnick  $*%K}%n";
+  #  privmsgnick = "%K{msgnick  %R$*%K}%n";
+
+  # $0 = nick mode, $1 = nick
+  ownmsgnick = "%R{msgnick $0 $1-%R}%w";
+  ownnick = "%W$*%n";
+
+  # public message in channel, $0 = nick mode, $1 = nick
+  pubmsgnick = "{msgnick $0 $1-}";
+  pubnick = "%N$*%n";
+
+  # public message in channel meant for me, $0 = nick mode, $1 = nick
+  pubmsgmenick = "{msgnick $0 $1-}";
+  menick = "%Y$*";
+
+  # public highlighted message in channel
+  # $0 = highlight color, $1 = nick mode, $2 = nick
+  pubmsghinick = "{msgnick $1 $0$2-%n}";
+
+  # channel name is printed with message
+  msgchannel = "%K:%c$*%n";
+
+  # private message, $0 = nick, $1 = host
+  privmsg = "[%R$0%K(%W$1-%K)%n] ";
+
+  # private message from you, $0 = "msg", $1 = target nick
+  ownprivmsg = "[%n$0%K(%n$1-%K)%n] ";
+
+  # own private message in query
+  ownprivmsgnick = "{msgnick  $*}%W";
+  ownprivnick = "%n$*%W";
+
+  # private message in query
+  privmsgnick = "{msgnick  $*}";
+
+  ##
+  ## Actions (/ME stuff)
+  ##
+
+  # used internally by this theme
+  action_core = "%Y * $*%y";
+
+  # generic one that's used by most actions
+  action = "{action_core $*} ";
+
+  # own action, both private/public
+  ownaction = "{action $*}";
+
+  # own action with target, both private/public
+  ownaction_target = "{action_core $0}%K:%c$1%n ";
+
+  # private action sent by others
+  pvtaction = "%W (*) $*%n ";
+  pvtaction_query = "{action $*}";
+
+  # public action sent by others
+  pubaction = "{action $*}";
+
+
+  ##
+  ## other IRC events
+  ##
+
+  # whois
+  whois = "%# $[8]0 : $1-";
+
+  # notices
+  ownnotice = "[%r$0%K(%R$1-%K)]%n ";
+  notice = "%K-%C$*%K-%n ";
+  pubnotice_channel = "%K:%m$*";
+  pvtnotice_host = "%K(%m$*%K)";
+  servernotice = "%g!$*%n ";
+
+  # CTCPs
+  ownctcp = "[%y$0%K(%R$1-%K)] ";
+  ctcp = "%Y$*%n";
+
+  # wallops
+  wallop = "%W$*%n: ";
+  wallop_nick = "%n$*";
+  wallop_action = "%W * $*%n ";
+
+  # netsplits
+  netsplit = "%R$*%n";
+  netjoin = "%C$*%n";
+
+  # /names list
+  names_prefix = "";
+  names_nick = "[%_$0%_$1-] ";
+  names_nick_op = "{names_nick $*}";
+  names_nick_halfop = "{names_nick $*}";
+  names_nick_voice = "{names_nick $*}";
+  names_users = "[%c$*%n]";
+  names_channel = "%C$*%n";
+
+  # DCC
+  dcc = "%g$*%n";
+  dccfile = "%_$*%_";
+
+  # DCC chat, own msg/action
+  dccownmsg = "[%r$0%K($1-%K)%n] ";
+  dccownnick = "%R$*%n";
+  dccownquerynick = "%W$*%n";
+  dccownaction = "{action $*}";
+  dccownaction_target = "{action_core $0}%K:%c$1%n ";
+
+  # DCC chat, others
+  dccmsg = "[%G$1-%K(%g$0%K)%n] ";
+  dccquerynick = "%G$*%n";
+  dccaction = "%W (*dcc*) $*%n %|";
+
+  ##
+  ## statusbar
+  ##
+
+  # default background for all statusbars. You can also give
+  # the default foreground color for statusbar items.
+  sb_background = "%0%w";
+
+  # default backround for "default" statusbar group
+  #sb_default_bg = "%4";
+  # background for prompt / input line
+  sb_prompt_bg = "%n";
+  # background for info statusbar
+  sb_info_bg = "%8";
+  # background for topicbar (same default)
+  #sb_topic_bg = "%4";
+
+  # text at the beginning of statusbars. sb-item already puts
+  # space there,so we don't use anything by default.
+  sbstart = "";
+  # text at the end of statusbars. Use space so that it's never
+  # used for anything.
+  sbend = " ";
+
+  topicsbstart = "{sbstart $*}";
+  topicsbend = "{sbend $*}";
+
+  prompt = "[$*] ";
+
+  sb = " %c[%n$*%c]%n";
+  sbmode = "(%c+%n$*)";
+  sbaway = " (%GzZzZ%n)";
+  sbservertag = ":$0 (change with ^X)";
+  sbnickmode = "$0";
+
+  # activity in statusbar
+
+  # ',' separator
+  sb_act_sep = "%w$*";
+  # normal text
+  sb_act_text = "%w$*";
+  # public message
+  sb_act_msg = "%W$*";
+  # hilight
+  sb_act_hilight = "%M$*";
+  # hilight with specified color, $0 = color, $1 = text
+  sb_act_hilight_color = "$0$1-%n";
+};
+formats = {
+  "fe-common/core" = { timestamp = "{timestamp %%H:%%M:%%S} "; };
+};
+servers = (
+  { address = "irc.stealth.net"; chatnet = "IRCnet"; port = "6668"; },
+  { address = "irc.efnet.net"; chatnet = "EFNet"; port = "6667"; },
+  { 
+    address = "irc.undernet.org";
+    chatnet = "Undernet";
+    port = "6667";
+  },
+  { address = "irc.dal.net"; chatnet = "DALnet"; port = "6667"; },
+  {
+    address = "chat.freenode.net";
+    chatnet = "freenode";
+    port = "7000";
+    use_ssl = "yes";
+    ssl_verify = "yes";
+    ssl_capath = "/etc/ssl/certs";
+  },
+  { address = "irc.gnome.org"; chatnet = "GIMPNet"; port = "6667"; },
+  { address = "irc.ptlink.net"; chatnet = "PTlink"; port = "6667"; },
+  { 
+    address = "irc.sorcery.net";
+    chatnet = "SorceryNet";
+    port = "6667";
+  },
+  { 
+    address = "irc.hashmark.net";
+    chatnet = "Hashmark";
+    port = "6667";
+  },
+  { address = "irc.ptnet.org"; chatnet = "PTnet"; port = "6667"; },
+  { 
+    address = "irc.azzurra.org";
+    chatnet = "AzzurraNET";
+    port = "6667";
+  },
+  { address = "silc.silcnet.org"; chatnet = "SILC"; port = "706"; }
+);
+
+chatnets = {
+  IRCnet = {
+    type = "IRC";
+    max_kicks = "4";
+    max_modes = "3";
+    max_msgs = "5";
+    max_whois = "4";
+    max_query_chans = "5";
+  };
+  EFNet = {
+    type = "IRC";
+    max_kicks = "4";
+    max_modes = "4";
+    max_msgs = "3";
+    max_whois = "1";
+  };
+  Undernet = {
+    type = "IRC";
+    max_kicks = "4";
+    max_modes = "3";
+    max_msgs = "3";
+    max_whois = "30";
+  };
+  DALnet = {
+    type = "IRC";
+    max_kicks = "4";
+    max_modes = "6";
+    max_msgs = "3";
+    max_whois = "30";
+  };
+  freenode = {
+    type = "IRC";
+    max_kicks = "4";
+    max_modes = "4";
+    max_msgs = "1";
+    max_whois = "1";
+  };
+  GIMPNet = {
+    type = "IRC";
+    max_kicks = "4";
+    max_modes = "4";
+    max_msgs = "3";
+    max_whois = "1";
+  };
+  PTlink = {
+    type = "IRC";
+    max_kicks = "1";
+    max_modes = "6";
+    max_msgs = "30";
+    max_whois = "1";
+  };
+  SorceryNet = {
+    type = "IRC";
+    max_kicks = "30";
+    max_modes = "6";
+    max_msgs = "30";
+    max_whois = "30";
+  };
+  Hashmark = {
+    type = "IRC";
+    max_kicks = "4";
+    max_modes = "3";
+    max_msgs = "3";
+    max_whois = "30";
+  };
+  PTnet = {
+    type = "IRC";
+    max_kicks = "30";
+    max_modes = "13";
+    max_msgs = "10";
+    max_whois = "30";
+  };
+  AzzurraNET = {
+    type = "IRC";
+    max_kicks = "4";
+    max_modes = "6";
+    max_msgs = "3";
+  };
+  SILC = { type = "SILC"; };
+};
+
+channels = (
+  { name = "#irssi"; chatnet = "ircnet"; autojoin = "No"; },
+  { name = "#irssi"; chatnet = "freenode"; autojoin = "No"; },
+  { name = "silc"; chatnet = "silc"; autojoin = "No"; }
+);
+
+aliases = {
+  J = "join";
+  WJOIN = "join -window";
+  WQUERY = "query -window";
+  LEAVE = "part";
+  BYE = "quit";
+  EXIT = "quit";
+  SIGNOFF = "quit";
+  DESCRIBE = "action";
+  DATE = "time";
+  HOST = "userhost";
+  LAST = "lastlog";
+  SAY = "msg *";
+  WI = "whois";
+  WII = "whois $0 $0";
+  WW = "whowas";
+  W = "who";
+  N = "names";
+  M = "msg";
+  T = "topic";
+  C = "clear";
+  CL = "clear";
+  K = "kick";
+  KB = "kickban";
+  KN = "knockout";
+  BANS = "ban";
+  B = "ban";
+  MUB = "unban *";
+  UB = "unban";
+  IG = "ignore";
+  UNIG = "unignore";
+  SB = "scrollback";
+  UMODE = "mode $N";
+  WC = "window close";
+  WN = "window new hide";
+  SV = "say Irssi $J ($V) - http://irssi.org/";
+  GOTO = "sb goto";
+  CHAT = "dcc chat";
+  RUN = "SCRIPT LOAD";
+  UPTIME = "eval exec - expr `date +%s` - \\$F | awk '{print \"Irssi uptime: \"int(\\\\\\$1/3600/24)\"d \"int(\\\\\\$1/3600%24)\"h \"int(\\\\\\$1/60%60)\"m \"int(\\\\\\$1%60)\"s\" }'";
+  CALC = "exec - if which bc &>/dev/null\\; then echo '$*' | bc | awk '{print \"$*=\"$$1}'\\; else echo bc was not found\\; fi";
+  SBAR = "STATUSBAR";
+  INVITELIST = "mode $C +I";
+  Q = "QUERY";
+};
+
+statusbar = {
+  # formats:
+  # when using {templates}, the template is shown only if it's argument isn't
+  # empty unless no argument is given. for example {sb} is printed always,
+  # but {sb $T} is printed only if $T isn't empty.
+
+  items = {
+    # start/end text in statusbars
+    barstart = "{sbstart}";
+    barend = "{sbend}";
+
+    topicbarstart = "{topicsbstart}";
+    topicbarend = "{topicsbend}";
+
+    # treated "normally", you could change the time/user name to whatever
+    time = "{sb $Z}";
+    user = "{sb {sbnickmode $cumode}$N{sbmode $usermode}{sbaway $A}}";
+
+    # treated specially .. window is printed with non-empty windows,
+    # window_empty is printed with empty windows
+    window = "{sb $winref:$itemname{sbmode $M}}";
+    window_empty = "{sb $winref{sbservertag $tag}}";
+    prompt = "{prompt $[.15]itemname}";
+    prompt_empty = "{prompt $winname}";
+    topic = " $topic";
+    topic_empty = " Irssi v$J - http://irssi.org/help/";
+
+    # all of these treated specially, they're only displayed when needed
+    lag = "{sb Lag: $0-}";
+    act = "{sb Act: $0-}";
+    more = "-- more --";
+  };
+
+  # there's two type of statusbars. root statusbars are either at the top
+  # of the screen or at the bottom of the screen. window statusbars are at
+  # the top/bottom of each split window in screen.
+  default = {
+    # the "default statusbar" to be displayed at the bottom of the window.
+    # contains all the normal items.
+    window = {
+      disabled = "no";
+
+      # window, root
+      type = "window";
+      # top, bottom
+      placement = "bottom";
+      # number
+      position = "1";
+      # active, inactive, always
+      visible = "always";
+
+      # list of items in statusbar in the display order
+      items = {
+        barstart = { priority = "100"; };
+        time = { };
+        user = { };
+        window = { };
+        window_empty = { };
+        lag = { priority = "-1"; };
+        more = { priority = "-1"; alignment = "right"; };
+        barend = { priority = "100"; alignment = "right"; };
+      };
+    };
+
+    # statusbar to use in inactive split windows
+    window_inact = {
+      type = "window";
+      placement = "bottom";
+      position = "1";
+      visible = "inactive";
+      items = {
+        barstart = { priority = "100"; };
+        window = { };
+        window_empty = { };
+        more = { priority = "-1"; alignment = "right"; };
+        barend = { priority = "100"; alignment = "right"; };
+      };
+    };
+
+    # we treat input line as yet another statusbar :) It's possible to
+    # add other items before or after the input line item.
+    prompt = {
+      type = "root";
+      placement = "bottom";
+      # we want to be at the bottom always
+      position = "100";
+      visible = "always";
+      items = {
+        prompt = { priority = "-1"; };
+        prompt_empty = { priority = "-1"; };
+        # treated specially, this is the real input line.
+        input = { priority = "10"; };
+      };
+    };
+
+    # topicbar
+    topic = {
+      type = "root";
+      placement = "top";
+      position = "1";
+      visible = "always";
+      items = {
+        topicbarstart = { priority = "100"; };
+        topic = { };
+        topic_empty = { };
+        topicbarend = { priority = "100"; alignment = "right"; };
+      };
+    };
+    awl_0 = {
+      items = {
+        barstart = { priority = "100"; };
+        awl_0 = { };
+        barend = { priority = "100"; alignment = "right"; };
+      };
+    };
+  };
+};
+settings = {
+  core = {
+    real_name = "Matthew Turk";
+    user_name = "mjturk";
+    nick = "mjturk";
+  };
+  "fe-text" = { actlist_sort = "refnum"; };
+  "perl/core/scripts" = {
+    awl_placement = "bottom";
+    awl_display_key = "$Q%K|%n$H$C$S";
+  };
+  "fe-common/core" = { theme = "agon"; max_command_history = "0"; };
+};

irssi/config.autosave

+servers = (
+  { address = "irc.stealth.net"; chatnet = "IRCnet"; port = "6668"; },
+  { address = "irc.efnet.net"; chatnet = "EFNet"; port = "6667"; },
+  { 
+    address = "irc.undernet.org";
+    chatnet = "Undernet";
+    port = "6667";
+  },
+  { address = "irc.dal.net"; chatnet = "DALnet"; port = "6667"; },
+  { 
+    address = "irc.freenode.net";
+    chatnet = "freenode";
+    port = "7000";
+  },
+  { address = "irc.gnome.org"; chatnet = "GIMPNet"; port = "6667"; },
+  { address = "irc.ptlink.net"; chatnet = "PTlink"; port = "6667"; },
+  { 
+    address = "irc.sorcery.net";
+    chatnet = "SorceryNet";
+    port = "6667";
+  },
+  { 
+    address = "irc.hashmark.net";
+    chatnet = "Hashmark";
+    port = "6667";
+  },
+  { address = "irc.ptnet.org"; chatnet = "PTnet"; port = "6667"; },
+  { 
+    address = "irc.azzurra.org";
+    chatnet = "AzzurraNET";
+    port = "6667";
+  },
+  { address = "silc.silcnet.org"; chatnet = "SILC"; port = "706"; }
+);
+
+chatnets = {
+  IRCnet = {
+    type = "IRC";
+    max_kicks = "4";
+    max_modes = "3";
+    max_msgs = "5";
+    max_whois = "4";
+    max_query_chans = "5";
+  };
+  EFNet = {
+    type = "IRC";
+    max_kicks = "4";
+    max_modes = "4";
+    max_msgs = "3";
+    max_whois = "1";
+  };
+  Undernet = {
+    type = "IRC";
+    max_kicks = "4";
+    max_modes = "3";
+    max_msgs = "3";
+    max_whois = "30";
+  };
+  DALnet = {
+    type = "IRC";
+    max_kicks = "4";
+    max_modes = "6";
+    max_msgs = "3";
+    max_whois = "30";
+  };
+  freenode = {
+    type = "IRC";
+    max_kicks = "4";
+    max_modes = "4";
+    max_msgs = "1";
+    max_whois = "1";
+    use_ssl = "yes";
+    ssl_verify = "yes";
+    ssl_capath = "/etc/ssl/certs";
+  };
+  GIMPNet = {
+    type = "IRC";
+    max_kicks = "4";
+    max_modes = "4";
+    max_msgs = "3";
+    max_whois = "1";
+  };
+  PTlink = {
+    type = "IRC";
+    max_kicks = "1";
+    max_modes = "6";
+    max_msgs = "30";
+    max_whois = "1";
+  };
+  SorceryNet = {
+    type = "IRC";
+    max_kicks = "30";
+    max_modes = "6";
+    max_msgs = "30";
+    max_whois = "30";
+  };
+  Hashmark = {
+    type = "IRC";
+    max_kicks = "4";
+    max_modes = "3";
+    max_msgs = "3";
+    max_whois = "30";
+  };
+  PTnet = {
+    type = "IRC";
+    max_kicks = "30";
+    max_modes = "13";
+    max_msgs = "10";
+    max_whois = "30";
+  };
+  AzzurraNET = {
+    type = "IRC";
+    max_kicks = "4";
+    max_modes = "6";
+    max_msgs = "3";
+  };
+  SILC = { type = "SILC"; };
+};
+
+channels = (
+  { name = "#irssi"; chatnet = "ircnet"; autojoin = "No"; },
+  { name = "#irssi"; chatnet = "freenode"; autojoin = "No"; },
+  { name = "silc"; chatnet = "silc"; autojoin = "No"; }
+);
+
+aliases = {
+  J = "join";
+  WJOIN = "join -window";
+  WQUERY = "query -window";
+  LEAVE = "part";
+  BYE = "quit";
+  EXIT = "quit";
+  SIGNOFF = "quit";
+  DESCRIBE = "action";
+  DATE = "time";
+  HOST = "userhost";
+  LAST = "lastlog";
+  SAY = "msg *";
+  WI = "whois";
+  WII = "whois $0 $0";
+  WW = "whowas";
+  W = "who";
+  N = "names";
+  M = "msg";
+  T = "topic";
+  C = "clear";
+  CL = "clear";
+  K = "kick";
+  KB = "kickban";
+  KN = "knockout";
+  BANS = "ban";
+  B = "ban";
+  MUB = "unban *";
+  UB = "unban";
+  IG = "ignore";
+  UNIG = "unignore";
+  SB = "scrollback";
+  UMODE = "mode $N";
+  WC = "window close";
+  WN = "window new hide";
+  SV = "say Irssi $J ($V) - http://irssi.org/";
+  GOTO = "sb goto";
+  CHAT = "dcc chat";
+  RUN = "SCRIPT LOAD";
+  UPTIME = "eval exec - expr `date +%s` - \\$F | awk '{print \"Irssi uptime: \"int(\\\\\\$1/3600/24)\"d \"int(\\\\\\$1/3600%24)\"h \"int(\\\\\\$1/60%60)\"m \"int(\\\\\\$1%60)\"s\" }'";
+  CALC = "exec - if which bc &>/dev/null\\; then echo '$*' | bc | awk '{print \"$*=\"$$1}'\\; else echo bc was not found\\; fi";
+  SBAR = "STATUSBAR";
+  INVITELIST = "mode $C +I";
+  Q = "QUERY";
+};
+
+statusbar = {
+  # formats:
+  # when using {templates}, the template is shown only if it's argument isn't
+  # empty unless no argument is given. for example {sb} is printed always,
+  # but {sb $T} is printed only if $T isn't empty.
+
+  items = {
+    # start/end text in statusbars
+    barstart = "{sbstart}";
+    barend = "{sbend}";
+
+    topicbarstart = "{topicsbstart}";
+    topicbarend = "{topicsbend}";
+
+    # treated "normally", you could change the time/user name to whatever
+    time = "{sb $Z}";
+    user = "{sb {sbnickmode $cumode}$N{sbmode $usermode}{sbaway $A}}";
+
+    # treated specially .. window is printed with non-empty windows,
+    # window_empty is printed with empty windows
+    window = "{sb $winref:$itemname{sbmode $M}}";
+    window_empty = "{sb $winref{sbservertag $tag}}";
+    prompt = "{prompt $[.15]itemname}";
+    prompt_empty = "{prompt $winname}";
+    topic = " $topic";
+    topic_empty = " Irssi v$J - http://irssi.org/help/";
+
+    # all of these treated specially, they're only displayed when needed
+    lag = "{sb Lag: $0-}";
+    act = "{sb Act: $0-}";
+    more = "-- more --";
+  };
+
+  # there's two type of statusbars. root statusbars are either at the top
+  # of the screen or at the bottom of the screen. window statusbars are at
+  # the top/bottom of each split window in screen.
+  default = {
+    # the "default statusbar" to be displayed at the bottom of the window.
+    # contains all the normal items.
+    window = {
+      disabled = "no";
+
+      # window, root
+      type = "window";
+      # top, bottom
+      placement = "bottom";
+      # number
+      position = "1";
+      # active, inactive, always
+      visible = "always";
+
+      # list of items in statusbar in the display order
+      items = {
+        barstart = { priority = "100"; };
+        time = { };
+        user = { };
+        window = { };
+        window_empty = { };
+        lag = { priority = "-1"; };
+        more = { priority = "-1"; alignment = "right"; };
+        barend = { priority = "100"; alignment = "right"; };
+      };
+    };
+
+    # statusbar to use in inactive split windows
+    window_inact = {
+      type = "window";
+      placement = "bottom";
+      position = "1";
+      visible = "inactive";
+      items = {
+        barstart = { priority = "100"; };
+        window = { };
+        window_empty = { };
+        more = { priority = "-1"; alignment = "right"; };
+        barend = { priority = "100"; alignment = "right"; };
+      };
+    };
+
+    # we treat input line as yet another statusbar :) It's possible to
+    # add other items before or after the input line item.
+    prompt = {
+      type = "root";
+      placement = "bottom";
+      # we want to be at the bottom always
+      position = "100";
+      visible = "always";
+      items = {
+        prompt = { priority = "-1"; };
+        prompt_empty = { priority = "-1"; };
+        # treated specially, this is the real input line.
+        input = { priority = "10"; };
+      };
+    };
+
+    # topicbar
+    topic = {
+      type = "root";
+      placement = "top";
+      position = "1";
+      visible = "always";
+      items = {
+        topicbarstart = { priority = "100"; };
+        topic = { };
+        topic_empty = { };
+        topicbarend = { priority = "100"; alignment = "right"; };
+      };
+    };
+    awl_0 = {
+      items = {
+        barstart = { priority = "100"; };
+        awl_0 = { };
+        barend = { priority = "100"; alignment = "right"; };
+      };
+    };
+  };
+};
+settings = {
+  core = {
+    real_name = "Matthew Turk";
+    user_name = "mjturk";
+    nick = "mjturk";
+  };
+  "fe-text" = { actlist_sort = "refnum"; };
+  "perl/core/scripts" = {
+    awl_placement = "bottom";
+    awl_display_key = "$Q%K|%n$H$C$S";
+  };
+  "fe-common/core" = { theme = "agon"; };
+};

irssi/default.theme

+# When testing changes, the easiest way to reload the theme is with /RELOAD.
+# This reloads the configuration file too, so if you did any changes remember
+# to /SAVE it first. Remember also that /SAVE overwrites the theme file with
+# old data so keep backups :)
+
+# TEMPLATES:
+
+# The real text formats that irssi uses are the ones you can find with
+# /FORMAT command. Back in the old days all the colors and texts were mixed
+# up in those formats, and it was really hard to change the colors since you
+# might have had to change them in tens of different places. So, then came
+# this templating system.
+
+# Now the /FORMATs don't have any colors in them, and they also have very
+# little other styling. Most of the stuff you need to change is in this
+# theme file. If you can't change something here, you can always go back
+# to change the /FORMATs directly, they're also saved in these .theme files.
+
+# So .. the templates. They're those {blahblah} parts you see all over the
+# /FORMATs and here. Their usage is simply {name parameter1 parameter2}.
+# When irssi sees this kind of text, it goes to find "name" from abstracts
+# block below and sets "parameter1" into $0 and "parameter2" into $1 (you
+# can have more parameters of course). Templates can have subtemplates.
+# Here's a small example:
+#   /FORMAT format hello {colorify {underline world}}
+#   abstracts = { colorify = "%G$0-%n"; underline = "%U$0-%U"; }
+# When irssi expands the templates in "format", the final string would be:
+#   hello %G%Uworld%U%n
+# ie. underlined bright green "world" text.
+# and why "$0-", why not "$0"? $0 would only mean the first parameter,
+# $0- means all the parameters. With {underline hello world} you'd really
+# want to underline both of the words, not just the hello (and world would
+# actually be removed entirely).
+
+# COLORS:
+
+# You can find definitions for the color format codes in docs/formats.txt.
+
+# There's one difference here though. %n format. Normally it means the
+# default color of the terminal (white mostly), but here it means the
+# "reset color back to the one it was in higher template". For example
+# if there was /FORMAT test %g{foo}bar, and foo = "%Y$0%n", irssi would
+# print yellow "foo" (as set with %Y) but "bar" would be green, which was
+# set at the beginning before the {foo} template. If there wasn't the %g
+# at start, the normal behaviour of %n would occur. If you _really_ want
+# to use the terminal's default color, use %N.
+
+#############################################################################
+
+# default foreground color (%N) - -1 is the "default terminal color"
+default_color = "-1";
+
+# print timestamp/servertag at the end of line, not at beginning
+info_eol = "false";
+
+# these characters are automatically replaced with specified color
+# (dark grey by default)
+replaces = { "[]=" = "%K$*%n"; };
+
+abstracts = {
+  ##
+  ## generic
+  ##
+
+  # text to insert at the beginning of each non-message line
+  line_start = "%B-%n!%B-%n ";
+
+  # timestamp styling, nothing by default
+  timestamp = "$*";
+
+  # any kind of text that needs hilighting, default is to bold
+  hilight = "%_$*%_";
+
+  # any kind of error message, default is bright red
+  error = "%R$*%n";
+
+  # channel name is printed
+  channel = "%_$*%_";
+
+  # nick is printed
+  nick = "%_$*%_";
+
+  # nick host is printed
+  nickhost = "[$*]";
+
+  # server name is printed
+  server = "%_$*%_";
+
+  # some kind of comment is printed
+  comment = "[$*]";
+
+  # reason for something is printed (part, quit, kick, ..)
+  reason = "{comment $*}";
+
+  # mode change is printed ([+o nick])
+  mode = "{comment $*}";
+
+  ##
+  ## channel specific messages
+  ##
+
+  # highlighted nick/host is printed (joins)
+  channick_hilight = "%C$*%n";
+  chanhost_hilight = "{nickhost %c$*%n}";
+
+  # nick/host is printed (parts, quits, etc.)
+  channick = "%c$*%n";
+  chanhost = "{nickhost $*}";
+
+  # highlighted channel name is printed
+  channelhilight = "%c$*%n";
+
+  # ban/ban exception/invite list mask is printed
+  ban = "%c$*%n";
+
+  ##
+  ## messages
+  ##
+
+  # the basic styling of how to print message, $0 = nick mode, $1 = nick
+  msgnick = "%K<%n$0$1-%K>%n %|";
+
+  # message from you is printed. "msgownnick" specifies the styling of the
+  # nick ($0 part in msgnick) and "ownmsgnick" specifies the styling of the
+  # whole line.
+
+  # Example1: You want the message text to be green:
+  #  ownmsgnick = "{msgnick $0 $1-}%g";
+  # Example2.1: You want < and > chars to be yellow:
+  #  ownmsgnick = "%Y{msgnick $0 $1-%Y}%n";
+  #  (you'll also have to remove <> from replaces list above)
+  # Example2.2: But you still want to keep <> grey for other messages:
+  #  pubmsgnick = "%K{msgnick $0 $1-%K}%n";
+  #  pubmsgmenick = "%K{msgnick $0 $1-%K}%n";
+  #  pubmsghinick = "%K{msgnick $1 $0$2-%n%K}%n";
+  #  ownprivmsgnick = "%K{msgnick  $*%K}%n";
+  #  privmsgnick = "%K{msgnick  %R$*%K}%n";
+
+  # $0 = nick mode, $1 = nick
+  ownmsgnick = "{msgnick $0 $1-}";
+  ownnick = "%_$*%n";
+
+  # public message in channel, $0 = nick mode, $1 = nick
+  pubmsgnick = "{msgnick $0 $1-}";
+  pubnick = "%N$*%n";
+
+  # public message in channel meant for me, $0 = nick mode, $1 = nick
+  pubmsgmenick = "{msgnick $0 $1-}";
+  menick = "%Y$*%n";
+
+  # public highlighted message in channel
+  # $0 = highlight color, $1 = nick mode, $2 = nick
+  pubmsghinick = "{msgnick $1 $0$2-%n}";
+
+  # channel name is printed with message
+  msgchannel = "%K:%c$*%n";
+
+  # private message, $0 = nick, $1 = host
+  privmsg = "[%R$0%K(%r$1-%K)%n] ";
+
+  # private message from you, $0 = "msg", $1 = target nick
+  ownprivmsg = "[%r$0%K(%R$1-%K)%n] ";
+
+  # own private message in query
+  ownprivmsgnick = "{msgnick  $*}";
+  ownprivnick = "%_$*%n";
+
+  # private message in query
+  privmsgnick = "{msgnick  %R$*%n}";
+
+  ##
+  ## Actions (/ME stuff)
+  ##
+
+  # used internally by this theme
+  action_core = "%_ * $*%n";
+
+  # generic one that's used by most actions
+  action = "{action_core $*} ";
+
+  # own action, both private/public
+  ownaction = "{action $*}";
+
+  # own action with target, both private/public
+  ownaction_target = "{action_core $0}%K:%c$1%n ";
+
+  # private action sent by others
+  pvtaction = "%_ (*) $*%n ";
+  pvtaction_query = "{action $*}";
+
+  # public action sent by others
+  pubaction = "{action $*}";
+
+
+  ##
+  ## other IRC events
+  ##
+
+  # whois
+  whois = "%# $[8]0 : $1-";
+
+  # notices
+  ownnotice = "[%r$0%K(%R$1-%K)]%n ";
+  notice = "%K-%M$*%K-%n ";
+  pubnotice_channel = "%K:%m$*";
+  pvtnotice_host = "%K(%m$*%K)";
+  servernotice = "%g!$*%n ";
+
+  # CTCPs
+  ownctcp = "[%r$0%K(%R$1-%K)] ";
+  ctcp = "%g$*%n";
+
+  # wallops
+  wallop = "%_$*%n: ";
+  wallop_nick = "%n$*";
+  wallop_action = "%_ * $*%n ";
+
+  # netsplits
+  netsplit = "%R$*%n";
+  netjoin = "%C$*%n";
+
+  # /names list
+  names_prefix = "";
+  names_nick = "[%_$0%_$1-] ";
+  names_nick_op = "{names_nick $*}";
+  names_nick_halfop = "{names_nick $*}";
+  names_nick_voice = "{names_nick $*}";
+  names_users = "[%g$*%n]";
+  names_channel = "%G$*%n";
+
+  # DCC
+  dcc = "%g$*%n";
+  dccfile = "%_$*%_";
+
+  # DCC chat, own msg/action
+  dccownmsg = "[%r$0%K($1-%K)%n] ";
+  dccownnick = "%R$*%n";
+  dccownquerynick = "%_$*%n";
+  dccownaction = "{action $*}";
+  dccownaction_target = "{action_core $0}%K:%c$1%n ";
+
+  # DCC chat, others
+  dccmsg = "[%G$1-%K(%g$0%K)%n] ";
+  dccquerynick = "%G$*%n";
+  dccaction = "%_ (*dcc*) $*%n %|";
+
+  ##
+  ## statusbar
+  ##
+
+  # default background for all statusbars. You can also give
+  # the default foreground color for statusbar items.
+  sb_background = "%4%w";
+
+  # default backround for "default" statusbar group
+  #sb_default_bg = "%4";
+  # background for prompt / input line
+  sb_prompt_bg = "%n";
+  # background for info statusbar
+  sb_info_bg = "%8";
+  # background for topicbar (same default)
+  #sb_topic_bg = "%4";
+
+  # text at the beginning of statusbars. sb-item already puts
+  # space there,so we don't use anything by default.
+  sbstart = "";
+  # text at the end of statusbars. Use space so that it's never
+  # used for anything.
+  sbend = " ";
+
+  topicsbstart = "{sbstart $*}";
+  topicsbend = "{sbend $*}";
+
+  prompt = "[$*] ";
+
+  sb = " %c[%n$*%c]%n";
+  sbmode = "(%c+%n$*)";
+  sbaway = " (%GzZzZ%n)";
+  sbservertag = ":$0 (change with ^X)";
+  sbnickmode = "$0";
+
+  # activity in statusbar
+
+  # ',' separator
+  sb_act_sep = "%c$*";
+  # normal text
+  sb_act_text = "%c$*";
+  # public message
+  sb_act_msg = "%W$*";
+  # hilight
+  sb_act_hilight = "%M$*";
+  # hilight with specified color, $0 = color, $1 = text
+  sb_act_hilight_color = "$0$1-%n";
+};

irssi/scripts/autorun/adv_windowlist.pl

+use strict; # use warnings;
+
+# {{{ debug
+
+#BEGIN {
+#	open STDERR, '>', '/home/ailin/wlstatwarnings';
+#};
+
+# FIXME COULD SOMEONE PLEASE TELL ME HOW TO SHUT UP
+#
+# ...
+# Variable "*" will not stay shared at (eval *) line *.
+# Variable "*" will not stay shared at (eval *) line *.
+# ...
+# Can't locate package Irssi::Nick for @Irssi::Irc::Nick::ISA at (eval *) line *.
+# ...
+#
+# THANKS
+
+# }}}
+
+# if you don't know how to operate folds, type zn
+
+# {{{ header
+
+use Irssi (); # which is the minimum required version of Irssi ?
+use Irssi::TextUI;
+
+use vars qw($VERSION %IRSSI);
+
+$VERSION = '0.6ca';
+%IRSSI = (
+	original_authors => q(BC-bd,        Veli,          Timo Sirainen, ).
+	                    q(Wouter Coekaerts,    Jean-Yves Lefort), # (decadix)
+	original_contact => q(bd@bc-bd.org, veli@piipiip.net, tss@iki.fi, ).
+	                    q(wouter@coekaerts.be, jylefort@brutele.be),
+	authors          => q(Nei),
+	contact          => q(Nei @ anti@conference.jabber.teamidiot.de),
+	url              =>  "http://anti.teamidiot.de/",
+	name             => q(awl),
+	description      => q(Adds a permanent advanced window list on the right or ).
+	                    q(in a statusbar.),
+	description2     => q(Based on chanact.pl which was apparently based on ).
+	                    q(lightbar.c and nicklist.pl with various other ideas ).
+	                    q(from random scripts.),
+	license          => q(GNU GPLv2 or later),
+);
+
+# }}}
+
+# {{{ *** D O C U M E N T A T I O N ***
+
+# adapted by Nei
+
+###############
+# {{{ original comment
+# ###########
+# # Adds new powerful and customizable [Act: ...] item (chanelnames,modes,alias).
+# # Lets you give alias characters to windows so that you can select those with
+# # meta-<char>.
+# #
+# # for irssi 0.8.2 by bd@bc-bd.org
+# #
+# # inspired by chanlist.pl by 'cumol@hammerhart.de'
+# #
+# #########
+# # {{{ Contributors
+# #########
+# #
+# # veli@piipiip.net   /window_alias code
+# # qrczak@knm.org.pl  chanact_abbreviate_names
+# # qerub@home.se      Extra chanact_show_mode and chanact_chop_status
+# # }}}
+# }}}
+# 
+# {{{ FURTHER THANKS TO
+# ############
+# # buu, fxn, Somni, Khisanth, integral, tybalt89   for much support in any aspect perl
+# # and the channel in general ( #perl @ freenode ) and especially the ir_* functions
+# #
+# # Valentin 'senneth' Batz ( vb@g-23.org ) for the pointer to grep.pl, continuous support
+# #                                         and help in digging up ir_strip_codes
+# #
+# # OnetrixNET technology networks for the debian environment
+# #
+# # Monkey-Pirate.com / Spaceman Spiff for the webspace
+# #
+# }}}
+
+######
+# {{{ M A I N    P R O B L E M
+#####
+#
+# It is impossible to place the awl on a statusbar together with other items,
+# because I do not know how to calculate the size that it is going to get
+# granted, and therefore I cannot do the linebreaks properly.
+# This is what is missing to make a nice script out of awl.
+# If you have any ideas, please contact me ASAP :).
+# }}}
+######
+
+######
+# {{{ UTF-8 PROBLEM
+#####
+#
+# Please help me find a solution to this:
+# this be your statusbar, it is using up the maximum term size
+# [[1=1]#abc [2=2]#defghi]
+# 
+# now consider this example:i
+# "ascii" characters are marked with ., utf-8 characters with *
+# [[1=1]#... [2=2]#...***]
+#
+# you should think that this is how it would be displayed? WRONG!
+# [[1=1]#... [2=2]#...***   ]
+#
+# this is what Irssi does.. I believe my length calculating code to be correct,
+# however, I'd love to be proven wrong (or receive any other fix, too, of
+# course!)
+# }}}
+######
+
+#########
+# {{{ USAGE
+###
+#
+# copy the script to ~/.irssi/scripts/
+#
+# In irssi:
+#
+#		/script load awl
+#
+#
+# Hint: to get rid of the old [Act:] display
+#     /statusbar window remove act
+#
+# to get it back:
+#     /statusbar window add -after lag -priority 10 act
+# }}}
+##########
+# {{{ OPTIONS
+########
+#
+# {{{ /set awl_display_nokey <string>
+#     /set awl_display_key <string>
+#     /set awl_display_nokey_active <string>
+#     /set awl_display_key_active <string>
+#     * string : Format String for one window. The following $'s are expanded:
+#         $C : Name
+#         $N : Number of the Window
+#         $Q : meta-Keymap
+#         $H : Start highlighting
+#         $S : Stop highlighting
+#             /+++++++++++++++++++++++++++++++++,
+#            | ****  I M P O R T A N T :  ****  |
+#            |                                  |
+#            | don't forget  to use  $S  if you |
+#            | used $H before!                  |
+#            |                                  |
+#            '+++++++++++++++++++++++++++++++++/
+#       XXX NOTE ON *_active: there is a BUG somewhere in the length
+#       XXX calculation. currently it's best to NOT remove $H/$S from those
+#       XXX settings if you use it in the non-active settings.
+# }}}
+# {{{ /set awl_separator <string>
+#     * string : Charater to use between the channel entries
+#     you'll need to escape " " space and "$" like this:
+#     "/set awl_separator \ "
+#     "/set awl_separator \$"
+#     and {}% like this:
+#     "/set awl_separator %{"
+#     "/set awl_separator %}"
+#     "/set awl_separator %%"
+#     (reason being, that the separator is used inside a {format })
+# }}}
+# {{{ /set awl_prefer_name <ON|OFF>
+#     * this setting decides whether awl will use the active_name (OFF) or the
+#       window name as the name/caption in awl_display_*.
+#       That way you can rename windows using /window name myownname.
+# }}}
+# {{{ /set awl_hide_data <num>
+#     * num : hide the window if its data_level is below num
+#     set it to 0 to basically disable this feature,
+#               1 if you don't want windows without activity to be shown
+#               2 to show only those windows with channel text or hilight
+#               3 to show only windows with hilight
+# }}}
+# {{{ /set awl_maxlines <num>
+#     * num : number of lines to use for the window list (0 to disable, negative
+#       lock)
+# }}}
+# {{{ /set awl_columns <num>
+#     * num : number of columns to use in screen mode (0 for unlimited)
+# }}}
+# {{{ /set awl_block <num>
+#     * num : width of a column in screen mode (negative values = block display)
+#             /+++++++++++++++++++++++++++++++++,
+#            | ******  W A R N I N G !  ******  |
+#            |                                  |
+#            | If  your  block  display  looks  |
+#            | DISTORTED,  you need to add the  |
+#            | following  line to your  .theme  |
+#            | file under                       |
+#            |     abstracts = {             :  |
+#            |                                  |
+#            |       sb_act_none = "%n$*";      |
+#            |                                  |
+#            '+++++++++++++++++++++++++++++++++/
+#.02:08:26. < shi>  Irssi::current_theme()->get_format <.. can this be used?
+# }}}
+# {{{ /set awl_sbar_maxlength <ON|OFF>
+#     * if you enable the maxlength setting, the block width will be used as a
+#       maximum length for the non-block statusbar mode too.
+# }}}
+# {{{ /set awl_height_adjust <num>
+#     * num : how many lines to leave empty in screen mode
+# }}}
+# {{{ /set awl_sort <-data_level|-last_line|refnum>
+#     * you can change the window sort order with this variable
+#         -data_level : sort windows with hilight first
+#         -last_line  : sort windows in order of activity
+#         refnum      : sort windows by window number
+# }}}
+# {{{ /set awl_placement <top|bottom>
+#     /set awl_position <num>
+#     * these settings correspond to /statusbar because awl will create
+#       statusbars for you
+#     (see /help statusbar to learn more)
+# }}}
+# {{{ /set awl_all_disable <ON|OFF>
+#     * if you set awl_all_disable to ON, awl will also remove the
+#       last statusbar it created if it is empty.
+#       As you might guess, this only makes sense with awl_hide_data > 0 ;)
+# }}}
+# {{{ /set awl_automode <sbar|screen|emulate_lightbar>
+#     * this setting defines whether the window list is shown in statusbars or
+#       whether the screen hack is used (from nicklist.pl)
+# }}}
+# }}}
+##########
+# {{{ COMMANDS
+########
+# {{{ /awl paste <ON|OFF|TOGGLE>
+#     * enables or disables the screen hack windowlist. This is useful when you
+#       want to mark & copy text that you want to paste somewhere (hence the
+#       name). (ON means AWL disabled!)
+#       This is nicely bound to a function key for example.
+# }}}
+# {{{ /awl redraw
+#     * redraws the screen hack windowlist. There are many occasions where the
+#       screen hack windowlist can get destroyed so you can use this command to
+#       fix it.
+# }}}
+# }}}
+###
+# {{{ WISHES
+####
+#
+# if you fiddle with my mess, provide me with your fixes so I can benefit as well
+#
+# Nei =^.^= ( anti@conference.jabber.teamidiot.de )
+# }}}
+
+# }}}
+
+# {{{ modules
+
+#use Class::Classless;
+#use Term::Info;
+
+# }}}
+
+# {{{ global variables
+
+my $replaces = '[=]'; # AARGH!!! (chars that are always surrounded by weird
+                      # colour codes by Irssi)
+
+my $actString = [];   # statusbar texts
+my $currentLines = 0;
+my $resetNeeded;      # layout/screen has changed, redo everything
+my $needRemake;       # "normal" changes
+#my $callcount = 0;
+sub GLOB_QUEUE_TIMER () { 100 }
+my $globTime = undef; # timer to limit remake() calls
+
+
+my $SCREEN_MODE;
+my $DISABLE_SCREEN_TEMP;
+my $currentColumns = 0;
+my $screenResizing;
+my ($screenHeight, $screenWidth);
+my $screenansi = bless {
+	NAME => 'Screen::ANSI',
+	PARENTS => [],
+	METHODS => {
+		dcs   => sub { "\033P" },
+		st    => sub { "\033\\"},
+	}
+}, 'Class::Classless::X';
+#my $terminfo = new Term::Info 'xterm'; # xterm here, make this modular
+# {{{{{{{{{{{{{{{
+my $terminfo = bless { # xterm here, make this modular
+	NAME => 'Term::Info::xterm',
+	PARENTS => [],
+	METHODS => {
+ # 	civis=\E[?25l,
+		civis => sub { "\033[?25l" },
+ # 	sc=\E7,
+		sc    => sub { "\0337" },
+ # 	cup=\E[%i%p1%d;%p2%dH,
+		cup   => sub { shift;shift; "\033[" . ($_[0] + 1) . ';' . ($_[1] + 1) . 'H' },
+ # 	el=\E[K,
+		el    => sub { "\033[K" },
+ # 	rc=\E8,
+		rc    => sub { "\0338" },
+ # 	cnorm=\E[?25h,
+		cnorm => sub { "\033[?25h" },
+ # 	setab=\E[4%p1%dm,
+		setab => sub { shift;shift; "\033[4" . $_[0] . 'm' },
+ # 	setaf=\E[3%p1%dm,
+		setaf => sub { shift;shift; "\033[3" . $_[0] . 'm' },
+ # 	bold=\E[1m,
+		bold  => sub { "\033[1m" },
+ # 	blink=\E[5m,
+		blink => sub { "\033[5m" },
+ # 	rev=\E[7m,
+		rev   => sub { "\033[7m" },
+ # 	op=\E[39;49m,
+		op    => sub { "\033[39;49m" },
+	}
+}, 'Class::Classless::X';
+# }}}}}}}}}}}}}}}
+
+
+sub setc () {
+	$IRSSI{'name'}
+}
+sub set ($) {
+	setc . '_' . shift
+}
+
+# }}}
+
+
+# {{{ sbar mode
+
+my %statusbars;       # currently active statusbars
+
+# maybe I should just tie the array ?
+sub add_statusbar {
+	for (@_) {
+		# add subs
+		for my $l ($_) { {
+			no strict 'refs'; # :P
+			*{set$l} = sub { awl($l, @_) };
+		}; }
+		Irssi::command('statusbar ' . (set$_) . ' reset');
+		Irssi::command('statusbar ' . (set$_) . ' enable');
+		if (lc Irssi::settings_get_str(set 'placement') eq 'top') {
+			Irssi::command('statusbar ' . (set$_) . ' placement top');
+		}
+		if ((my $x = int Irssi::settings_get_int(set 'position')) != 0) {
+			Irssi::command('statusbar ' . (set$_) . ' position ' . $x);
+		}
+		Irssi::command('statusbar ' . (set$_) . ' add -priority 100 -alignment left barstart');
+		Irssi::command('statusbar ' . (set$_) . ' add ' . (set$_));
+		Irssi::command('statusbar ' . (set$_) . ' add -priority 100 -alignment right barend');
+		Irssi::command('statusbar ' . (set$_) . ' disable');
+		Irssi::statusbar_item_register(set$_, '$0', set$_);
+		$statusbars{$_} = {};
+	}
+}
+
+sub remove_statusbar {
+	for (@_) {
+		Irssi::command('statusbar ' . (set$_) . ' reset');
+		Irssi::statusbar_item_unregister(set$_); # XXX does this actually work ?
+		# DO NOT REMOVE the sub before you have unregistered it :))
+		for my $l ($_) { {
+			no strict 'refs';
+			undef &{set$l};
+		}; }
+		delete $statusbars{$_};
+	}
+}
+
+sub syncLines {
+	my $temp = $currentLines;
+	$currentLines = @$actString;
+	#Irssi::print("current lines: $temp new lines: $currentLines");
+	my $currMaxLines = Irssi::settings_get_int(set 'maxlines');
+	if ($currMaxLines > 0 and @$actString > $currMaxLines) {
+		$currentLines = $currMaxLines;
+	}
+	elsif ($currMaxLines < 0) {
+		$currentLines = abs($currMaxLines);
+	}
+	return if ($temp == $currentLines);
+	if ($currentLines > $temp) {
+		for ($temp .. ($currentLines - 1)) {
+			add_statusbar($_);
+			Irssi::command('statusbar ' . (set$_) . ' enable');
+		}
+	}
+	else {
+		for ($_ = ($temp - 1); $_ >= $currentLines; $_--) {
+			Irssi::command('statusbar ' . (set$_) . ' disable');
+			remove_statusbar($_);
+		}
+	}
+}
+
+# FIXME implement $get_size_only check, and user $item->{min|max-size} ??
+sub awl {
+	my ($line, $item, $get_size_only) = @_;
+
+	if ($needRemake) {
+		$needRemake = undef;
+		remake();
+	}
+
+	my $text = $actString->[$line];  # DO NOT set the actual $actString->[$line] to '' here or
+	$text = '' unless defined $text; # you'll screw up the statusbar counter ($currentLines)
+	$item->default_handler($get_size_only, $text, '', 1);
+}
+
+# remove old statusbars
+my %killBar;
+sub get_old_status {
+	my ($textDest, $cont, $cont_stripped) = @_;
+	if ($textDest->{'level'} == 524288 and $textDest->{'target'} eq ''
+			and !defined($textDest->{'server'})
+	) {
+		my $name = quotemeta(set '');
+		if ($cont_stripped =~ m/^$name(\d+)\s/) { $killBar{$1} = {}; }
+		Irssi::signal_stop();
+	}
+}
+sub killOldStatus {
+	%killBar = ();
+	Irssi::signal_add_first('print text' => 'get_old_status');
+	Irssi::command('statusbar');
+	Irssi::signal_remove('print text' => 'get_old_status');
+	remove_statusbar(keys %killBar);
+}
+#killOldStatus();
+
+# end sbar mode }}}
+
+
+# {{{ keymaps
+
+my %keymap;
+
+sub get_keymap {
+	my ($textDest, undef, $cont_stripped) = @_;
+	if ($textDest->{'level'} == 524288 and $textDest->{'target'} eq ''
+			and !defined($textDest->{'server'})
+	) {
+		if ($cont_stripped =~ m/((?:meta-)+)(.)\s+change_window (\d+)/) {
+			my ($level, $key, $window) = ($1, $2, $3);
+			my $numlevel = ($level =~ y/-//) - 1;
+			$keymap{$window} = ('-' x $numlevel) . "$key";
+		}
+		Irssi::signal_stop();
+	}
+}
+
+sub update_keymap {
+	%keymap = ();
+	Irssi::signal_remove('command bind' => 'watch_keymap');
+	Irssi::signal_add_first('print text' => 'get_keymap');
+	Irssi::command('bind'); # stolen from grep
+	Irssi::signal_remove('print text' => 'get_keymap');
+	Irssi::signal_add('command bind' => 'watch_keymap');
+	Irssi::timeout_add_once(100, 'eventChanged', undef);
+}
+
+# watch keymap changes
+sub watch_keymap {
+	Irssi::timeout_add_once(1000, 'update_keymap', undef);
+}
+
+update_keymap();
+
+# end keymaps }}}
+
+# {{{ format handling
+
+# a bad way do do expansions but who cares
+sub expand {
+	my ($string, %format) = @_;
+	my ($exp, $repl);
+	$string =~ s/\$$exp/$repl/g while (($exp, $repl) = each(%format));
+	return $string;
+}
+
+my %strip_table = (
+	# fe-common::core::formats.c:format_expand_styles
+	#      delete                format_backs  format_fores bold_fores   other stuff
+	(map { $_ => '' } (split //, '04261537' .  'kbgcrmyw' . 'KBGCRMYW' . 'U9_8:|FnN>#[')),
+	#      escape
+	(map { $_ => $_ } (split //, '{}%')),
+);
+sub ir_strip_codes { # strip %codes
+	my $o = shift;
+	$o =~ s/(%(.))/exists $strip_table{$2} ? $strip_table{$2} : $1/gex;
+	$o
+}
+
+sub ir_parse_special {
+	my $o; my $i = shift;
+	#if ($_[0]) { # for the future?!?
+	#	eval {
+	#		$o = $_[0]->parse_special($i);
+	#	};
+	#	unless ($@) {
+	#		return $o;
+	#	}
+	#}
+	my $win = shift || Irssi::active_win();
+	my $server = Irssi::active_server();
+	if (ref $win and ref $win->{'active'}) {
+		$o = $win->{'active'}->parse_special($i);
+	}
+	elsif (ref $win and ref $win->{'active_server'}) {
+		$o = $win->{'active_server'}->parse_special($i);
+	}
+	elsif (ref $server) {
+		$o =  $server->parse_special($i);
+	}
+	else {
+		$o = Irssi::parse_special($i);
+	}
+	$o
+}
+sub ir_parse_special_protected {
+	my $o; my $i = shift;
+	$i =~ s/
+		( \\. ) | # skip over escapes (maybe)
+		( \$[^% $\]+ ) # catch special variables
+	/
+		if ($1) { $1 }
+		elsif ($2) { my $i2 = $2; ir_fe(ir_parse_special($i2, @_)) }
+		else { $& }
+	/gex;
+	$i
+}
+
+
+sub sb_ctfe { # Irssi::current_theme->format_expand wrapper
+	Irssi::current_theme->format_expand(
+		shift,
+		(
+			Irssi::EXPAND_FLAG_IGNORE_REPLACES
+				|
+			($_[0]?0:Irssi::EXPAND_FLAG_IGNORE_EMPTY)
+		)
+	)
+}
+sub sb_expand { # expand {format }s (and apply parse_special for $vars)
+	ir_parse_special(
+		sb_ctfe(shift)
+	)
+}
+sub sb_strip {
+	ir_strip_codes(
+		sb_expand(shift)
+	); # does this get us the actual length of that s*ty bar :P ?
+}
+sub sb_length {
+	# unicode cludge, d*mn broken Irssi
+	# screw it, this will fail from broken joining anyway (and cause warnings)
+	my $term_type = 'term_type';
+	if (Irssi::version > 20040819) { # this is probably wrong, but I don't know
+		                              # when the setting name got changed
+		$term_type = 'term_charset';
+	}
+	#if (lc Irssi::settings_get_str($term_type) eq '8bit'
+	#		or Irssi::settings_get_str($term_type) =~ /^iso/i
+	#) {
+	#	length(sb_strip(shift))
+	#}
+	#else {
+	my $temp = sb_strip(shift);
+	# try to get the displayed width
+	my $length;
+	eval {
+		require Text::CharWidth;
+		$length = Text::CharWidth::mbswidth($temp);
+	};
+	unless ($@) {
+		return $length;
+	}
+	else {
+		if (lc Irssi::settings_get_str($term_type) eq 'utf-8') {
+			# try to switch on utf8
+			eval {
+				no warnings;
+				require Encode;
+				#$temp = Encode::decode_utf8($temp); # thanks for the hint, but I have my
+				#                                    # reasons for _utf8_on
+				Encode::_utf8_on($temp);
+			};
+		}
+		# there is nothing more I can do
+		length($temp)
+	}
+	#}
+}
+
+# !!! G*DD*MN Irssi is adding an additional layer of backslashitis per { } layer
+# !!! AND I still don't know what I need to escape.
+# !!! and NOONE else seems to know or care either.
+# !!! f*ck open source. I mean it.
+# XXX any Irssi::print debug statement leads to SEGFAULT - why ?
+
+# major parts of the idea by buu (#perl @ freenode)
+# thanks to fxn and Somni for debugging
+#	while ($_[0] =~ /(.)/g) {
+#		my $c = $1; # XXX sooo... goto kills $1
+#		if ($q eq '%') { goto ESC; }
+
+## <freenode:#perl:tybalt89> s/%(.)|(\{)|(\})|(\\|\$)/$1?$1:$2?($level++,$2):$3?($level>$min_level&&$level--,$3):'\\'x(2**$level-1).$4/ge;  # untested...
+sub ir_escape {
+	my $min_level = $_[1] || 0; my $level = $min_level;
+	my $o = shift;
+	$o =~ s/
+		(	%.	)	| # $1
+		(	\{	)	| # $2
+		(	\}	)	| # $3
+		(	\\	)	| # $4
+		(	\$(?=[^\\])	)	| # $5
+		(	\$	) # $6
+	/
+		if ($1) { $1 } # %. escape
+		elsif ($2) { $level++; $2 } # { nesting start
+		elsif ($3) { if ($level > $min_level) { $level--; } $3 } # } nesting end
+		elsif ($4) { '\\'x(2**$level) } # \ needs \\escaping
+		elsif ($5) { '\\'x(2**$level-1) . '$' . '\\'x(2**$level-1) } # and $ needs even more because of "parse_special"
+		else { '\\'x(2**$level-1) . '$' } # $ needs \$ escaping
+	/gex;
+	$o
+}
+#sub ir_escape {
+#	my $min_level = $_[1] || 0; my $level = $min_level;
+#	my $o = shift;
+#	$o =~ s/
+#		(	%.	)	| # $1
+#		(	\{	)	| # $2
+#		(	\}	)	| # $3
+#		(	\\	|	\$	)	# $4
+#	/
+#		if ($1) { $1 } # %. escape
+#		elsif ($2) { $level++; $2 } # { nesting start
+#		elsif ($3) { if ($level > $min_level) { $level--; } $3 } # } nesting end
+#		else { '\\'x(2**($level-1)-1) . $4 } # \ or $ needs \\escaping
+#	/gex;
+#	$o
+#}
+
+sub ir_fe { # try to fix format stuff
+	my $x = shift;
+	# XXX why do I have to use two/four % here instead of one/two ??
+	# answer: you screwed up in ir_escape
+	$x =~ s/([%{}])/%$1/g;
+	#$x =~ s/(\\|\$|[ ])/\\$1/g; # XXX HOW CAN I HANDLE THE SPACES CORRECTLY XXX
+	$x =~ s/(\\|\$)/\\$1/g;
+	#$x =~ s/(\$(?=.))|(\$)/$1?"\\\$\\":"\\\$"/ge; # I think this should be here
+	#                                              # (logic), but it doesn't work
+	#                                              # that way :P
+	#$x =~ s/\\/\\\\/g; # that's right, escape escapes
+	$x
+}
+sub ir_ve { # escapes special vars but leave colours alone
+	my $x = shift;
+	#$x =~ s/([%{}])/%$1/g;
+	$x =~ s/(\\|\$|[ ])/\\$1/g;
+	$x
+}
+
+my %ansi_table;
+{
+	my ($i, $j, $k) = (0, 0, 0);
+	%ansi_table = (
+		# fe-common::core::formats.c:format_expand_styles
+		#      do                                              format_backs
+		(map { $_ => $terminfo->setab($i++) } (split //, '01234567' )),
+		#      do                                              format_fores
+		(map { $_ => $terminfo->setaf($j++) } (split //, 'krgybmcw' )),
+		#      do                                              bold_fores
+		(map { $_ => $terminfo->bold() .
+		             $terminfo->setaf($k++) } (split //, 'KRGYBMCW')),
+		# reset
+		#(map { $_ => $terminfo->op() } (split //, 'nN')),
+		(map { $_ => $terminfo->op() } (split //, 'n')),
+		(map { $_ => "\033[0m" } (split //, 'N')), # XXX quick and DIRTY
+		# flash/bright
+		F => $terminfo->blink(),
+		# reverse
+		8 => $terminfo->rev(),
+		# bold
+		(map { $_ => $terminfo->bold() } (split //, '9_')),
+		#      delete                other stuff
+		(map { $_ => '' } (split //, ':|>#[')),
+		#      escape
+		(map { $_ => $_ } (split //, '{}%')),
+	)
+}
+sub formats_to_ansi_basic {
+	my $o = shift;
+	$o =~ s/(%(.))/exists $ansi_table{$2} ? $ansi_table{$2} : $1/gex;
+	$o
+}
+
+sub lc1459 ($) { my $x = shift; $x =~ y/A-Z][\^/a-z}{|~/; $x }
+Irssi::settings_add_str(setc, 'banned_channels', '');
+Irssi::settings_add_bool(setc, 'banned_channels_on', 0);
+my %banned_channels = map { lc1459($_) => undef }
+split ' ', Irssi::settings_get_str('banned_channels');
+Irssi::settings_add_str(setc, 'fancy_abbrev', 'fancy');
+
+# }}}
+
+# {{{ main
+
+sub remake () {
+	#$callcount++;
+	#my $xx = $callcount; Irssi::print("starting remake [ $xx ]");
+	my ($hilight, $number, $display);
+	my $separator = '{sb_act_sep ' . Irssi::settings_get_str(set 'separator') .
+		'}';
+	my $custSort = Irssi::settings_get_str(set 'sort');
+	my $custSortDir = 1;
+	if ($custSort =~ /^[-!](.*)/) {
+		$custSortDir = -1;
+		$custSort = $1;
+	}
+
+	my @wins = 
+		sort {
+			(
+				( (int($a->{$custSort}) <=> int($b->{$custSort})) * $custSortDir )
+					||
+				($a->{'refnum'} <=> $b->{'refnum'})
+			)
+		} Irssi::windows;
+	my $block = Irssi::settings_get_int(set 'block');
+	my $columns = $currentColumns;
+	my $oldActString = $actString if $SCREEN_MODE;
+	$actString = $SCREEN_MODE ? ['   A W L'] : [];
+	my $line = $SCREEN_MODE ? 1 : 0;
+	my $width = $SCREEN_MODE
+			?
+		$screenWidth - abs($block)*$columns + 1
+			:
+		([Irssi::windows]->[0]{'width'} - sb_length('{sb x}'));
+	my $height = $screenHeight - abs(Irssi::settings_get_int(set
+			'height_adjust'));
+	my ($numPad, $keyPad) = (0, 0);
+	my %abbrevList;
+	if ($SCREEN_MODE or Irssi::settings_get_bool(set 'sbar_maxlength')
+			or ($block < 0)
+	) {
+		%abbrevList = ();
+		if (Irssi::settings_get_str('fancy_abbrev') !~ /^(no|off|head)/i) {
+			my @nameList = map { ref $_ ? $_->get_active_name : '' } @wins;
+			for (my $i = 0; $i < @nameList - 1; ++$i) {
+				my ($x, $y) = ($nameList[$i], $nameList[$i + 1]);
+				for ($x, $y) { s/^[+#!=]// }
+				my $res = Algorithm::LCSS::LCSS($x, $y);
+				if (defined $res) {
+					#Irssi::print("common pattern $x $y : $res");
+					#Irssi::print("found at $nameList[$i] ".index($nameList[$i],
+					#		$res));
+					$abbrevList{$nameList[$i]} = int (index($nameList[$i], $res) +
+						(length($res) / 2));
+					#Irssi::print("found at ".$nameList[$i+1]." ".index($nameList[$i+1],
+					#		$res));
+					$abbrevList{$nameList[$i+1]} = int (index($nameList[$i+1], $res) +
+						(length($res) / 2));
+				}
+			}
+		}
+		if ($SCREEN_MODE or ($block < 0)) {
+			$numPad = length((sort { length($b) <=> length($a) } keys %keymap)[0]);
+			$keyPad = length((sort { length($b) <=> length($a) } values %keymap)[0]);
+		}
+	}
+	if ($SCREEN_MODE) {
+		print STDERR $screenansi->dcs().
+		             $terminfo->civis().
+						 $terminfo->sc().
+						 $screenansi->st();
+		if (@$oldActString < 1) {
+			print STDERR $screenansi->dcs().
+							 $terminfo->cup(0, $width).
+			             $actString->[0].
+							 $terminfo->el().
+			             $screenansi->st();
+		}
+	}
+	foreach my $win (@wins) {
+		unless ($SCREEN_MODE) {
+			$actString->[$line] = '' unless defined $actString->[$line]
+					or Irssi::settings_get_bool(set 'all_disable');
+		}
+
+		# all stolen from chanact, what does this code do and why do we need it ?
+		!ref($win) && next;
+
+		my $name = $win->get_active_name;
+		$name = '*' if (Irssi::settings_get_bool('banned_channels_on') and exists
+			$banned_channels{lc1459($name)});
+		$name = $win->{'name'} if $name ne '*' and $win->{'name'} ne ''
+			and Irssi::settings_get_bool(set 'prefer_name');
+		my $active = $win->{'active'};
+		my $colour = $win->{'hilight_color'};
+		if (!defined $colour) { $colour = ''; }
+
+		if ($win->{'data_level'} < Irssi::settings_get_int(set 'hide_data')) {
+			next; } # for Geert
+		if    ($win->{'data_level'} == 0) { $hilight = '{sb_act_none '; }
+		elsif ($win->{'data_level'} == 1) { $hilight = '{sb_act_text '; }
+		elsif ($win->{'data_level'} == 2) { $hilight = '{sb_act_msg '; }
+		elsif ($colour             ne '') { $hilight = "{sb_act_hilight_color $colour "; }
+		elsif ($win->{'data_level'} == 3) { $hilight = '{sb_act_hilight '; }
+		else                              { $hilight = '{sb_act_special '; }
+
+		$number = $win->{'refnum'};
+		my @display = ('display_nokey');
+		if (defined $keymap{$number} and $keymap{$number} ne '') {
+			unshift @display, map { (my $cpy = $_) =~ s/_no/_/; $cpy } @display;
+		}
+		if (Irssi::active_win->{'refnum'} == $number) {
+			unshift @display, map { my $cpy = $_; $cpy .= '_active'; $cpy } @display;
+		}
+		#Irssi::print("win $number [@display]: " . join '.', split //, join '<<', map {
+			#		Irssi::settings_get_str(set $_) } @display);
+		$display = (grep { $_ }
+			map { Irssi::settings_get_str(set $_) }
+			@display)[0];
+			#Irssi::print("win $number : " . join '.', split //, $display);
+
+		if ($SCREEN_MODE or Irssi::settings_get_bool(set 'sbar_maxlength')
+				or ($block < 0)
+		) {
+			my $baseLength = sb_length(ir_escape(ir_ve(ir_parse_special_protected(sb_ctfe(
+				'{sb_background}' . expand($display,
+				C => ir_fe('x'),
+				N => $number . (' 'x($numPad - length($number))),
+				Q => ir_fe((' 'x($keyPad - length($keymap{$number}))) . $keymap{$number}),
+				H => $hilight,
+				S => '}{sb_background}'
+			), 1), $win)))) - 1;
+			my $diff = abs($block) - (length($name) + $baseLength);
+			if ($diff < 0) { # too long
+				if (abs($diff) >= length($name)) { $name = '' } # forget it
+				elsif (abs($diff) + 1 >= length($name)) { $name = substr($name,
+						0, 1); }
+				else {
+					my $middle = exists $abbrevList{$name} ?
+					(($abbrevList{$name} + (2*(length($name) / 2)))/3) :
+						((Irssi::settings_get_str('fancy_abbrev') =~ /^head/i) ?
+								length($name) :
+						(length($name) / 2));
+					my $cut = int($middle - (abs($diff) / 2) + .55); 
+					$cut = 1 if $cut < 1;
+					$cut = length($name) - abs($diff) - 1 if $cut > (length($name) -
+						abs($diff) - 1);
+					$name = substr($name, 0, $cut) . '~' . substr($name, $cut +
+						abs($diff) + 1);
+				}
+			}
+			elsif ($SCREEN_MODE or ($block < 0)) {
+				$name .= (' ' x $diff);
+			}
+		}
+
+		my $add = ir_ve(ir_parse_special_protected(sb_ctfe('{sb_background}' . expand($display,
+			C => ir_fe($name),
+			N => $number . (' 'x($numPad - length($number))),
+			Q => ir_fe((' 'x($keyPad - length($keymap{$number}))) . $keymap{$number}),
+			H => $hilight,
+			S => '}{sb_background}'
+		), 1), $win));
+		if ($SCREEN_MODE) {
+			$actString->[$line] = $add;
+			if ((!defined $oldActString->[$line]
+					or $oldActString->[$line] ne $actString->[$line])
+					and
+				$line <= ($columns * $height)
+			) {
+				print STDERR $screenansi->dcs().
+								 $terminfo->cup(($line-1) % $height+1, $width + (
+									 abs($block) * int(($line-1) / $height))).
+				formats_to_ansi_basic(sb_expand(ir_escape($actString->[$line]))).
+								#$terminfo->el().
+								 $screenansi->st();
+			}
+			$line++;
+		}
+		else {
+			#$temp =~ s/\{\S+?(?:\s(.*?))?\}/$1/g;
+			#$temp =~ s/\\\\\\\\/\\/g; # XXX I'm actually guessing here, someone point me
+			#                          # XXX to docs please
+			$actString->[$line] = '' unless defined $actString->[$line];
+
+			# XXX how can I check whether the content still fits in the bar? this would
+			# XXX allow awlstatus to reside on a statusbar together with other items...
+			if (sb_length(ir_escape($actString->[$line] . $add)) >= $width) {
+				# XXX doesn't correctly handle utf-8 multibyte ... help !!?
+				$actString->[$line] .= ' ' x ($width - sb_length(ir_escape(
+					$actString->[$line])));
+				$line++;
+			}
+			$actString->[$line] .= $add . $separator;
+			# XXX if I use these prints, output layout gets screwed up... why ?
+			#Irssi::print("line $line: ".$actString->[$line]);
+			#Irssi::print("temp $line: ".$temp);
+		}
+	}
+
+	if ($SCREEN_MODE) {
+		while ($line <= ($columns * $height)) {
+			print STDERR $screenansi->dcs().
+							 $terminfo->cup(($line-1) % $height+1, $width + (
+								 abs($block) * int(($line-1) / $height))).
+							 $terminfo->el().
+							 $screenansi->st();
+			$line++;
+		}
+		print STDERR $screenansi->dcs().
+						 $terminfo->rc().
+		             $terminfo->cnorm().
+						 $screenansi->st();
+	}
+	else {
+		# XXX the Irssi::print statements lead to the MOST WEIRD results
+		# e.g.: the loop gets executed TWICE for p > 0 ?!?
+		for (my $p = 0; $p < @$actString; $p++) { # wrap each line in {sb }, escape it
+			my $x = $actString->[$p];              # properly, etc.
+			$x =~ s/\Q$separator\E([ ]*)$/$1/;
+			#Irssi::print("[$p]".'current:'.join'.',split//,sb_strip(ir_escape($x,0)));
+			#Irssi::print("assumed length before:".sb_length(ir_escape($x,0)));
+			$x = "{sb $x}";
+			#Irssi::print("[$p]".'new:'.join'.',split//,sb_expand(ir_escape($x,0)));
+			#Irssi::print("[$p]".'new:'.join'.',split//,ir_escape($x,0));
+			#Irssi::print("assumed length after:".sb_length(ir_escape($x,0)));
+			$x = ir_escape($x);
+			#Irssi::print("[$p]".'REALnew:'.join'.',split//,sb_strip($x));
+			$actString->[$p] = $x;
+			# XXX any Irssi::print debug statement leads to SEGFAULT (sometimes) - why ?
+		}
+	}
+	#Irssi::print("remake [ $xx ] finished");
+}
+
+sub awlHasChanged () {
+	$globTime = undef;
+	my $temp = ($SCREEN_MODE ?
+		"\\\n" . Irssi::settings_get_int(set 'block').
+		Irssi::settings_get_int(set 'height_adjust')
+		: "!\n" . Irssi::settings_get_str(set 'placement').
+		Irssi::settings_get_int(set 'position')).
+		Irssi::settings_get_str(set 'automode');
+	if ($temp ne $resetNeeded) { wlreset(); return; }
+	#Irssi::print("awl has changed, calls to remake so far: $callcount");
+	$needRemake = 1;
+
+	#remake();
+	if (
+		($SCREEN_MODE and !$DISABLE_SCREEN_TEMP)
+			or
+		($needRemake and Irssi::settings_get_bool(set 'all_disable'))
+			or
+		(!Irssi::settings_get_bool(set 'all_disable') and $currentLines < 1)
+	) {
+		$needRemake = undef;
+		remake();
+	}
+
+	unless ($SCREEN_MODE) {
+		# XXX Irssi crashes if I try to do this without timer, why ? What's the minimum
+		# XXX delay I need to use in the timer ?
+		Irssi::timeout_add_once(100, 'syncLines', undef);
+
+		for (keys %statusbars) {
+			Irssi::statusbar_items_redraw(set$_);
+		}
+	}
+	else {
+		Irssi::timeout_add_once(100, 'syncColumns', undef);
+	}
+}
+
+sub eventChanged () { # Implement a change queue/blocker -.-)
+	if (defined $globTime) {
+		Irssi::timeout_remove($globTime);
+	} # delay the update further
+	$globTime = Irssi::timeout_add_once(GLOB_QUEUE_TIMER, 'awlHasChanged', undef);
+}
+
+# }}}
+
+
+# {{{ screen mode
+
+sub screenFullRedraw {
+	my ($window) = @_;
+	if (!ref $window or $window->{'refnum'} == Irssi::active_win->{'refnum'}) {
+		$actString = [];
+		eventChanged();
+	}
+}
+
+sub screenSize { # from nicklist.pl
+	$screenResizing = 1;
+	# fit screen
+	system 'screen -x '.$ENV{'STY'}.' -X fit';
+	# get size
+	my ($row, $col) = split ' ', `stty size`;
+	# set screen width
+	$screenWidth = $col-1;
+	$screenHeight = $row-1;
+	
+	# on some recent systems, "screen -X fit; screen -X width -w 50" doesn't work, needs a sleep in between the 2 commands
+	# so we wait a second before setting the width
+	Irssi::timeout_add_once(100, sub {
+		my ($new_irssi_width) = @_;
+		$new_irssi_width -= abs(Irssi::settings_get_int(set
+				'block'))*$currentColumns - 1;
+		system 'screen -x '.$ENV{'STY'}.' -X width -w ' . $new_irssi_width;
+		# and then we wait another second for the resizing, and then redraw.
+		Irssi::timeout_add_once(10,sub {$screenResizing = 0; screenFullRedraw()}, []);
+	}, $screenWidth);
+}
+
+sub screenOff {
+	my ($unloadMode) = @_;
+	Irssi::signal_remove('gui print text finished' => 'screenFullRedraw');
+	Irssi::signal_remove('gui page scrolled' => 'screenFullRedraw');
+	Irssi::signal_remove('window changed' => 'screenFullRedraw');
+	Irssi::signal_remove('window changed automatic' => 'screenFullRedraw');
+	if ($unloadMode) {
+		Irssi::signal_remove('terminal resized' => 'resizeTerm');
+	}
+	system 'screen -x '.$ENV{'STY'}.' -X fit';
+}
+
+sub syncColumns {
+	return if (@$actString == 0);
+	my $temp = $currentColumns;
+	#Irssi::print("current columns $temp");
+	my $height = $screenHeight - abs(Irssi::settings_get_int(set
+			'height_adjust'));
+	$currentColumns = int(($#$actString-1) / $height) + 1;
+	#Irssi::print("objects in actstring:".scalar(@$actString).", screen height:".
+	#	$height);
+	my $currMaxColumns = Irssi::settings_get_int(set 'columns');
+	if ($currMaxColumns > 0 and $currentColumns > $currMaxColumns) {
+		$currentColumns = $currMaxColumns;
+	}
+	elsif ($currMaxColumns < 0) {
+		$currentColumns = abs($currMaxColumns);
+	}
+	return if ($temp == $currentColumns);
+	screenSize();
+}
+
+#$needRemake = 1;
+sub resizeTerm () {
+	if ($SCREEN_MODE and !$screenResizing) {
+		$screenResizing = 1;
+		Irssi::timeout_add_once(10, 'screenSize', undef);
+	}
+	Irssi::timeout_add_once(100, 'eventChanged', undef);
+}
+
+# }}}
+
+
+# {{{ settings add