settings

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit e40170a62e1c5259f460397cfa5b66b1de9fc24b
parent ac40f686fa60f9e7ef9e59da48613b2c77139b3e
Author: Paul Longtine <paullongtine@gmail.com>
Date:   Wed Aug  6 12:04:52 2014

Added irssi stuff

Diffstat:
 irssi/asdf.theme                        | 307 +++++++++++++++++++++++++++++++++-
 irssi/config                            | 269 +++++++++++++++++++++++++++++-
 irssi/config.autosave                   | 269 +++++++++++++++++++++++++++++-
 irssi/scripts/autorun/hilightwin.pl     |   1 +-
 irssi/scripts/autorun/notify.pl         |   1 +-
 irssi/scripts/autorun/xchatnickcolor.pl |   1 +-
 irssi/scripts/hilightwin.pl             |  57 ++++++-
 irssi/scripts/nickcolor.pl              | 156 +++++++++++++++++-
 irssi/scripts/notify.pl                 |  90 ++++++++++-
 irssi/scripts/xchatnickcolor.pl         | 160 +++++++++++++++++-
 10 files changed, 1311 insertions(+), 0 deletions(-)

diff --git a/irssi/asdf.theme b/irssi/asdf.theme @@ -0,0 +1,307 @@ +# +# +# Beastie's irssi theme. +# +# Thanks to crshd. +# +# +# Visit irc.unixhub.net #unixhub :) +# + + + +# 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 = { "[]" = "%g$*%n"; }; + +abstracts = { + + ############# generic ############################### + + #indent_default = " + "; + indent_default = ""; + + # text to insert at the beginning of each non-message line + # line_start = "%g//%n "; + line_start = ""; + + # timestamp styling, nothing by default + #timestamp = "%K$0-%n"; + 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 = "%b$*%n"; + + # nick is printed + #nick = "%_$*%_"; + nick = ""; + + # nick host is printed + nickhost = "%g$*"; + + # server name is printed + server = "%_$*%_"; + + # some kind of comment is printed + comment = "%n(%b\"$*\"%n);"; + + # 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 = "%g$*%N"; + chanhost_hilight = "{nickhost $*}"; + + # nick/host is printed (parts, quits, etc.) + channick = "$*"; + chanhost = "{nickhost $*}"; + + # highlighted channel name is printed + channelhilight = "%g$*%n"; + + # ban/ban exception/invite list mask is printed + ban = "$*"; + + ########### messages ################################# + + # the basic styling of how to print message, $0 = nick mode, $1 = nick + # msgnick = "$1-$0%K·%N %|"; + #msgnick = "%K$0%N $1 %K│ %|%N"; + # msgnick = "%K$0%N $1 %K· %|%N"; + msgnick = "%K%N $1 %K│ %N"; + + # $0 = nick mode, $1 = nick + ownmsgnick = "{msgnick $0 $1}"; + ownnick = "%Y$*%n"; + + # public message in channel, $0 = nick mode, $1 = nick + pubmsgnick = "{msgnick $0 $1}"; + pubnick = "%N$*%n"; + + # public highlighted message in channel + pubmsghinick = "{msgnick $0 $1}%r"; + menick = "%R$*%n"; + + # channel name is printed with message + msgchannel = "%K:%m$*%n"; + + # private message, $0 = nick, $1 = host + privmsg = "$0=%b\"$1-\"%n "; + + # private message from you, $0 = "msg", $1 = target nick + ownprivmsg = "$0=%b\"$1-\"%n "; + + # private message in query + # privmsgnick = "{msgnick $*}"; + privmsgnick = " %g<%N "; + + # own private message in query + #ownprivmsgnick = "{privmsgnick $*}"; + ownprivmsgnick = " %r>%N "; + #ownprivnick = "$*"; + + + ########## 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 %p$*}"; + + # own action with target, both private/public + ownaction_target = "{action_core $0}%Y:%c$1%n "; + + # private action sent by others + pvtaction = "%y (*) $*%n "; + pvtaction_query = "{action $* }"; + + # public action sent by others + pubaction = "{action $*}"; + + # generic one that's used by most actions + # action = " %m$* │ %N%m"; + + # own action, both private/public + # ownaction = "{action $*}"; + # ownaction = " %m$* │ %N%m"; + + # own action with target, both private/public + # ownaction_target = " {action $*}"; + + # private action sent by others + # pvtaction = "{ $*}"; + # pvtaction_query = "{ $*}"; + + # public action sent by others + # pubaction = " {action}"; + + + ########## other IRC events ############################# + + # whois + whois = "%# $[8]0 = $1-;"; + + # notices + ownnotice = "%NNote n = %Mnew%n $0 ($1-) "; + notice = "%M$*%n "; + pubnotice_channel = " %N($*)"; + pvtnotice_host = " %N($*)"; + servernotice = " %N($*)"; + + # CTCPs + ownctcp = "%NCTCP c = %Mnew%n $0 ($1-) "; + ctcp = "%N$*%n"; + + # wallops + wallop = "%K$*%n: "; + wallop_nick = "%n$*"; + wallop_action = "%K * $*%n "; + + # netsplits + netsplit = " %Knsplit %R│ %b\"$*\"%n"; + netjoin = " %Knjoin %G│ %b\"$*\"%n"; + + # /names list + names_prefix = " %Y│%n "; + names_nick = "%_$2$0%_%n$1- "; + names_nick_op = "{names_nick $* %R}"; + names_nick_halfop = "{names_nick $* %C}"; + names_nick_voice = "{names_nick $* %K}"; + names_users = " %Y│%n $1"; + names_channel = "\"%b$*\"%n"; + + # DCC + dcc = "%g$*%n"; + dccfile = "%_$*%_"; + + # DCC chat, own msg/action + dccownmsg = "%g /* $0 ($1-) */"; + dccownnick = "$*%n"; + dccownquerynick = "$*%n"; + dccownaction = "{action $*}"; + dccownaction_target = "{action $*}"; + + # DCC chat, others + dccmsg = "%g/* $1- ($0) */"; + dccquerynick = "%g$*%n"; + dccaction = "{action $*}"; + + ######## statusbar/topicbar ############################ + + # default background for all statusbars. You can also give + # the default foreground color for statusbar items. + sb_background = "%9"; + + # 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 = "%1"; + # 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 = "%K╒┅┅━━━━━━━━━━━┙"; + # text at the end of statusbars. Use space so that it's never + # used for anything. + sbend = ""; + + topicsbstart = "%K╘┅┅━━━━━━━━━━━┑ %K$N on $C: $S%N$*"; + topicsbend = "$*"; + + prompt = "%K└──╼ %n"; + + sb = "%K$*%N "; + sbmode = " %K[%g+%n$*%K]"; + sbaway = " %g/* zZzZ */"; + sbservertag = ":%g$0"; + sbnickmode = "$0"; + + # Usercount + sb_usercount = "{sb %_$0%_ nicks ($1-)}"; + sb_uc_ircops = "%_*%_$*"; + sb_uc_ops = "%_@%r$*%n"; + sb_uc_halfops = "%_%%%g$*%n"; + sb_uc_voices = "%_+%y$*%n"; + sb_uc_normal = "%w$*%n"; + sb_uc_space = " "; + # activity in statusbar + + # ',' separator + sb_act_sep = " "; + # normal text + sb_act_text = "%g%9$*%n"; + # public message + sb_act_msg = "%Y%9$*%n"; + # hilight + sb_act_hilight = "%R%9$*%n"; + # hilight with specified color, $0 = color, $1 = text + sb_act_hilight_color = "%R%9$1-%n"; +}; + +######################################################## + +formats = { + "fe-common/core" = { + line_start = "{line_start}"; + line_start_irssi = "{line_start}"; + + join = " join %g│ %n {channick $0}"; + part = " part %r│ %n {channick $0}"; + kick = " kicked %r│ %n {channick $0}"; + quit = " quit %r│ %n {channick $0}"; + quit_once = "{channel $3} {channick $0} {chanhost $1} %kquit {reason %C$2}"; + + nick_changed = "%K{channick $[-13]0}%G│ %n {channick $1}"; + your_nick_changed = "%K you %G│ %n {channick $1}"; + + pubmsg = "{pubmsgnick $2 {pubnick \00304$[-11]0}}$1"; + + own_msg = "{ownmsgnick $2 {ownnick $[-11]0}}$1"; + own_msg_channel = "{ownmsgnick $3 {ownnick $[-11]0}{msgchannel $1}}$2"; + own_msg_private_query = "{ownprivmsgnick {ownprivnick $[-11]2}}$1"; + + pubmsg_me = "{pubmsghinick $2 {menick $[-11]0}}$1"; + pubmsg_me_channel = "{pubmsghinick $3 {menick $[-11]0}{msgchannel $1}}$2"; + + pubmsg_hilight = "{pubmsghinick $3 {menick $[-11]1}}$2"; + pubmsg_hilight_channel = "{pubmsghinick $0 $[-11]1$4{msgchannel $2}}$3"; + + pubmsg_channel = "{pubmsgnick {pubnick %G$[-11]0}$2}$1"; + msg_private_query = "{privmsgnick $[-11]0}$2"; + new_topic = " %ctopic %K│ %B'$2' %non %b$1%n%K[set by {nick %y$0}]"; + + endofnames = " names %Y│%m Total: {hilight $2} ops, {hilight $3} halfops, {hilight $4} voices, {hilight $5} normal%n"; + }; + "fe-common/irc" = { + chanmode_change = " mode %y│ %n {channick $1}"; + server_chanmode_change = "% mode %y│ %n {channick $1}"; + + own_action = "{ownaction $[-11]0} $1"; + action_private = "{pvtaction $[-11]0}$1"; + action_private_query = "{pvtaction_query $[-11]0} $2"; + action_public = "{pubaction $[-11]0}$1"; + }; +}; diff --git a/irssi/config b/irssi/config @@ -0,0 +1,269 @@ +servers = ( + { address = "irc.ubuntu.com"; chatnet = "Ubuntu"; port = "8001"; }, + { address = "eu.irc6.net"; chatnet = "IRCnet"; port = "6667"; }, + { address = "open.ircnet.net"; chatnet = "IRCnet"; port = "6667"; }, + { address = "irc.efnet.org"; chatnet = "EFNet"; port = "6667"; }, + { + address = "irc.undernet.org"; + chatnet = "Undernet"; + port = "6667"; + }, + { address = "irc.dal.net"; chatnet = "DALnet"; port = "6667"; }, + { + address = "irc.quakenet.org"; + chatnet = "QuakeNet"; + port = "6667"; + }, + { address = "irc.oftc.net"; chatnet = "OFTC"; port = "6667"; }, + { + address = "irc.gamesurge.net"; + chatnet = "GameSurge"; + port = "6667"; + }, + { address = "irc.webchat.org"; chatnet = "WebChat"; port = "6667"; }, + { address = "irc.rizon.net"; chatnet = "Rizon"; port = "6667"; }, + { address = "irc.link-net.org"; chatnet = "LinkNet"; port = "6667"; }, + { address = "silc.silcnet.org"; chatnet = "SILC"; port = "706"; } +); + +chatnets = { + IRCnet = { + type = "IRC"; + max_kicks = "4"; + max_msgs = "5"; + max_whois = "4"; + max_query_chans = "5"; + }; + EFNet = { + type = "IRC"; + max_kicks = "4"; + max_msgs = "3"; + max_whois = "1"; + }; + Undernet = { + type = "IRC"; + max_kicks = "1"; + max_msgs = "3"; + max_whois = "30"; + }; + DALnet = { + type = "IRC"; + max_kicks = "4"; + max_msgs = "3"; + max_whois = "30"; + }; + QuakeNet = { + type = "IRC"; + max_kicks = "1"; + max_msgs = "3"; + max_whois = "30"; + }; + OFTC = { + type = "IRC"; + max_kicks = "1"; + max_msgs = "3"; + max_whois = "30"; + }; + GameSurge = { + type = "IRC"; + max_kicks = "1"; + max_msgs = "3"; + max_whois = "30"; + }; + WebChat = { + type = "IRC"; + max_kicks = "1"; + max_msgs = "3"; + max_whois = "30"; + }; + Rizon = { + type = "IRC"; + max_kicks = "1"; + max_msgs = "3"; + max_whois = "30"; + }; + LinkNet = { + type = "IRC"; + max_kicks = "1"; + max_msgs = "3"; + max_whois = "30"; + }; + SILC = { type = "SILC"; }; + Ubuntu = { type = "IRC"; }; +}; + +channels = ( + { name = "#irssi"; chatnet = "ircnet"; 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"; + CALC = "exec - if command -v bc >/dev/null 2>&1\\; then printf '%s=' '$*'\\; echo '$*' | bc -l\\; else echo bc was not found\\; fi"; + SBAR = "STATUSBAR"; + INVITELIST = "mode $C +I"; + Q = "QUERY"; + "MANUAL-WINDOWS" = "set use_status_window off;set autocreate_windows off;set autocreate_query_level none;set autoclose_windows off;set reuse_unused_windows on;save"; + EXEMPTLIST = "mode $C +e"; + ATAG = "WINDOW SERVER"; + UNSET = "set -clear"; + RESET = "set -default"; +}; + +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:$tag/$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://www.irssi.org"; + + # 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 = "active"; + + # list of items in statusbar in the display order + items = { + barstart = { priority = "100"; }; + time = { }; + user = { }; + window = { }; + window_empty = { }; + lag = { priority = "-1"; }; + act = { priority = "10"; }; + 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"; }; + }; + }; + }; +}; +settings = { + core = { + real_name = "Paul Longtine"; + user_name = "paul"; + nick = "lalala"; + }; + "fe-text" = { actlist_sort = "refnum"; }; + "fe-common/core" = { theme = "asdf"; }; +}; diff --git a/irssi/config.autosave b/irssi/config.autosave @@ -0,0 +1,269 @@ +servers = ( + { address = "irc.ubuntu.com"; chatnet = "Ubuntu"; port = "8001"; }, + { address = "eu.irc6.net"; chatnet = "IRCnet"; port = "6667"; }, + { address = "open.ircnet.net"; chatnet = "IRCnet"; port = "6667"; }, + { address = "irc.efnet.org"; chatnet = "EFNet"; port = "6667"; }, + { + address = "irc.undernet.org"; + chatnet = "Undernet"; + port = "6667"; + }, + { address = "irc.dal.net"; chatnet = "DALnet"; port = "6667"; }, + { + address = "irc.quakenet.org"; + chatnet = "QuakeNet"; + port = "6667"; + }, + { address = "irc.oftc.net"; chatnet = "OFTC"; port = "6667"; }, + { + address = "irc.gamesurge.net"; + chatnet = "GameSurge"; + port = "6667"; + }, + { address = "irc.webchat.org"; chatnet = "WebChat"; port = "6667"; }, + { address = "irc.rizon.net"; chatnet = "Rizon"; port = "6667"; }, + { address = "irc.link-net.org"; chatnet = "LinkNet"; port = "6667"; }, + { address = "silc.silcnet.org"; chatnet = "SILC"; port = "706"; } +); + +chatnets = { + IRCnet = { + type = "IRC"; + max_kicks = "4"; + max_msgs = "5"; + max_whois = "4"; + max_query_chans = "5"; + }; + EFNet = { + type = "IRC"; + max_kicks = "4"; + max_msgs = "3"; + max_whois = "1"; + }; + Undernet = { + type = "IRC"; + max_kicks = "1"; + max_msgs = "3"; + max_whois = "30"; + }; + DALnet = { + type = "IRC"; + max_kicks = "4"; + max_msgs = "3"; + max_whois = "30"; + }; + QuakeNet = { + type = "IRC"; + max_kicks = "1"; + max_msgs = "3"; + max_whois = "30"; + }; + OFTC = { + type = "IRC"; + max_kicks = "1"; + max_msgs = "3"; + max_whois = "30"; + }; + GameSurge = { + type = "IRC"; + max_kicks = "1"; + max_msgs = "3"; + max_whois = "30"; + }; + WebChat = { + type = "IRC"; + max_kicks = "1"; + max_msgs = "3"; + max_whois = "30"; + }; + Rizon = { + type = "IRC"; + max_kicks = "1"; + max_msgs = "3"; + max_whois = "30"; + }; + LinkNet = { + type = "IRC"; + max_kicks = "1"; + max_msgs = "3"; + max_whois = "30"; + }; + SILC = { type = "SILC"; }; + Ubuntu = { type = "IRC"; }; +}; + +channels = ( + { name = "#irssi"; chatnet = "ircnet"; 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"; + CALC = "exec - if command -v bc >/dev/null 2>&1\\; then printf '%s=' '$*'\\; echo '$*' | bc -l\\; else echo bc was not found\\; fi"; + SBAR = "STATUSBAR"; + INVITELIST = "mode $C +I"; + Q = "QUERY"; + "MANUAL-WINDOWS" = "set use_status_window off;set autocreate_windows off;set autocreate_query_level none;set autoclose_windows off;set reuse_unused_windows on;save"; + EXEMPTLIST = "mode $C +e"; + ATAG = "WINDOW SERVER"; + UNSET = "set -clear"; + RESET = "set -default"; +}; + +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:$tag/$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://www.irssi.org"; + + # 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 = "active"; + + # list of items in statusbar in the display order + items = { + barstart = { priority = "100"; }; + time = { }; + user = { }; + window = { }; + window_empty = { }; + lag = { priority = "-1"; }; + act = { priority = "10"; }; + 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"; }; + }; + }; + }; +}; +settings = { + core = { + real_name = "Paul Longtine"; + user_name = "paul"; + nick = "paull"; + }; + "fe-text" = { actlist_sort = "refnum"; }; + "fe-common/core" = { theme = "asdf"; }; +}; diff --git a/irssi/scripts/autorun/hilightwin.pl b/irssi/scripts/autorun/hilightwin.pl @@ -0,0 +1 @@ +../hilightwin.pl+ \ No newline at end of file diff --git a/irssi/scripts/autorun/notify.pl b/irssi/scripts/autorun/notify.pl @@ -0,0 +1 @@ +../notify.pl+ \ No newline at end of file diff --git a/irssi/scripts/autorun/xchatnickcolor.pl b/irssi/scripts/autorun/xchatnickcolor.pl @@ -0,0 +1 @@ +../xchatnickcolor.pl+ \ No newline at end of file diff --git a/irssi/scripts/hilightwin.pl b/irssi/scripts/hilightwin.pl @@ -0,0 +1,57 @@ +# +# Print hilighted messages & private messages to window named "hilight" for +# irssi 0.7.99 by Timo Sirainen +# +# Modded a tiny bit by znx to stop private messages entering the hilighted +# window (can be toggled) and to put up a timestamp. +# + +use Irssi; +use POSIX; +use vars qw($VERSION %IRSSI); + +$VERSION = "0.02"; +%IRSSI = ( + authors => "Timo \'cras\' Sirainen, Mark \'znx\' Sangster", + contact => "tss\@iki.fi, znxster\@gmail.com", + name => "hilightwin", + description => "Print hilighted messages to window named \"hilight\"", + license => "Public Domain", + url => "http://irssi.org/", + changed => "Sun May 25 18:59:57 BST 2008" +); + +sub sig_printtext { + my ($dest, $text, $stripped) = @_; + + my $opt = MSGLEVEL_HILIGHT; + + if(Irssi::settings_get_bool('hilightwin_showprivmsg')) { + $opt = MSGLEVEL_HILIGHT|MSGLEVEL_MSGS; + } + + if( + ($dest->{level} & ($opt)) && + ($dest->{level} & MSGLEVEL_NOHILIGHT) == 0 + ) { + $window = Irssi::window_find_name('hilight'); + + if ($dest->{level} & MSGLEVEL_PUBLIC) { + $text = $dest->{target}.": ".$text; + } + $text = strftime( + Irssi::settings_get_str('timestamp_format')." ", + localtime + ).$text; + $window->print($text, MSGLEVEL_NEVER) if ($window); + } +} + +$window = Irssi::window_find_name('hilight'); +Irssi::print("Create a window named 'hilight'") if (!$window); + +Irssi::settings_add_bool('hilightwin','hilightwin_showprivmsg',1); + +Irssi::signal_add('print text', 'sig_printtext'); + +# vim:set ts=4 sw=4 et: diff --git a/irssi/scripts/nickcolor.pl b/irssi/scripts/nickcolor.pl @@ -0,0 +1,156 @@ +use strict; +use Irssi 20020101.0250 (); +use vars qw($VERSION %IRSSI); +$VERSION = "1"; +%IRSSI = ( + authors => "Timo Sirainen, Ian Peters", + contact => "tss\@iki.fi", + name => "Nick Color", + description => "assign a different color for each nick", + license => "Public Domain", + url => "http://irssi.org/", + changed => "2002-03-04T22:47+0100" +); + +# hm.. i should make it possible to use the existing one.. +Irssi::theme_register([ + 'pubmsg_hilight', '{pubmsghinick $0 $3 $1}$2' +]); + +my %saved_colors; +my %session_colors = {}; +my @colors = qw/2 3 4 5 6 7 9 10 11 12 13/; + +sub load_colors { + open COLORS, "$ENV{HOME}/.irssi/saved_colors"; + + while (<COLORS>) { + # I don't know why this is necessary only inside of irssi + my @lines = split "\n"; + foreach my $line (@lines) { + my($nick, $color) = split ":", $line; + $saved_colors{$nick} = $color; + } + } + + close COLORS; +} + +sub save_colors { + open COLORS, ">$ENV{HOME}/.irssi/saved_colors"; + + foreach my $nick (keys %saved_colors) { + print COLORS "$nick:$saved_colors{$nick}\n"; + } + + close COLORS; +} + +# If someone we've colored (either through the saved colors, or the hash +# function) changes their nick, we'd like to keep the same color associated +# with them (but only in the session_colors, ie a temporary mapping). + +sub sig_nick { + my ($server, $newnick, $nick, $address) = @_; + my $color; + + $newnick = substr ($newnick, 1) if ($newnick =~ /^:/); + + if ($color = $saved_colors{$nick}) { + $session_colors{$newnick} = $color; + } elsif ($color = $session_colors{$nick}) { + $session_colors{$newnick} = $color; + } +} + +# This gave reasonable distribution values when run across +# /usr/share/dict/words + +sub simple_hash { + my ($string) = @_; + chomp $string; + my @chars = split //, $string; + my $counter; + + foreach my $char (@chars) { + $counter += ord $char; + } + + $counter = $colors[$counter % 11]; + + return $counter; +} + +# FIXME: breaks /HILIGHT etc. +sub sig_public { + my ($server, $msg, $nick, $address, $target) = @_; + my $chanrec = $server->channel_find($target); + return if not $chanrec; + my $nickrec = $chanrec->nick_find($nick); + return if not $nickrec; + my $nickmode = $nickrec->{op} ? "@" : $nickrec->{voice} ? "+" : ""; + + # Has the user assigned this nick a color? + my $color = $saved_colors{$nick}; + + # Have -we- already assigned this nick a color? + if (!$color) { + $color = $session_colors{$nick}; + } + + # Let's assign this nick a color + if (!$color) { + $color = simple_hash $nick; + $session_colors{$nick} = $color; + } + + $color = "0".$color if ($color < 10); + $server->command('/^format pubmsg {pubmsgnick $2 {pubnick '.chr(3).$color.'$0}}$1'); +} + +sub cmd_color { + my ($data, $server, $witem) = @_; + my ($op, $nick, $color) = split " ", $data; + + $op = lc $op; + + if (!$op) { + Irssi::print ("No operation given"); + } elsif ($op eq "save") { + save_colors; + } elsif ($op eq "set") { + if (!$nick) { + Irssi::print ("Nick not given"); + } elsif (!$color) { + Irssi::print ("Color not given"); + } elsif ($color < 2 || $color > 14) { + Irssi::print ("Color must be between 2 and 14 inclusive"); + } else { + $saved_colors{$nick} = $color; + } + } elsif ($op eq "clear") { + if (!$nick) { + Irssi::print ("Nick not given"); + } else { + delete ($saved_colors{$nick}); + } + } elsif ($op eq "list") { + Irssi::print ("\nSaved Colors:"); + foreach my $nick (keys %saved_colors) { + Irssi::print (chr (3) . "$saved_colors{$nick}$nick" . + chr (3) . "1 ($saved_colors{$nick})"); + } + } elsif ($op eq "preview") { + Irssi::print ("\nAvailable colors:"); + foreach my $i (2..14) { + Irssi::print (chr (3) . "$i" . "Color #$i"); + } + } +} + +load_colors; + +Irssi::command_bind('color', 'cmd_color'); + +Irssi::signal_add('message public', 'sig_public'); +Irssi::signal_add('event nick', 'sig_nick'); diff --git a/irssi/scripts/notify.pl b/irssi/scripts/notify.pl @@ -0,0 +1,90 @@ +## +## Put me in ~/.irssi/scripts, and then execute the following in irssi: +## +## /load perl +## /script load notify +## + +use strict; +use Irssi; +use vars qw($VERSION %IRSSI); +use HTML::Entities; + +$VERSION = "0.5"; +%IRSSI = ( + authors => 'Luke Macken, Paul W. Frields', + contact => 'lewk@csh.rit.edu, stickster@gmail.com', + name => 'notify.pl', +# description => 'Use D-Bus to alert user to hilighted messages', + description => 'Use notify-send to alert user to hilighted messages', + license => 'GNU General Public License', + url => 'http://code.google.com/p/irssi-libnotify', +); + +Irssi::settings_add_str('notify', 'notify_remote', ''); + +sub sanitize { + my ($text) = @_; + encode_entities($text,'\'<>&'); + my $apos = "&#39;"; + my $aposenc = "\&apos;"; + $text =~ s/$apos/$aposenc/g; + $text =~ s/"/\\"/g; + return $text; +} + +sub notify { + my ($server, $summary, $message) = @_; + + # Make the message entity-safe + $summary = sanitize($summary); + $message = sanitize($message); + + # my $cmd = "EXEC - " . + # "dbus-send --session /org/irssi/Irssi org.irssi.Irssi.IrssiNotify" . + # " string:'" . $summary . "'" . + # " string:'" . $message . "'"; + my $cmd = "EXEC - " . "notify-send '" . $summary . "' '" . $message . "'"; + $server->command($cmd); + + my $remote = Irssi::settings_get_str('notify_remote'); + if ($remote ne '') { + my $cmd = "EXEC - ssh -q " . $remote . + " \"dbus-send --session /org/irssi/Irssi org.irssi.Irssi.IrssiNotify" . + " string:'" . $summary . "'" . + " string:'" . $message . "'\""; + $server->command($cmd); + } + +} + +sub print_text_notify { + my ($dest, $text, $stripped) = @_; + my $server = $dest->{server}; + + return if (!$server || !($dest->{level} & MSGLEVEL_HILIGHT)); + my $sender = $stripped; + $sender =~ s/^\<.([^\>]+)\>.+/\1/ ; + $stripped =~ s/^\<.[^\>]+\>.// ; + my $summary = $dest->{target} . ": " . $sender; + notify($server, $summary, $stripped); +} + +sub message_private_notify { + my ($server, $msg, $nick, $address) = @_; + + return if (!$server); + notify($server, "PM from ".$nick, $msg); +} + +sub dcc_request_notify { + my ($dcc, $sendaddr) = @_; + my $server = $dcc->{server}; + + return if (!$dcc); + notify($server, "DCC ".$dcc->{type}." request", $dcc->{nick}); +} + +Irssi::signal_add('print text', 'print_text_notify'); +Irssi::signal_add('message private', 'message_private_notify'); +Irssi::signal_add('dcc request', 'dcc_request_notify'); diff --git a/irssi/scripts/xchatnickcolor.pl b/irssi/scripts/xchatnickcolor.pl @@ -0,0 +1,160 @@ +use strict; +use Irssi 20020101.0250 (); +use vars qw($VERSION %IRSSI); +$VERSION = "1"; +%IRSSI = ( + authors => "Timo Sirainen, Ian Peters", + contact => "tss\@iki.fi", + name => "Nick Color", + description => "assign a different color for each nick", + license => "Public Domain", + url => "http://irssi.org/", + changed => "2002-03-04T22:47+0100" +); + +# hm.. i should make it possible to use the existing one.. +Irssi::theme_register([ + 'pubmsg_hilight', '{pubmsghinick $0 $3 $1}$2' +]); + +my %saved_colors; +my %session_colors = {}; +my @colors = qw/ 2 3 4 5 6 7 9 10 11 12 13 14 15/; + +sub load_colors { + open COLORS, "$ENV{HOME}/.irssi/saved_colors"; + + while (<COLORS>) { + # I don't know why this is necessary only inside of irssi + my @lines = split "\n"; + foreach my $line (@lines) { + my($nick, $color) = split ":", $line; + $saved_colors{$nick} = $color; + } + } + + close COLORS; +} + +sub save_colors { + open COLORS, ">$ENV{HOME}/.irssi/saved_colors"; + + foreach my $nick (keys %saved_colors) { + print COLORS "$nick:$saved_colors{$nick}\n"; + } + + close COLORS; +} + +# If someone we've colored (either through the saved colors, or the hash +# function) changes their nick, we'd like to keep the same color +# associated +# with them (but only in the session_colors, ie a temporary mapping). + +sub sig_nick { + my ($server, $newnick, $nick, $address) = @_; + my $color; + + $newnick = substr ($newnick, 1) if ($newnick =~ /^:/); + + if ($color = $saved_colors{$nick}) { + $session_colors{$newnick} = $color; + } elsif ($color = $session_colors{$nick}) { + $session_colors{$newnick} = $color; + } +} + +# This gave reasonable distribution values when run across +# /usr/share/dict/words + +sub simple_hash { + my ($string) = @_; + chomp $string; + my @chars = split //, $string; + my $counter; + + foreach my $char (@chars) { + $counter += ord $char; + } + + $counter = $colors[$counter % 11]; + + return $counter; +} + +# FIXME: breaks /HILIGHT etc. +sub sig_public { + my ($server, $msg, $nick, $address, $target) = @_; + my $chanrec = $server->channel_find($target); + return if not $chanrec; + my $nickrec = $chanrec->nick_find($nick); + return if not $nickrec; + my $nickmode = $nickrec->{op} ? "@" : $nickrec->{voice} ? "+" : ""; + + # Has the user assigned this nick a color? + my $color = $saved_colors{$nick}; + + # Have -we- already assigned this nick a color? + if (!$color) { + $color = $session_colors{$nick}; + } + + # Let's assign this nick a color + if (!$color) { + $color = simple_hash $nick; + $session_colors{$nick} = $color; + } + + $color = "0".$color if ($color < 10); + $server->command('/^format pubmsg %b%w$2'.chr(3).$color.'$[-11]0%b +%K │ %n $1'); + # $server->command('/^format action_public {pubaction + # '.chr(3).$color.'$0}$1'); +} + +sub cmd_color { + my ($data, $server, $witem) = @_; + my ($op, $nick, $color) = split " ", $data; + + $op = lc $op; + + if (!$op) { + Irssi::print ("No operation given"); + } elsif ($op eq "save") { + save_colors; + } elsif ($op eq "set") { + if (!$nick) { + Irssi::print ("Nick not given"); + } elsif (!$color) { + Irssi::print ("Color not given"); + } elsif ($color < 2 || $color > 14) { + Irssi::print ("Color must be between 2 and 14 inclusive"); + } else { + $saved_colors{$nick} = $color; + } + } elsif ($op eq "clear") { + if (!$nick) { + Irssi::print ("Nick not given"); + } else { + delete ($saved_colors{$nick}); + } + } elsif ($op eq "list") { + Irssi::print ("\nSaved Colors:"); + foreach my $nick (keys %saved_colors) { + Irssi::print (chr (3) . "$saved_colors{$nick}$nick" . + chr (3) . "1 ($saved_colors{$nick})"); + } + } elsif ($op eq "preview") { + Irssi::print ("\nAvailable colors:"); + foreach my $i (2..14) { + Irssi::print (chr (3) . "$i" . "Color #$i"); + } + } +} + +load_colors; + +Irssi::command_bind('color', 'cmd_color'); + +Irssi::signal_add('message public', 'sig_public'); +Irssi::signal_add('event nick', 'sig_nick');