dotfiles

<-- duh.
Log | Files | Refs | LICENSE

commit 8d9cf471d63f4cf7a57e3c077f06277a7bcddb0d
parent 242d9b59642300a687ec1669c672dc1d0f0a1e56
Author: Hayden Hamilton <haydenh@sdf.org>
Date:   Fri, 17 Jul 2020 01:55:59 +0100

irssi & some other bits and peices

Diffstat:
M.config/alias | 1+
M.config/irssi/config | 232++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------
D.config/irssi/default.theme | 793-------------------------------------------------------------------------------
M.config/irssi/fctcplist | 7++++---
D.config/irssi/pipe.theme | 32--------------------------------
M.config/irssi/pipeline.theme | 109+++++++++++++++++++++++++++++++++++++++++++------------------------------------
D.config/irssi/saved_nick_colors | 256-------------------------------------------------------------------------------
A.config/irssi/scripts/README | 2++
A.config/irssi/scripts/adv_windowlist.pl | 2++
A.config/irssi/scripts/ascii.pl | 2++
A.config/irssi/scripts/autonickprefix.pl | 2++
D.config/irssi/scripts/autorun/auto_whois.pl | 80-------------------------------------------------------------------------------
A.config/irssi/scripts/autorun/autonickprefix.pl | 39+++++++++++++++++++++++++++++++++++++++
D.config/irssi/scripts/autorun/dispatch.pl | 26--------------------------
D.config/irssi/scripts/autorun/go.pl | 115-------------------------------------------------------------------------------
D.config/irssi/scripts/autorun/irssi-alert.pl | 35-----------------------------------
A.config/irssi/scripts/autorun/tmux_away.pl | 202+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.config/irssi/scripts/autorun/trackbar.pl | 606+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.config/irssi/scripts/autorun/trigger.pl | 1257+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.config/irssi/scripts/cmdind.pl | 2++
A.config/irssi/scripts/ctcpspoof.pl | 2++
A.config/irssi/scripts/dim_nicks.pl | 2++
A.config/irssi/scripts/ls.pl | 2++
A.config/irssi/scripts/nickcolor.pl | 2++
A.config/irssi/scripts/nojointext.pl | 2++
A.config/irssi/scripts/printlevel.pl | 19+++++++++++++++++++
A.config/irssi/scripts/tmux-nicklist-portable.pl | 2++
A.config/irssi/scripts/tmux_away.pl | 2++
A.config/irssi/scripts/trackbar.pl | 2++
A.config/irssi/scripts/trigger.pl | 2++
A.config/irssi/scripts/uberprompt.pl | 2++
A.config/irssi/scripts/vim_mode.pl | 2++
M.config/irssi/triggers | 1+
M.config/nvim/after/syntax/sh.vim | 16++++++++--------
M.config/zsh/alias.zsh | 1+
M.scripts/bin/dmenu/dpass | 1+
M.scripts/dwmblocks/bat | 2+-
M.scripts/dwmblocks/news | 2+-
M.zprofile | 6++----
DLICENSE | 19-------------------
40 files changed, 2412 insertions(+), 1477 deletions(-)

diff --git a/.config/alias b/.config/alias @@ -45,6 +45,7 @@ irc ssh -p 15551 hayden@77.68.91.186 vps2 ssh -p 15552 hayden@vps2.haydenvh.com dd echo PLEASE TRIPLE CHECK, THEN RUN ddd ddd dd +diff colordiff ~d cd ~/general/downloads; ls ~do cd ~/general/documents; ls ~iw cd ~/images/wallpapers; ls diff --git a/.config/irssi/config b/.config/irssi/config @@ -1,5 +1,15 @@ servers = ( { address = "irc.rizon.net"; chatnet = "rizon"; port = "6667"; }, + { + address = "irc.freenode.net"; + chatnet = "freenode"; + port = "6667"; + }, + { + address = "irc.nebulacentre.net"; + chatnet = "nebulacentre"; + port = "6667"; + }, { address = "irc.haydenvh.com"; chatnet = "hlircnet"; @@ -16,19 +26,42 @@ servers = ( chatnet = "darkscience"; use_tls = "yes"; port = "6697"; - } + }, + { address = "genoce.org"; chatnet = "genoce"; port = "6667"; } ); chatnets = { - Rizon = { type = "IRC"; }; - hlircnet = { type = "IRC"; }; - sdf = { type = "IRC"; }; - efnet = { type = "IRC"; }; - unix = { type = "IRC"; }; - darkscience = { type = "IRC"; }; + Rizon = { + type = "IRC"; + autosendcmd = "/exec - -msg NickServ dpass irc.rizon.net identify; wait 2000"; + usermode = "+w-z"; + }; + hlircnet = { + type = "IRC"; + autosendcmd = "/oper haydenh !!!; wait 2500; /cycle #users; /cycle #service"; + }; + sdf = { type = "IRC"; usermode = "+w-x"; }; + efnet = { type = "IRC"; usermode = "+w"; }; + unix = { + type = "IRC"; + autosendcmd = "/exec - -msg NickServ dpass unix.chat identify; wait 2000"; + usermode = "+w-x"; + }; + darkscience = { + type = "IRC"; + usermode = "+w-x"; + autosendcmd = "/exec - -msg NickServ dpass irc.darkscience.net identify; wait 2000"; + }; + nebulacentre = { type = "IRC"; }; + genoce = { type = "IRC"; usermode = "+w-x"; }; + freenode = { + type = "IRC"; + autosendcmd = "/exec - -msg NickServ dpass irc.freenode.net identify; wait 2000"; + }; }; aliases = { ATAG = "WINDOW SERVER"; ADDALLCHANS = "SCRIPT EXEC foreach my \\$channel (Irssi::channels()) { Irssi::command(\"CHANNEL ADD -auto \\$channel->{name} \\$channel->{server}->{tag} \\$channel->{key}\")\\;}"; + ACMSG = "/action"; B = "BAN"; BACK = "AWAY"; BANS = "BAN"; @@ -185,12 +218,12 @@ aliases = { night = "/away -all sleeping"; day = "back"; gone = "away -all somewhere"; - wave = "SAY\0110/;SAY /|;SAY / \\\\"; + wave = "SAY 0/;SAY /|;SAY / \\\\"; admin = "mode $0 +a $1"; super = "mode $0 +q $1"; desuper = "mode $0 -q $1"; deadmin = "mode $0 -a $1"; - save = "/layout save; /ADDALLCHANS; /save"; + save = "/layout save; /ADDALLCHANS; /save -formats"; halfop = "mode $0 +h $1"; dehalfop = "mode $0 -h $1"; vm_add = " /^statusbar prompt add -after input -alignment right more; /^statusbar prompt add -after input -alignment right vim_cmd_mode"; @@ -203,16 +236,32 @@ aliases = { gline = "quote GLINE"; zline = "quote ZLINE"; gzline = "quote GZLINE"; - bet = "/say I bet $0 imaginary moneys $1 $2 $3 $4 $5 $6 $7 $8 $9"; + bet = "/say I bet $0 hlirccens (imaginary moneys) $1 $2 $3 $4 $5 $6 $7 $8 $9"; disgust = "/exec - -out head -n 100 < /dev/urandom | tr -d '\\n' | fold -w 20 2>/dev/null | head -n 1"; - time = "/exec - -out date +%H:%M:%S"; + theme = "/set theme"; + retheme = "/set theme default; /set theme $0"; + reply = "/msg $, $*"; + rep = "/reply"; + helpop = "/quote helpop"; + cycle = "/cycle cycling"; + replay = " "; + saumode = "/quote saumode"; + "runauto;" = "/script load autorun/$0"; + runauto = "/script load autorun/$0"; + dns = "/quote dns"; + clones = "/quote clones"; + ttime = "/exec - -out date +%H:%M:%S"; + arep = "/ACMSG $, $*"; + AAAA = "SAY \\\\0/;SAY |;SAY / \\\\"; + matrix = "SAY I'd like to interject for a moment, what you're referring to as Matrix, is in fact GNU/matrix, or as I've recently taken to calling it, GNU+matrix. Matrix is not an ideology unto itself, but rather another free component of a fully functioning method of thought."; + quickcon = "/connect sdf; /connect darkscience; /connect rizon; /connect unix; /connect efnet; /connect genoce; /connect hlircnet"; }; statusbar = { items = { barstart = "{sbstart}"; ibarstart = "{isbstart}"; barend = "{sbend}"; - user = "{sb $N +$usermode{sbaway $A}}"; + user = "{sb $P$N +$usermode{sbaway $A}{opered $O}}"; winref = "{sb $winname$itemname{sbmode $M}}{sb3 $winref}"; server = "{sb {sbservertag $tag}}"; prompt = "{prompt $[.15]itemname}"; @@ -222,7 +271,7 @@ statusbar = { lag = "{sb Lag: $0-}"; act = "{sb Act: $0-}"; more = "{sb3 -- more --}"; - end = "%N%M%_────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────"; + end = "%N%K%_───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────"; none = " "; }; default = { @@ -261,6 +310,8 @@ settings = { recode_transliterate = "no"; timestamp_format = "%H:%M:%S"; hostname = "vps1.haydenvh.com"; + quit_message = "pain is temporary"; + STATUS_OPER = "yes"; }; "fe-text" = { actlist_sort = "refnum"; @@ -275,33 +326,41 @@ settings = { emphasis_italics = "yes"; beep_msg_level = "msgs hilight dccmsgs"; show_names_on_join = "no"; - window_check_level_first = "no"; + window_check_level_first = "yes"; autocreate_own_query = "no"; autocreate_windows = "yes"; use_msgs_window = "no"; autocreate_query_level = "NONE"; + emphasis = "yes"; + emphasis_multiword = "yes"; + emphasis_replace = "yes"; + window_default_level = "MSGS PUBLICS NOTICES CTCPS ACTIONS JOINS PARTS QUITS KICKS MODES TOPICS NICKS"; }; "perl/core/scripts" = { ascii_figlet_path = "/usr/bin/figlet"; - nickcolor_colors = "4 8 9 10 11 12 13 14 15"; + nickcolor_coltag = "4 8 9 10 11 12 13 14 15"; nicklist_width = "21"; nicklist_height = "46"; dim_nicks_color = "r"; awl_shared_sbar = "OFF"; awl_block = "25"; awl_sort = "active/server/tag"; - trackbar_string = "%_─%_"; - trackbar_style = "%M%_"; + trackbar_string = "─"; + trackbar_style = "%K%_"; trackbar_print_timestamp = "no"; uberprompt_load_hook = "/^vm_add"; uberprompt_unload_hook = "/^vm_del"; cmdind_warn_text = "%G%_MSG?"; cmdind_text = "%g%_CMD: "; + tmux_away_window = "[control-panel]"; + tmux_away_message = "(set away by a script)"; + neat_colors = "RX4CX6CX5EX3CX2JX1CGcX1ZBX3HX2TX3MX25X4NMX3AX4GX42X6BX51"; }; "irc/core" = { alternate_nick = "haydenh_"; ctcp_version_reply = "UNIVERSE v42"; ctcp_userinfo_reply = "gopher://haydenvh.com:73"; + part_message = "pain is temporary"; }; }; logs = { }; @@ -349,30 +408,36 @@ channels = ( { name = "#opers"; chatnet = "hlircnet"; autojoin = "yes"; }, { name = "#users"; chatnet = "hlircnet"; autojoin = "yes"; }, { name = "#service"; chatnet = "hlircnet"; autojoin = "yes"; }, - { name = "#test"; chatnet = "hlircnet"; autojoin = "yes"; } + { name = "#test"; chatnet = "hlircnet"; autojoin = "yes"; }, + { name = "#cgo"; chatnet = "hlircnet"; autojoin = "yes"; }, + { name = "#general"; chatnet = "nebulacentre"; autojoin = "yes"; }, + { name = "#books"; chatnet = "genoce"; autojoin = "yes"; }, + { name = "#general"; chatnet = "genoce"; autojoin = "yes"; } ); +notifies = { Passivity = { }; }; windows = { 1 = { immortal = "yes"; name = "[control-panel]"; - level = "CRAP PUBLICS ACTIONS JOINS PARTS QUITS KICKS MODES TOPICS NICKS CLIENTNOTICES CLIENTCRAP CLIENTERRORS HILIGHTS"; + level = "CRAP PUBLICS ACTIONS JOINS PARTS QUITS KICKS MODES TOPICS NICKS CLIENTNOTICES CLIENTCRAP CLIENTERRORS"; sticky = "yes"; + parent = "3"; }; 2 = { immortal = "yes"; name = "[notices]"; - level = "SNOTES CTCPS WALLOPS INVITES"; + level = "PUBLICS NOTICES SNOTES CTCPS ACTIONS JOINS PARTS QUITS KICKS MODES TOPICS WALLOPS INVITES NICKS"; sticky = "yes"; - parent = "1"; + parent = "3"; }; 3 = { immortal = "yes"; name = "[msgs]"; - level = "MSGS PUBLICS NOTICES CTCPS ACTIONS JOINS PARTS QUITS KICKS MODES TOPICS NICKS DCC DCCMSGS"; + level = "MSGS NOTICES CTCPS ACTIONS KICKS TOPICS NICKS DCC DCCMSGS"; sticky = "yes"; - parent = "1"; }; 4 = { + level = "MSGS PUBLICS NOTICES CTCPS ACTIONS JOINS PARTS QUITS KICKS MODES TOPICS NICKS"; items = ( { type = "CHANNEL"; @@ -383,6 +448,7 @@ windows = { ); }; 5 = { + level = "MSGS PUBLICS NOTICES CTCPS ACTIONS JOINS PARTS QUITS KICKS MODES TOPICS NICKS"; items = ( { type = "CHANNEL"; @@ -393,6 +459,7 @@ windows = { ); }; 6 = { + level = "MSGS PUBLICS NOTICES CTCPS ACTIONS JOINS PARTS QUITS KICKS MODES TOPICS NICKS"; items = ( { type = "CHANNEL"; @@ -413,7 +480,7 @@ windows = { } ); sticky = "yes"; - parent = "1"; + parent = "3"; }; 8 = { level = "MSGS PUBLICS NOTICES CTCPS ACTIONS JOINS PARTS QUITS KICKS MODES TOPICS NICKS"; @@ -426,7 +493,7 @@ windows = { } ); sticky = "yes"; - parent = "1"; + parent = "3"; }; 9 = { level = "MSGS PUBLICS NOTICES CTCPS ACTIONS JOINS PARTS QUITS KICKS MODES TOPICS NICKS"; @@ -434,12 +501,12 @@ windows = { { type = "CHANNEL"; chat_type = "IRC"; - name = "#bots"; + name = "#vhosts"; tag = "hlircnet"; } ); sticky = "yes"; - parent = "1"; + parent = "3"; }; 10 = { level = "MSGS PUBLICS NOTICES CTCPS ACTIONS JOINS PARTS QUITS KICKS MODES TOPICS NICKS"; @@ -447,12 +514,12 @@ windows = { { type = "CHANNEL"; chat_type = "IRC"; - name = "#vhosts"; + name = "#haydenvh.com"; tag = "hlircnet"; } ); sticky = "yes"; - parent = "1"; + parent = "3"; }; 11 = { level = "MSGS PUBLICS NOTICES CTCPS ACTIONS JOINS PARTS QUITS KICKS MODES TOPICS NICKS"; @@ -465,7 +532,7 @@ windows = { } ); sticky = "yes"; - parent = "1"; + parent = "3"; }; 12 = { level = "MSGS PUBLICS NOTICES CTCPS ACTIONS JOINS PARTS QUITS KICKS MODES TOPICS NICKS"; @@ -478,7 +545,7 @@ windows = { } ); sticky = "yes"; - parent = "1"; + parent = "3"; }; 13 = { level = "MSGS PUBLICS NOTICES CTCPS ACTIONS JOINS PARTS QUITS KICKS MODES TOPICS NICKS"; @@ -486,12 +553,12 @@ windows = { { type = "CHANNEL"; chat_type = "IRC"; - name = "#haydenvh.com"; + name = "#GNU/matrix"; tag = "hlircnet"; } ); sticky = "yes"; - parent = "1"; + parent = "3"; }; 14 = { level = "MSGS PUBLICS NOTICES CTCPS ACTIONS JOINS PARTS QUITS KICKS MODES TOPICS NICKS"; @@ -499,93 +566,150 @@ windows = { { type = "CHANNEL"; chat_type = "IRC"; - name = "#GNU/matrix"; + name = "#opers"; tag = "hlircnet"; } ); - sticky = "yes"; - parent = "1"; }; 15 = { + level = "MSGS PUBLICS NOTICES CTCPS ACTIONS JOINS PARTS QUITS KICKS MODES TOPICS NICKS"; items = ( { type = "CHANNEL"; chat_type = "IRC"; - name = "#opers"; + name = "#users"; tag = "hlircnet"; } ); + sticky = "yes"; + parent = "3"; }; 16 = { + level = "MSGS PUBLICS NOTICES CTCPS ACTIONS JOINS PARTS QUITS KICKS MODES TOPICS NICKS"; items = ( { type = "CHANNEL"; chat_type = "IRC"; - name = "#users"; + name = "#service"; tag = "hlircnet"; } ); sticky = "yes"; - parent = "1"; + parent = "3"; }; 17 = { + level = "MSGS PUBLICS NOTICES CTCPS ACTIONS JOINS PARTS QUITS KICKS MODES TOPICS NICKS"; items = ( - { + { type = "CHANNEL"; chat_type = "IRC"; - name = "#service"; - tag = "hlircnet"; + name = "#sdf"; + tag = "sdf"; } ); - sticky = "yes"; - parent = "1"; }; 18 = { + level = "MSGS PUBLICS NOTICES CTCPS ACTIONS JOINS PARTS QUITS KICKS MODES TOPICS NICKS"; items = ( - { + { type = "CHANNEL"; chat_type = "IRC"; - name = "#sdf"; + name = "#gopher"; tag = "sdf"; } ); }; 19 = { + level = "MSGS PUBLICS NOTICES CTCPS ACTIONS JOINS PARTS QUITS KICKS MODES TOPICS NICKS"; items = ( { type = "CHANNEL"; chat_type = "IRC"; - name = "#gopher"; + name = "#helpdesk"; tag = "sdf"; } ); }; 20 = { + level = "MSGS PUBLICS NOTICES CTCPS ACTIONS JOINS PARTS QUITS KICKS MODES TOPICS NICKS"; items = ( { type = "CHANNEL"; chat_type = "IRC"; - name = "#helpdesk"; - tag = "sdf"; + name = "#unix"; + tag = "unix"; } ); }; 21 = { + level = "MSGS PUBLICS NOTICES CTCPS ACTIONS JOINS PARTS QUITS KICKS MODES TOPICS NICKS"; items = ( { type = "CHANNEL"; chat_type = "IRC"; - name = "#unix"; - tag = "unix"; + name = "#test"; + tag = "hlircnet"; + } + ); + sticky = "yes"; + parent = "3"; + }; + 22 = { + level = "MSGS PUBLICS NOTICES CTCPS ACTIONS JOINS PARTS QUITS KICKS MODES TOPICS NICKS"; + items = ( + { + type = "CHANNEL"; + chat_type = "IRC"; + name = "#cgo"; + tag = "hlircnet"; + } + ); + sticky = "yes"; + parent = "3"; + }; + 23 = { + level = "MSGS PUBLICS NOTICES CTCPS ACTIONS JOINS PARTS QUITS KICKS MODES TOPICS NICKS"; + items = ( + { + type = "CHANNEL"; + chat_type = "IRC"; + name = "#general"; + tag = "genoce"; + } + ); + sticky = "yes"; + parent = "3"; + }; + 24 = { + level = "MSGS PUBLICS NOTICES CTCPS ACTIONS JOINS PARTS QUITS KICKS MODES TOPICS NICKS"; + items = ( + { + type = "CHANNEL"; + chat_type = "IRC"; + name = "#books"; + tag = "genoce"; + } + ); + sticky = "yes"; + parent = "3"; + }; + 25 = { + level = "MSGS PUBLICS NOTICES CTCPS ACTIONS JOINS PARTS QUITS KICKS MODES TOPICS NICKS"; + items = ( + { + type = "CHANNEL"; + chat_type = "IRC"; + name = "#bots"; + tag = "hlircnet"; } ); }; }; mainwindows = { - 1 = { + 3 = { first_line = "1"; - lines = "44"; + lines = "62"; first_column = "0"; - columns = "146"; + columns = "130"; }; }; diff --git a/.config/irssi/default.theme b/.config/irssi/default.theme @@ -1,793 +0,0 @@ -# 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. "ownnick" 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"; - window_border = "%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" already puts a 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"; -}; -formats = { - "fe-common/irc/notifylist" = { - notify_join = "{nick $0} [$1@$2] [{hilight $3}] has joined to $4"; - notify_part = "{nick $0} has left $4"; - notify_away = "{nick $0} [$5] [$1@$2] [{hilight $3}] is now away: $4"; - notify_unaway = "{nick $0} [$4] [$1@$2] [{hilight $3}] is now unaway"; - notify_online = "On $0: {hilight $1}"; - notify_offline = "Offline: $0"; - notify_list = "$0: $1 $2"; - notify_list_empty = "The notify list is empty"; - }; - "fe-common/core" = { - line_start = "{line_start}"; - line_start_irssi = "{line_start}{hilight Irssi:} "; - timestamp = "{timestamp $Z} "; - servertag = "[$0] "; - daychange = "Day changed to %%d %%b %%Y"; - talking_with = "You are now talking with {nick $0}"; - refnum_too_low = "Window number must be greater than 1"; - error_server_sticky = "Window's server is sticky and it cannot be changed without -unsticky option"; - set_server_sticky = "Window's server set sticky"; - unset_server_sticky = "Window's server isn't sticky anymore"; - window_name_not_unique = "Window names must be unique"; - window_level = "Window level is now $0"; - window_set_immortal = "Window is now immortal"; - window_unset_immortal = "Window isn't immortal anymore"; - window_immortal_error = "Window is immortal, if you really want to close it, say /WINDOW IMMORTAL OFF"; - windowlist_header = "%#Ref Name Active item Server Level"; - windowlist_line = "%#$[4]0 %|$[20]1 $[15]2 $[15]3 $4"; - windowlist_footer = ""; - windows_layout_saved = "Layout of windows is now remembered"; - windows_layout_reset = "Layout of windows reset to defaults"; - window_info_header = ""; - window_info_footer = ""; - window_info_refnum = "%#Window : {hilight #$0}"; - window_info_refnum_sticky = "%#Window : {hilight #$0 (sticky)}"; - window_info_name = "%#Name : $0"; - window_info_history = "%#History : $0"; - window_info_immortal = "%#Immortal: yes"; - window_info_size = "%#Size : $0x$1"; - window_info_level = "%#Level : $0"; - window_info_server = "%#Server : $0"; - window_info_server_sticky = "%#Server : $0 (sticky)"; - window_info_theme = "%#Theme : $0$1"; - window_info_bound_items_header = "%#Bounds : {hilight Name Server tag}"; - window_info_bound_item = "%# : $[!30]0 $[!15]1 $2"; - window_info_bound_items_footer = ""; - window_info_items_header = "%#Items : {hilight Name Server tag}"; - window_info_item = "%# $[7]0: $[!30]1 $2"; - window_info_items_footer = ""; - looking_up = "Looking up {server $0}"; - connecting = "Connecting to {server $0} [$1] port {hilight $2}"; - reconnecting = "Reconnecting to {server $0} [$1] port {hilight $2} - use /RMRECONNS to abort"; - connection_established = "Connection to {server $0} established"; - cant_connect = "Unable to connect server {server $0} port {hilight $1} {reason $2}"; - connection_lost = "Connection lost to {server $0}"; - lag_disconnected = "No PONG reply from server {server $0} in $1 seconds, disconnecting"; - disconnected = "Disconnected from {server $0} {reason $1}"; - server_quit = "Disconnecting from server {server $0}: {reason $1}"; - server_changed = "Changed to {hilight $2} server {server $1}"; - unknown_server_tag = "Unknown server tag {server $0}"; - no_connected_servers = "Not connected to any servers"; - server_list = "{server $0}: $1:$2 ($3)"; - server_lookup_list = "{server $0}: $1:$2 ($3) (connecting...)"; - server_reconnect_list = "{server $0}: $1:$2 ($3) ($5 left before reconnecting)"; - server_reconnect_removed = "Removed reconnection to server {server $0} port {hilight $1}"; - server_reconnect_not_found = "Reconnection tag {server $0} not found"; - setupserver_added = "Server {server $0} saved"; - setupserver_removed = "Server {server $0} removed"; - setupserver_not_found = "Server {server $0} not found"; - your_nick = "Your nickname is {nick $0}"; - join = "{channick_hilight $0} {chanhost_hilight $1} has joined {channel $2}"; - part = "{channick $0} {chanhost $1} has left {channel $2} {reason $3}"; - kick = "{channick $0} was kicked from {channel $1} by {nick $2} {reason $3}"; - quit = "{channick $0} {chanhost $1} has quit {reason $2}"; - quit_once = "{channel $3} {channick $0} {chanhost $1} has quit {reason $2}"; - invite = "{nick $0} invites you to {channel $1}"; - not_invited = "You have not been invited to a channel!"; - new_topic = "{nick $0} changed the topic of {channel $1} to: $2"; - topic_unset = "Topic unset by {nick $0} on {channel $1}"; - your_nick_changed = "You're now known as {nick $1}"; - nick_changed = "{channick $0} is now known as {channick_hilight $1}"; - talking_in = "You are now talking in {channel $0}"; - not_in_channels = "You are not on any channels"; - current_channel = "Current channel {channel $0}"; - names = "{names_users Users {names_channel $0}}"; - names_prefix = "%#{names_prefix $0}"; - names_nick_op = "{names_nick_op $0 $1}"; - names_nick_halfop = "{names_nick_halfop $0 $1}"; - names_nick_voice = "{names_nick_voice $0 $1}"; - names_nick = "{names_nick $0 $1}"; - endofnames = "{channel $0}: Total of {hilight $1} nicks {comment {hilight $2} ops, {hilight $3} halfops, {hilight $4} voices, {hilight $5} normal}"; - chanlist_header = "%#You are on the following channels:"; - chanlist_line = "%#{channel $[-10]0} %|+$1 ($2): $3"; - chansetup_not_found = "Channel {channel $0} not found"; - chansetup_added = "Channel {channel $0} saved"; - chansetup_removed = "Channel {channel $0} removed"; - chansetup_header = "%#Channel Network Password Settings"; - chansetup_line = "%#{channel $[15]0} %|$[10]1 $[10]2 $3"; - chansetup_footer = ""; - own_msg = "{ownmsgnick $2 {ownnick $0}}$1"; - own_msg_channel = "{ownmsgnick $3 {ownnick $0}{msgchannel $1}}$2"; - own_msg_private = "{ownprivmsg msg $0}$1"; - own_msg_private_query = "{ownprivmsgnick {ownprivnick $2}}$1"; - pubmsg_me = "{pubmsgmenick $2 {menick $0}}$1"; - pubmsg_me_channel = "{pubmsgmenick $3 {menick $0}{msgchannel $1}}$2"; - pubmsg_hilight = "{pubmsghinick $0 $3 $1}$2"; - pubmsg_hilight_channel = "{pubmsghinick $0 $4 $1{msgchannel $2}}$3"; - pubmsg = "{pubmsgnick $2 {pubnick $0}}$1"; - pubmsg_channel = "{pubmsgnick $3 {pubnick $0}{msgchannel $1}}$2"; - msg_private = "{privmsg $0 $1}$2"; - msg_private_query = "{privmsgnick $0}$2"; - no_msgs_got = "You have not received a message from anyone yet"; - no_msgs_sent = "You have not sent a message to anyone yet"; - query_start = "Starting query in {server $1} with {nick $0}"; - query_stop = "Closing query with {nick $0}"; - no_query = "No query with {nick $0}"; - query_server_changed = "Query with {nick $0} changed to server {server $1}"; - hilight_header = "%#Highlights:"; - hilight_line = "%#$[-4]0 $1 $2 $3$4"; - hilight_footer = ""; - hilight_not_found = "Highlight not found: $0"; - hilight_removed = "Highlight removed: $0"; - alias_added = "Alias $0 added"; - alias_removed = "Alias $0 removed"; - alias_not_found = "No such alias: $0"; - aliaslist_header = "%#Aliases:"; - aliaslist_line = "%#$[10]0 $1"; - aliaslist_footer = ""; - log_opened = "Log file {hilight $0} opened"; - log_closed = "Log file {hilight $0} closed"; - log_create_failed = "Couldn't create log file {hilight $0}: $1"; - log_locked = "Log file {hilight $0} is locked, probably by another running Irssi"; - log_not_open = "Log file {hilight $0} not open"; - log_started = "Started logging to file {hilight $0}"; - log_stopped = "Stopped logging to file {hilight $0}"; - log_list_header = "%#Logs:"; - log_list = "%#$0 $1: $2 $3$4$5"; - log_list_footer = ""; - windowlog_file = "Window LOGFILE set to $0"; - windowlog_file_logging = "Can't change window's logfile while log is on"; - no_away_msgs = "No new messages in awaylog"; - away_msgs = "{hilight $1} new messages in awaylog:"; - module_header = "%#Module Type Submodules"; - module_line = "%#$[!20]0 $[7]1 $2"; - module_footer = ""; - module_already_loaded = "Module {hilight $0/$1} already loaded"; - module_not_loaded = "Module {hilight $0/$1} is not loaded"; - module_load_error = "Error loading module {hilight $0/$1}: $2"; - module_version_mismatch = "{hilight $0/$1} is ABI version $2 but Irssi is version $abiversion, cannot load"; - module_invalid = "{hilight $0/$1} isn't Irssi module"; - module_loaded = "Loaded module {hilight $0/$1}"; - module_unloaded = "Unloaded module {hilight $0/$1}"; - command_unknown = "Unknown command: $0"; - command_ambiguous = "Ambiguous command: $0"; - option_unknown = "Unknown option: $0"; - option_ambiguous = "Ambiguous option: $0"; - option_missing_arg = "Missing required argument for: $0"; - not_enough_params = "Not enough parameters given"; - not_connected = "Not connected to server"; - not_joined = "Not joined to any channel"; - chan_not_found = "Not joined to such channel"; - chan_not_synced = "Channel not fully synchronized yet, try again after a while"; - illegal_proto = "Command isn't designed for the chat protocol of the active server"; - not_good_idea = "Doing this is not a good idea. Add -YES option to command if you really mean it"; - invalid_number = "Invalid number"; - invalid_time = "Invalid timestamp"; - invalid_level = "Invalid message level"; - invalid_size = "Invalid size"; - invalid_charset = "Invalid charset: $0"; - invalid_choice = "Invalid choice, must be one of $0"; - eval_max_recurse = "/eval hit maximum recursion limit"; - program_not_found = "Could not find file or file is not executable"; - no_server_defined = "No servers defined for this network, see /help server for how to add one"; - theme_saved = "Theme saved to $0"; - theme_save_failed = "Error saving theme to $0: $1"; - theme_not_found = "Theme {hilight $0} not found"; - theme_changed = "Now using theme {hilight $0} ($1)"; - window_theme = "Using theme {hilight $0} in this window"; - window_theme_default = "No theme is set for this window"; - window_theme_changed = "Now using theme {hilight $0} ($1) in this window"; - window_theme_removed = "Removed theme from this window"; - format_title = "%:[{hilight $0}] - [{hilight $1}]%:"; - format_subtitle = "[{hilight $0}]"; - format_item = "$0 = $1"; - ignored = "Ignoring {hilight $1} from {nick $0}"; - ignored_options = "Ignoring {hilight $1} from {nick $0} {comment $2}"; - unignored = "Unignored {nick $0}"; - ignore_not_found = "{nick $0} is not being ignored"; - ignore_no_ignores = "There are no ignores"; - ignore_header = "%#Ignore List:"; - ignore_line = "%#$[-4]0 $1: $2 $3 $4"; - ignore_footer = ""; - not_channel_or_query = "The current window is not a channel or query window"; - conversion_added = "Added {hilight $0}/{hilight $1} to conversion database"; - conversion_removed = "Removed {hilight $0} from conversion database"; - conversion_not_found = "{hilight $0} not found in conversion database"; - conversion_no_translits = "Transliterations not supported in this system"; - recode_header = "%#Target Character set"; - recode_line = "%#%|$[!30]0 $1"; - unknown_chat_protocol = "Unknown chat protocol: $0"; - unknown_chatnet = "Unknown chat network: $0 (create it with /NETWORK ADD)"; - not_toggle = "Value must be either ON, OFF or TOGGLE"; - perl_error = "Perl error: $0"; - bind_header = "%#Key Action"; - bind_list = "%#$[!20]0 $1 $2"; - bind_command_list = "$[!30]0 $1"; - bind_footer = ""; - bind_unknown_id = "Unknown bind action: $0"; - config_saved = "Saved configuration to file $0"; - config_reloaded = "Reloaded configuration"; - config_modified = "Configuration file was modified since irssi was last started - do you want to overwrite the possible changes?"; - glib_error = "{error $0} $1"; - overwrite_config = "Overwrite config (y/N)?"; - set_title = "[{hilight $0}]"; - set_item = "$[-!32]0 %_$1"; - set_unknown = "Unknown setting $0"; - set_not_boolean = "Setting {hilight $0} isn't boolean, use /SET"; - no_completions = "There are no completions"; - completion_removed = "Removed completion $0"; - completion_header = "%#Key Value Auto"; - completion_line = "%#$[10]0 $[!40]1 $2"; - completion_footer = ""; - capsicum_enabled = "Capability mode enabled"; - capsicum_disabled = "Capability mode not enabled"; - capsicum_failed = "Capability mode failed: $0"; - tls_ephemeral_key = "EDH Key: {hilight $0} bit {hilight $1}"; - tls_ephemeral_key_unavailable = "EDH Key: {error N/A}"; - tls_pubkey = "Public Key: {hilight $0} bit {hilight $1}, valid from {hilight $2} to {hilight $3}"; - tls_cert_header = "Certificate Chain:"; - tls_cert_subject = " Subject: {hilight $0}"; - tls_cert_issuer = " Issuer: {hilight $0}"; - tls_pubkey_fingerprint = "Public Key Fingerprint: {hilight $0} ({hilight $1})"; - tls_cert_fingerprint = "Certificate Fingerprint: {hilight $0} ({hilight $1})"; - tls_protocol_version = "Protocol: {hilight $0} ({hilight $1} bit, {hilight $2})"; - }; - "fe-common/irc/dcc" = { - own_dcc = "{dccownmsg dcc {dccownnick $1}}$2"; - own_dcc_action = "{dccownaction_target $0 $1}$2"; - own_dcc_action_query = "{dccownaction $0}$2"; - own_dcc_ctcp = "{ownctcp ctcp $0}$1 $2"; - dcc_msg = "{dccmsg dcc $0}$1"; - action_dcc = "{dccaction $0}$1"; - action_dcc_query = "{dccaction $0}$1"; - own_dcc_query = "{ownmsgnick {dccownquerynick $0}}$2"; - dcc_msg_query = "{privmsgnick $0}$1"; - dcc_ctcp = "{dcc >>> DCC CTCP {hilight $1} received from {hilight $0}: $2}"; - dcc_chat = "{dcc DCC CHAT from {nick $0} [$1 port $2]}"; - dcc_chat_channel = "{dcc DCC CHAT from {nick $0} [$1 port $2] requested in channel {channel $3}}"; - dcc_chat_not_found = "{dcc No DCC CHAT connection open to {nick $0}}"; - dcc_chat_connected = "{dcc DCC CHAT connection with {nick $0} [$1 port $2] established}"; - dcc_chat_disconnected = "{dcc DCC lost chat to {nick $0}}"; - dcc_send = "{dcc DCC SEND from {nick $0} [$1 port $2]: $3 [$4]}"; - dcc_send_channel = "{dcc DCC SEND from {nick $0} [$1 port $2]: $3 [$4 bytes] requested in channel {channel $5}}"; - dcc_send_exists = "{dcc DCC already sending file {dccfile $0} for {nick $1}}"; - dcc_send_no_route = "{dcc DCC route lost to nick {nick $0} when trying to send file {dccfile $1}}"; - dcc_send_not_found = "{dcc DCC not sending file {dccfile $1} to {nick $0}}"; - dcc_send_file_open_error = "{dcc DCC can't open file {dccfile $0}: $1}"; - dcc_send_connected = "{dcc DCC sending file {dccfile $0} for {nick $1} [$2 port $3]}"; - dcc_send_complete = "{dcc DCC sent file {dccfile $0} [{hilight $1}] for {nick $2} in {hilight $3} [{hilight $4kB/s}]}"; - dcc_send_aborted = "{dcc DCC aborted sending file {dccfile $0} for {nick $1}}"; - dcc_get_not_found = "{dcc DCC no file offered by {nick $0}}"; - dcc_get_connected = "{dcc DCC receiving file {dccfile $0} from {nick $1} [$2 port $3]}"; - dcc_get_complete = "{dcc DCC received file {dccfile $0} [$1] from {nick $2} in {hilight $3} [$4kB/s]}"; - dcc_get_aborted = "{dcc DCC aborted receiving file {dccfile $0} from {nick $1}}"; - dcc_get_write_error = "{dcc DCC error writing to file {dccfile $0}: {comment $1}"; - dcc_unknown_ctcp = "{dcc DCC unknown ctcp {hilight $0} from {nick $1} [$2]}"; - dcc_unknown_reply = "{dcc DCC unknown reply {hilight $0} from {nick $1} [$2]}"; - dcc_unknown_type = "{dcc DCC unknown type {hilight $0}}"; - dcc_invalid_ctcp = "{dcc DCC received CTCP {hilight $0} with invalid parameters from {nick $1}}"; - dcc_connect_error = "{dcc DCC can't connect to {hilight $0} port {hilight $1}}"; - dcc_cant_create = "{dcc DCC can't create file {dccfile $0}: $1}"; - dcc_rejected = "{dcc DCC $0 was rejected by {nick $1} [{hilight $2}]}"; - dcc_request_send = "{dcc DCC $0 request sent to {nick $1}: $2"; - dcc_close = "{dcc DCC $0 close for {nick $1} [{hilight $2}]}"; - dcc_lowport = "{dcc Warning: Port sent with DCC request is a lowport ({hilight $0, $1}) - this isn't normal. It is possible the address/port is faked (or maybe someone is just trying to bypass firewall)}"; - dcc_list_header = "{dcc DCC connections}"; - dcc_list_line_chat = "{dcc $0 $1}"; - dcc_list_line_file = "{dcc $0 $1: %|$2 of $3 ($4%%) - $5kB/s - ETA $7 - $6}"; - dcc_list_line_queued_send = "{dcc - $0 $2 (queued)}"; - dcc_list_footer = ""; - dcc_list_line_server = "{dcc $0: Port($1) - Send($2) - Chat($3) - Fserve($4)}"; - dcc_server_started = "{dcc DCC SERVER started on port {hilight $0}}"; - dcc_server_closed = "{dcc DCC SERVER on port {hilight $0} closed}"; - }; - "fe-common/irc" = { - netsplit = "{netsplit Netsplit} {server $0} <-> {server $1} quits: $2"; - netsplit_more = "{netsplit Netsplit} {server $0} <-> {server $1} quits: $2 (+$3 more, use /NETSPLIT to show all of them)"; - netsplit_join = "{netjoin Netsplit} over, joins: $0"; - netsplit_join_more = "{netjoin Netsplit} over, joins: $0 (+$1 more)"; - no_netsplits = "There are no net splits"; - netsplits_header = "%#Nick Channel Server Split server"; - netsplits_line = "%#$[9]0 $[10]1 $[20]2 $3"; - netsplits_footer = ""; - network_added = "Network $0 saved"; - network_removed = "Network $0 removed"; - network_not_found = "Network $0 not found"; - network_header = "%#Networks:"; - network_line = "%#$0: $1"; - network_footer = ""; - setupserver_header = "%#Server Port Network Settings"; - setupserver_line = "%#%|$[!20]0 $[5]1 $[10]2 $3"; - setupserver_footer = ""; - sasl_success = "SASL authentication succeeded"; - sasl_error = "Cannot authenticate via SASL ($0)"; - cap_req = "Capabilities requested: $0"; - cap_ls = "Capabilities supported: $0"; - cap_ack = "Capabilities acknowledged: $0"; - cap_nak = "Capabilities refused: $0"; - cap_list = "Capabilities currently enabled: $0"; - cap_new = "Capabilities now available: $0"; - cap_del = "Capabilities removed: $0"; - joinerror_toomany = "Cannot join to channel {channel $0} (You have joined to too many channels)"; - joinerror_full = "Cannot join to channel {channel $0} (Channel is full)"; - joinerror_invite = "Cannot join to channel {channel $0} (You must be invited)"; - joinerror_banned = "Cannot join to channel {channel $0} (You are banned)"; - joinerror_bad_key = "Cannot join to channel {channel $0} (Bad channel key)"; - joinerror_bad_mask = "Cannot join to channel {channel $0} (Bad channel mask)"; - joinerror_unavail = "Cannot join to channel {channel $0} (Channel is temporarily unavailable)"; - joinerror_duplicate = "Channel {channel $0} already exists - cannot create it"; - channel_rejoin = "Channel {channel $0} is temporarily unavailable, this is normally because of netsplits. Irssi will now automatically try to rejoin back to this channel until the join is successful. Use /RMREJOINS command if you wish to abort this."; - inviting = "Inviting {nick $0} to {channel $1}"; - channel_created = "Channel {channelhilight $0} created $1"; - url = "Home page for {channelhilight $0}: $1"; - topic = "Topic for {channelhilight $0}: $1"; - no_topic = "No topic set for {channelhilight $0}"; - topic_info = "Topic set by {nick $0} {nickhost $2} {comment $1}"; - chanmode_change = "mode/{channelhilight $0} {mode $1} by {nick $2}"; - server_chanmode_change = "{netsplit ServerMode}/{channelhilight $0} {mode $1} by {nick $2}"; - channel_mode = "mode/{channelhilight $0} {mode $1}"; - bantype = "Ban type changed to {channel $0}"; - no_bans = "No bans in channel {channel $0}"; - banlist = "$0 - {channel $1}: ban {ban $2}"; - banlist_long = "$0 - {channel $1}: ban {ban $2} {comment by {nick $3}, $4 secs ago}"; - ebanlist = "{channel $0}: ban exception {ban $1}"; - ebanlist_long = "{channel $0}: ban exception {ban $1} {comment by {nick $2}, $3 secs ago}"; - no_invitelist = "Invite list is empty in channel {channel $0}"; - invitelist = "{channel $0}: invite {ban $1}"; - invitelist_long = "{channel $0}: invite {ban $1} {comment by {nick $2}, $3 secs ago}"; - no_such_channel = "{channel $0}: No such channel"; - channel_synced = "Join to {channel $0} was synced in {hilight $1} secs"; - usermode_change = "Mode change {mode $0} for user {nick $1}"; - user_mode = "Your user mode is {mode $0}"; - away = "You have been marked as being away"; - unaway = "You are no longer marked as being away"; - nick_away = "{nick $0} is away: $1"; - no_such_nick = "{nick $0}: No such nick/channel"; - nick_in_use = "Nick {nick $0} is already in use"; - nick_unavailable = "Nick {nick $0} is temporarily unavailable"; - your_nick_owned = "Your nick is owned by {nick $3} {comment $1@$2}"; - whois = "{nick $0} {nickhost $1@$2}%:{whois ircname $3}"; - whowas = "{nick $0} {nickhost $1@$2}%:{whois was $3}"; - whois_idle = "{whois idle %|$1 days $2 hours $3 mins $4 secs}"; - whois_idle_signon = "{whois idle %|$1 days $2 hours $3 mins $4 secs {comment signon: $5}}"; - whois_server = "{whois server %|$1 {comment $2}}"; - whois_oper = "{whois {hilight $1}}"; - whois_modes = "{whois modes $1}"; - whois_realhost = "{whois hostname $1-}"; - whois_usermode = "{whois usermode $1}"; - whois_channels = "{whois channels %|$1}"; - whois_away = "{whois away %|$1}"; - whois_special = "{whois %|$1}"; - whois_extra = "{whois account %|$1}"; - end_of_whois = "End of WHOIS"; - end_of_whowas = "End of WHOWAS"; - whois_not_found = "There is no such nick $0"; - who = "%#{channelhilight $[-10]0} %|{nick $[!9]1} $[!3]2 $[!2]3 $4@$5 {comment {hilight $6}}"; - end_of_who = "End of /WHO list"; - own_notice = "{ownnotice notice $0}$1"; - own_action = "{ownaction $0}$1"; - own_action_target = "{ownaction_target $0 $2}$1"; - own_ctcp = "{ownctcp ctcp $0}$1 $2"; - notice_server = "{servernotice $0}$1"; - notice_public = "{notice $0{pubnotice_channel $1}}$2"; - notice_private = "{notice $0{pvtnotice_host $1}}$2"; - action_private = "{pvtaction $0}$2"; - action_private_query = "{pvtaction_query $0}$2"; - action_public = "{pubaction $0}$1"; - action_public_channel = "{pubaction $0{msgchannel $1}}$2"; - ctcp_reply = "CTCP {hilight $0} reply from {nick $1}: $2"; - ctcp_reply_channel = "CTCP {hilight $0} reply from {nick $1} in channel {channel $3}: $2"; - ctcp_ping_reply = "CTCP {hilight PING} reply from {nick $0}: $1.$[-3.0]2 seconds"; - ctcp_requested = "{ctcp {hilight $0} {comment $1} requested CTCP {hilight $2} from {nick $4}}: $3"; - ctcp_requested_unknown = "{ctcp {hilight $0} {comment $1} requested unknown CTCP {hilight $2} from {nick $4}}: $3"; - online = "Users online: {hilight $0}"; - pong = "PONG received from $0: $1"; - wallops = "{wallop WALLOP {wallop_nick $0}} $1"; - action_wallops = "{wallop WALLOP {wallop_action $0}} $1"; - kill = "You were {error killed} by {nick $0} {nickhost $1} {reason $2} {comment Path: $3}"; - kill_server = "You were {error killed} by {server $0} {reason $1} {comment Path: $2}"; - error = "{error ERROR} $0"; - unknown_mode = "Unknown mode character $0"; - default_event = "$1"; - default_event_server = "[$0] $1"; - silenced = "Silenced {nick $0}"; - unsilenced = "Unsilenced {nick $0}"; - silence_line = "{nick $0}: silence {ban $1}"; - ask_oper_pass = "Operator password:"; - accept_list = "Accepted users: {hilight $0}"; - }; - "fe-common/perl" = { - script_not_found = "Script {hilight $0} not found"; - script_not_loaded = "Script {hilight $0} is not loaded"; - script_loaded = "Loaded script {hilight $0}"; - script_unloaded = "Unloaded script {hilight $0}"; - no_scripts_loaded = "No scripts are loaded"; - script_list_header = "%#Loaded scripts:"; - script_list_line = "%#$[!15]0 $1"; - script_list_footer = ""; - script_error = "{error Error in script {hilight $0}:}"; - }; - "Irssi::Script::ascii" = { - ascii_not_connected = "%_$0:%_ You're not connected to server"; - ascii_not_window = "%_$0:%_ Not joined to any channel or query window"; - ascii_not_chanwindow = "%_$0:%_ Not joined to any channel"; - ascii_not_chanop = "%_$0:%_ You're not channel operator in {hilight $1}"; - ascii_figlet_notfound = "%_Ascii:%_ Cannot execute {hilight $0} - file not found or bad permissions"; - ascii_figlet_notset = "%_Ascii:%_ Cannot find external program %_figlet%_, usign /SET ascii_figlet_path [path], to set it"; - ascii_cmd_syntax = "%_$0:%_ $1, usage: $2"; - ascii_figlet_error = "%_Ascii: Figlet returns error:%_ $0-"; - ascii_fontlist = "%_Ascii:%_ Available fonts [in $0]: $1 ($2)"; - ascii_empty_fontlist = "%_Ascii:%_ Cannot find figlet fonts in $0"; - ascii_unknown_fontdir = "%_Ascii:%_ Cannot find figlet fontdir"; - ascii_show_line = "$0-"; - }; - "Irssi::Script::trackbar" = { - trackbar_loaded = "%R>>%n %_Scriptinfo:%_ Loaded $0 version $1 by $2."; - trackbar_wrong_version = "%R>>%n %_Trackbar:%_ Please upgrade your client to 0.8.17 or above if you would like to use this feature of trackbar."; - trackbar_all_removed = "%R>>%n %_Trackbar:%_ All the trackbars have been removed."; - trackbar_not_found = "%R>>%n %_Trackbar:%_ No trackbar found in this window."; - }; - "Irssi::Script::adv_windowlist" = { - awl_display_nokey = "$N${cumode_space}$H$C$S"; - awl_display_key = "$Q${cumode_space}$H$C$S"; - awl_display_nokey_visible = "%2$N${cumode_space}$H$C$S"; - awl_display_key_visible = "%2$Q${cumode_space}$H$C$S"; - awl_display_nokey_active = "%1$N${cumode_space}$H$C$S"; - awl_display_key_active = "%1$Q${cumode_space}$H$C$S"; - awl_display_header = "%8$C|${N}"; - awl_name_display = "$0"; - awl_separator = " "; - awl_separator2 = ""; - awl_abbrev_chars = "~〜"; - awl_viewer_item_bg = "%0"; - awl_title = "\\Vawl\\:"; - }; - "Irssi::Script::trigger" = { - trigger_header = "Triggers:"; - trigger_line = "%#$[-4]0 $1"; - trigger_added = "Trigger $0 added: $1"; - trigger_not_found = "Trigger {hilight $0} not found"; - trigger_saved = "Triggers saved to $0"; - trigger_loaded = "Triggers loaded from $0"; - }; - "fe-text" = { - lastlog_too_long = "/LASTLOG would print $0 lines. If you really want to print all these lines use -force option."; - lastlog_count = "{hilight Lastlog}: $0 lines"; - lastlog_start = "{hilight Lastlog}:"; - lastlog_end = "{hilight End of Lastlog}"; - lastlog_separator = "--"; - lastlog_date = "%%F "; - refnum_not_found = "Window number $0 not found"; - window_too_small = "Not enough room to resize this window"; - cant_hide_last = "You can't hide the last window"; - cant_hide_sticky_windows = "You can't hide sticky windows (use /SET autounstick_windows ON)"; - cant_show_sticky_windows = "You can't show sticky windows (use /SET autounstick_windows ON)"; - window_not_sticky = "Window is not sticky"; - window_set_sticky = "Window set sticky"; - window_unset_sticky = "Window is not sticky anymore"; - window_info_sticky = "%#Sticky : $0"; - window_info_scroll = "%#Scroll : $0"; - window_scroll = "Window scroll mode is now $0"; - window_scroll_unknown = "Unknown scroll mode $0, must be ON, OFF or DEFAULT"; - window_hidelevel = "Window hidden level is now $0"; - statusbar_list_header = "%#Name Type Placement Position Visible"; - statusbar_list_footer = ""; - statusbar_list = "%#$[30]0 $[6]1 $[9]2 $[8]3 $4"; - statusbar_info_name = "%#Statusbar: {hilight $0}"; - statusbar_info_type = "%#Type : $0"; - statusbar_info_placement = "%#Placement: $0"; - statusbar_info_position = "%#Position : $0"; - statusbar_info_visible = "%#Visible : $0"; - statusbar_info_item_header = "%#Items : Name Priority Alignment"; - statusbar_info_item_footer = ""; - statusbar_info_item_name = "%# : $[35]0 $[9]1 $2"; - statusbar_not_found = "Statusbar is disabled: $0"; - statusbar_item_not_found = "Statusbar item doesn't exist: $0"; - statusbar_unknown_command = "Unknown statusbar command: $0"; - statusbar_unknown_type = "Statusbar type must be 'window' or 'root'"; - statusbar_unknown_placement = "Statusbar placement must be 'top' or 'bottom'"; - statusbar_unknown_visibility = "Statusbar visibility must be 'always', 'active' or 'inactive'"; - paste_warning = "Pasting $0 lines to $1. Press Ctrl-K if you wish to do this or Ctrl-C to cancel."; - paste_prompt = "Hit Ctrl-K to paste, Ctrl-C to abort?"; - irssi_banner = " ___ _%:|_ _|_ _ _____(_)%: | || '_(_-<_-< |%:|___|_| /__/__/_|%:Irssi v$J - https://irssi.org"; - welcome_firsttime = "- - - - - - - - - - - - - - - - - - - - - - - - - - - -\012Hi there! If this is your first time using Irssi, you%:might want to go to our website and read the startup%:documentation to get you going.%:%:Our community and staff are available to assist you or%:to answer any questions you may have.%:%:Use the /HELP command to get detailed information about%:the available commands.%:%:For Debian specific help type \"/connect OFTC\" and%:\"/join #debian\" (without the quotes) and ask your%:question.%:- - - - - - - - - - - - - - - - - - - - - - - - - - - -"; - welcome_init_settings = "The following settings were initialized"; - }; -}; diff --git a/.config/irssi/fctcplist b/.config/irssi/fctcplist @@ -1,7 +1,8 @@ time Time to get a watch advert Server: hlirc.haydenvh.com, port: 6667, 6697 -whoami stupid hitthisoneifyouareaflooder fuck off -ping pong version git://haydenvh.com/dotfiles (.config/irssi) -clientinfo ITTHISONEIFYOUAREAFLOODER PING VERSION TIME CLIENTINFO USERINFO WHOAMI ADVERT +away I dunno - might be away, might not be... you know, these aren't programmable they're just a string, heheheh +clientinfo PING VERSION TIME CLIENTINFO USERINFO WHOAMI ADVERT AWAY +ping ~1958345676742784768726452647 +whoami Why would I know? diff --git a/.config/irssi/pipe.theme b/.config/irssi/pipe.theme @@ -1,32 +0,0 @@ -formats = { - "fe-common/core" = { - join = "%_%B+%_{pubnick \00311$0} %n%w$1"; - part = "%_%G-{pubnick \00311$0} %n%w$1 {reason $3}"; - kick = "%_%G!{pubnick \00311$0} %n%wby {pubnick $2} from ${channel $1} {reason $3}"; - quit = "%_%G<{pubnick \00311$0} %n%w$1 {reason $2}"; - nick_changed = "{nick %w$0%n} %Nis now {nick %W$1%n}"; - endofnames = "{channel $0}: {hilight $1} nicks ({comment @/{hilight $2} +/{hilight $3} -/{hilight $4}})"; - own_msg = "{ownmsgnick $2 {ownnick $[0]0}}$1"; - own_msg_channel = "{ownmsgnick $3 {ownnick $[-16]0}{msgchannel $1}}$2"; - pubmsg_me = "{pubmsgmenick $2 {pubnick $0}}$1"; - pubmsg_me_channel = "{pubmsgmenick $3 {pubnick $[-16]0}{msgchannel $1}}$2"; - pubmsg_hilight = "{pubmsghinick $0 $3 $1}$2"; - pubmsg = "{pubmsgnick $2 {pubnick \00311$0}}$1"; - pubmsg_channel = "{pubmsgnick $3 {pubnick $0}{msgchannel $1}}$2"; - }; - "fe-common/irc" = { - chanmode_change = "%y{pubnick $2} %nsets mode %b{$mode $1} %non {$channelhilight $0}"; - server_chanmode_change = "{netsplit ServerMode}/{channelhilight $0}: {mode $1} by {nick $2}"; - whois = "{hilight $0} [{nickhost $1@$2}] [$whois_country]%: ircname : $3"; - whois_server = "server : $1 ({comment $2})"; - own_action = "{action_core $0 $1}"; - action_public = "{action_core $0 $1}"; - }; - "Irssi::Script::adv_windowlist" = { - awl_display_nokey = "%N$N $C"; - awl_display_key = "%N$N $C %mM-$Q "; - awl_display_nokey_active = "%N%K$N $C"; - awl_display_key_active = "%N%K$N $C"; - awl_display_header = "%1 %Y$C (${N}) "; - }; -}; diff --git a/.config/irssi/pipeline.theme b/.config/irssi/pipeline.theme @@ -77,7 +77,7 @@ abstracts = { # the basic styling of how to print message, $0 = nick mode, $1 = nick #msgnick = "<%C$0%n$1-%n> %|"; - msgnick = "$0$1%K |%n %|"; + msgnick = "$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 @@ -97,32 +97,22 @@ abstracts = { # $0 = nick mode, $1 = nick ownmsgnick = "{msgnick $0 $1-}%W"; - ownnick = "%y$*%n"; + ownnick = "%y$*"; # public message in channel, $0 = nick mode, $1 = nick pubmsgnick = "{msgnick $0%n %w$1%n}"; #pubmsgnick = "{msgnick $0$1-}"; - pubnick = "%w$nickcolor$*%n"; + pubnick = "%w$nickcolor$*"; # public message in channel meant for me, $0 = nick mode, $1 = nick - #pubmsgmenick = "%Y{msgnick %B$0%n %w$1%n}%w"; + #pu]bmsgmenick = "%Y{msgnick %B$0%n %w$1%n}%w"; pubmsgmenick = "$0$1%K %_#%_%n %|"; - # public highlighted message in channel - # $0 = highlight color, $1 = nick mode, $2 = nick - #pubmsghinick = "%Y{msgnick %B$1 %w$2}%w"; - pubmsghinick = "{msgnick $1 $0$2-%n}"; - # channel name is printed with message msgchannel = "%b:$*%n"; - # private message, $0 = nick, $1 = host - #privmsg = "%b.%c.%C.%n(%c$0%n[%c$1]) "; - privmsg = "[%w$0!%b$1-%n] "; - - # private message from you, $0 = "msg", $1 = target nick - #ownprivmsg = "%b.%c.%C.%n[%cmsg%n(%c$1%n)] "; - ownprivmsg = "{msgnick $*}"; + privmsg = "%R<---$0 %K%_#%_%N $1}"; + ownprivmsg = "$0%K--->$1 %K%_│%_%N%W $2}"; # own private message in query ownprivmsgnick = "{msgnick %W$*%w}"; @@ -139,11 +129,12 @@ abstracts = { action_core = "%w*%w %_$0%_ $1"; # generic one that's used by most actions - action = "%w{action_core %w$*} "; + action = "{action_core $*} "; # private action sent by others - pvtaction = "%w $*%n "; - pvtaction_query = "{action $*}"; + pvaction = "%R<---%_$0%_ %K# %w*%w %_$0%_ $1"; + + ownaction_target = "$0%K--->$1 %K| %w*%w %_$0%_ "; ## @@ -151,15 +142,14 @@ abstracts = { ## # notices - ownnotice = "%b>%c>%C> %c$0%B!%c$1%n: "; - notice = "%b$*%n "; - pubnotice_channel = "%K:%m$*"; - pubnotice_host = "%K(%m$*%K)"; + ownnotice = "$0%K--->$1 %K%_:%_%N%W $2}"; + notice = " {pubnick $*}%K : %N"; servernotice = "%g!$*%n "; # CTCPs - ownctcp = "%b>%c>%C> %c$0%B!%c$1%n: "; - ctcp = "%m$*%n"; + ownctcp = "{ownnick $N}%K--->$0 %K%_?%_%N %_$1%_"; + ctcp = "%R<---$1 %K%_A%_%N %_$0:%_ $2-"; + rctcp = "%R<---$0 %K%_?%_%N %_$1%_"; # wallops wallop = "%W$*%n: "; @@ -198,11 +188,12 @@ abstracts = { sb_background = "%0"; isbstart = "%0"; + opered = " (ircop: $*)"; # default statusbar item style - sb = "%N%M%_──[%_%G$*%M]"; + sb = "%N%K%_──[%_%G$*%K]"; sb2 = "%m[%G$*%m]%n"; - sb3 = "%N%M%_[%_%G$*%M]"; + sb3 = "%N%K%_[%_%G$*%K]"; sbmode = " %b+%G$*"; sbaway = " (away: $*)"; sbservertag = "$0"; @@ -222,7 +213,7 @@ abstracts = { sb_uc_normal = "%_.%_%G/%W$*%n"; sb_uc_space = " "; - sb_act_hilight = "%M$*"; + sb_act_hilight = "%K$*"; sb_act_hilight_color = "$0$1-%n"; sb_act_sep = "%c$*"; sb_act_text = "%c$*"; @@ -243,7 +234,7 @@ formats = { own_msg_channel = "{ownmsgnick $3 {ownnick $[-16]0}{msgchannel $1}}$2"; pubmsg_me = "{pubmsgmenick $2 {pubnick $0}}$1"; pubmsg_me_channel = "{pubmsgmenick $3 {pubnick $0}{msgchannel $1}}$2"; - pubmsg_hilight = "{pubmsghinick $4 {pubnick $1}}$2"; + pubmsg_hilight = "{pubmsgmenick $3 {pubnick $1}}$2"; pubmsg_channel = "{pubmsgnick $3 {pubnick $0}{msgchannel $1}}$2"; chanmode_change = " {$channel $1} {pubnick $2} %nsets mode %B{$mode $1}"; channel_mode = " {$channel $0} {pubnick $2} %nsets mode %B{$mode $1}"; @@ -251,7 +242,7 @@ formats = { line_start = "{line_start}"; line_start_irssi = "{line_start}{hilight Irssi:} "; servertag = "[$0] "; - daychange = "Day changed to %%d %%b %%Y"; + daychange = " %_----%_ %%d %%b %%Y %_----%_"; talking_with = "You are now talking with {nick $0}"; refnum_too_low = "Window number must be greater than 1"; error_server_sticky = "Window's server is sticky and it cannot be changed without -unsticky option"; @@ -329,10 +320,10 @@ formats = { chansetup_header = "%#Channel Network Password Settings"; chansetup_line = "%#{channel $[15]0} %|$[10]1 $[10]2 $3"; chansetup_footer = ""; - own_msg_private = "{ownprivmsg {ownnick $N}%K--->{pubnick $0}}%W$1"; + own_msg_private = "{ownprivmsg {ownnick $N} {pubnick $0} $1}"; own_msg_private_query = "{ownprivmsgnick {ownprivnick $2}}$1"; pubmsg_hilight_channel = "{pubmsghinick $0 $4 $1{msgchannel $2}}$3"; - msg_private = "{ownprivmsg %R<---{pubnick $0}}$2"; + msg_private = "{privmsg {pubnick $0}}$2"; msg_private_query = "{privmsgnick $0}$2"; no_msgs_got = "You have not received a message from anyone yet"; no_msgs_sent = "You have not sent a message to anyone yet"; @@ -464,8 +455,8 @@ formats = { whois = "%:{whois nick %|{hilight $0}}%:{whois host %|$2}%:{whois ident $|$1}%:{whois comment %|$3}"; server_chanmode_change = "{netsplit ServerMode}/{channelhilight $0}: {mode $1} by {nick $2}"; whois_server = "{whois server %|$1 ({comment $2})}"; - own_action = "{action_core $0 $1}"; - action_public = "{action_core $0 $1}"; + own_action = "{action_core {ownnick $0} $1}"; + action_public = "{action_core {pubnick $0}}$1"; away = "%_%G----->"; unaway = "%_%B<-----"; end_of_whois = "%|"; @@ -535,29 +526,29 @@ formats = { nick_in_use = "Nick {nick $0} is already in use"; nick_unavailable = "Nick {nick $0} is temporarily unavailable"; your_nick_owned = "Your nick is owned by {nick $3} {comment $1@$2}"; - whowas = "{nick $0} {nickhost $1@$2}%:{whois was $3}"; + whowas = "%:{whois nick %|{hilight $0}}%:{whois host %|$2}%:{whois ident $|$1}%:{whois comment %|$3}"; whois_idle = "{whois idle %|$1 days $2 hours $3 mins $4 secs}"; whois_modes = "{whois modes $1}"; whois_usermode = "{whois usermode $1}"; whois_channels = "{whois channels %|$1}"; whois_away = "{whois away %|$1}"; - end_of_whowas = "End of WHOWAS"; + end_of_whowas = "%|"; who = "%#{channelhilight $[-10]0} %|{nick $[!9]1} $[!3]2 $[!2]3 $4@$5 {comment {hilight $6}}"; end_of_who = "End of /WHO list"; - own_notice = "{ownnotice notice $0}$1"; - own_action_target = "{ownaction_target $0 $2}$1"; - own_ctcp = "{ownctcp ctcp $0}$1 $2"; + own_notice = "{ownnotice {ownnick $N} {pubnick $0}}$1"; + own_action_target = "{ownaction_target {ownnick $0} {pubnick $2}}$1"; + own_ctcp = "{ownctcp $0 $1}"; notice_server = "{servernotice $0}$1"; - notice_public = "{notice $0{pubnotice_channel $1}}$2"; - notice_private = "{notice $0{pvtnotice_host $1}}$2"; - action_private = "{pvtaction $0}$2"; - action_private_query = "{pvtaction_query $0}$2"; - action_public_channel = "{pubaction $0{msgchannel $1}}$2"; - ctcp_reply = "CTCP {hilight $0} reply from {nick $1}: $2"; - ctcp_reply_channel = "CTCP {hilight $0} reply from {nick $1} in channel {channel $3}: $2"; - ctcp_ping_reply = "CTCP {hilight PING} reply from {nick $0}: $1.$[-3.0]2 seconds"; - ctcp_requested = "{ctcp {hilight $0} {comment $1} requested CTCP {hilight $2} from {nick $4}}: $3"; - ctcp_requested_unknown = "{ctcp {hilight $0} {comment $1} requested unknown CTCP {hilight $2} from {nick $4}}: $3"; + notice_public = "{notice $0}$2"; + notice_private = "{notice $0}$2"; + action_private = "{pvaction {pubnick $0}}$2"; + action_private_query = "{pvaction {pubnick $0}}$2"; + action_public_channel = "{action_core {pubnick $0}}$2"; + ctcp_reply = "{ctcp $0 {pubnick $1} $2}"; + ctcp_reply_channel = "{ctcp $0 {pubnick $1} $2}"; + ctcp_ping_reply = "{ctcp PING {pubnick $0} $1-}"; + ctcp_requested = "{rctcp {pubnick $0} $2}"; + ctcp_requested_unknown = "{rctcp {pubnick $0} $2}"; online = "Users online: {hilight $0}"; pong = "PONG received from $0: $1"; wallops = "{wallop WALLOP {wallop_nick $0}} $1"; @@ -603,7 +594,7 @@ formats = { own_dcc = "{dccownmsg dcc {dccownnick $1}}$2"; own_dcc_action = "{dccownaction_target $0 $1}$2"; own_dcc_action_query = "{dccownaction $0}$2"; - own_dcc_ctcp = "{ownctcp ctcp $0}$1 $2"; + own_dcc_ctcp = "{ownctcp $0 $1}"; dcc_msg = "{dccmsg dcc $0}$1"; action_dcc = "{dccaction $0}$1"; action_dcc_query = "{dccaction $0}$1"; @@ -730,4 +721,22 @@ formats = { welcome_firsttime = "- - - - - - - - - - - - - - - - - - - - - - - - - - - -\012Hi there! If this is your first time using Irssi, you%:might want to go to our website and read the startup%:documentation to get you going.%:%:Our community and staff are available to assist you or%:to answer any questions you may have.%:%:Use the /HELP command to get detailed information about%:the available commands.%:%:For Debian specific help type \"/connect OFTC\" and%:\"/join #debian\" (without the quotes) and ask your%:question.%:- - - - - - - - - - - - - - - - - - - - - - - - - - - -"; welcome_init_settings = "The following settings were initialized"; }; + "Irssi::Script::ctcpspoof" = { + fctcp_request = "{rctcp {pubnick $0} $1}"; + fctcp_info = " # ctcpitem ctcpreply"; + fctcp_empty = "%R>>%n %_FCTCP:%_ Your fake ctcp list is empty."; + fctcp_added = "%R>>%n %_FCTCP:%_ Added %_$0%_ ($1) to the fake ctcp list."; + fctcp_replaced = "%R>>%n %_FCTCP:%_ Replaced the old fake reply %_$0%_ with the new one ($1)"; + fctcp_delled = "%R>>%n %_FCTCP:%_ Deleted %_$0%_ from the fake ctcp list."; + fctcp_nfound = "%R>>%n %_FCTCP:%_ Can't find $0 in the fake ctcp list."; + fctcp_delusage = "%R>>%n %_FCTCP:%_ Usage: /FCTCP -del <ctcp-item>"; + fctcp_usage = "%R>>%n %_FCTCP:%_ Usage: /FCTCP -add <ctcp-item> <ctcp-reply>"; + fctcp_repusage = "%R>>%n %_FCTCP:%_ Usage: /FCTCP -replace <ctcp-item> <ctcp-reply>"; + fctcp_nload = "%R>>%n %_FCTCP:%_ Could not load the fake ctcp list."; + fctcp_loaded = "%R>>%n %_FCTCP:%_ The fake reply %_$0%_ already exists, use %_/FCTCP -del $0%_ to remove it from the list."; + fctcp_print = "$[!-2]0 $[20]1 $2"; + fctcp_help = "$0"; + loaded = "%R>>%n %_Scriptinfo:%_ Loaded $0 version $1 by $2."; + }; + "Irssi::Script::tmux_away" = { tmux_away_crap = "$0"; }; }; diff --git a/.config/irssi/saved_nick_colors b/.config/irssi/saved_nick_colors @@ -1,256 +0,0 @@ -[session] -/Absalom:0D -/AlexCato_:3C -/Anzrael:0D -/Aph3x:32 -/Arbiter:05 -/Beta_:0D -/Bethany:42 -/Blanker:32 -/Bollox:0B -/CannaCo:5E -/ChanServ:3C -/Chandra:01 -/Code_Red:06 -/CrashTM:3C -/Cyrus:05 -/DTales:3C -/Derecho:03 -/Diannao:09 -/Digerati:01 -/Dragon:01 -/ElectRo`:06 -/Enui:04 -/EvilB:06 -/Ferris:05 -/Finger:01 -/Fishmongering:05 -/HamAdams:0C -/HashNuke:3C -/Hz0:32 -/Ice_Dragon:5E -/Impulsif:5E -/Jimster480-W10:06 -/Jokkelol:3C -/Jordan:0B -/JoseAlPaca:0D -/Justin_T:0D -/Kemwer:3H -/Ketchup901:3H -/Khaotic:0A -/Latschenharry:04 -/Liothen:32 -/LoKii:3H -/Mantis:0B -/MrRandom:42 -/MuNk:01 -/MusicKing:42 -/NeX-:05 -/Nebula_AI:0D -/Nilgeist:0D -/NiniGeo2:32 -/Oblivion:0A -/Omelette:5E -/OverMind:05 -/OzRat:32 -/Patch:3C -/Pillus:3H -/Pixi:06 -/Randy:3C -/Requit:05 -/Robby:0D -/RobotoneX:32 -/SDr:3A -/Scub:3C -/Seirdy:0B -/Shawn:0C -/SillyGoose:09 -/SpiredMoth:3A -/StormofBytes:42 -/Tempest:3H -/TheSashmo2:3C -/UniquelyGeneric:01 -/Virtual:42 -/Xafloc:0A -/Yeji:3C -/Zed:09 -/Zork:0B -/[R]:04 -/_0x5fc3:5E -/_kylef:04 -/_willo_:0C -/aj:3H -/aldcor:32 -haydenvh/#hlircnet/alice:4N -hlircnet/#GNU/matrix/alice:06 -hlircnet/#haydenvh.com/alice:05 -hlircnet/#hlircnet/alice:06 -hlircnet/#oscss/alice:5E -/allant4:01 -/amoe:0B -/anon__:05 -/ario:04 -/asuka:06 -/aunickuser:5E -/b0x:5E -/bacterio:5E -/bakedpotato:32 -/bamdad:0C -/bendoin:06 -/benharri:32 -/bertiger:3H -/blackest_mamba:05 -/blackntan:3A -/brandfilt:3H -/bryno:04 -/bs719:0C -/caffeinatedcode:3A -/chanhold:0D -/chelmzy:3H -/chik:3H -/chromis:05 -/ciprian_:5E -/cmccabe:3H -/constructed:0C -/crns:42 -/ct16k:3A -/cup:05 -/dab21:42 -/dan:0D -/dayid:09 -/delisa:09 -/dijit:4N -/drelcott:05 -/dv:06 -/elwisp:3C -/exusser:5E -/f3bruary:32 -/fbs:42 -/fckd:09 -/feelingsreal:0A -/fiftysixer:0A -/filostyktos:01 -/flgr:04 -/freebsd.oscss.eu:3A -/garandil:5E -/garret:42 -/goliath:3H -/goog:01 -/gophbot:0A -/greghume:01 -/haiku:3A -darkscience/#darkscience/haydenh:01 -darkscience/#testing/haydenh:01 -efnet/#oscss.eu/haydenh:01 -hlircnet/#GNU/matrix/haydenh:3A -hlircnet/#bots/haydenh:3H -hlircnet/#games/haydenh:0A -hlircnet/#gopher/haydenh:01 -hlircnet/#haydenvh.com/haydenh:5E -hlircnet/#help/haydenh:01 -hlircnet/#hlircnet/haydenh:01 -hlircnet/#marvvin/haydenh:01 -hlircnet/#new/haydenh:02 -hlircnet/#opers/haydenh:01 -hlircnet/#oscss/haydenh:32 -hlircnet/#oscss.eu/haydenh:06 -hlircnet/#test/haydenh:09 -hlircnet/#testing/haydenh:01 -hlircnet/#vhosts/haydenh:3A -hlircnet/#voidlinux/haydenh:3C -/haydenhb1:3C -/heartofrevel:3A -/hello-world:09 -/hiro:5E -/hoek:3A -/hoho:06 -/hugo:09 -/huyens:32 -/hyb:3C -/hyiltiz:06 -/infy:0C -/irc-us.oscss.eu:3C -/irc.haydenvh.com:42 -/irc.oscss.eu:04 -/j0sh:05 -/james:0C -/joes:04 -/johnhamelink:0C -/jrwr:42 -/jvoisin:5E -/kd:3A -/kilroy:05 -/kolobyte:3A -/kylef:0A -/lagzilla:42 -/lawnchair:0A -/lead_pipe23:3A -/lennox:09 -/lowkey:05 -/m1sdirection:5E -/malcom2073:06 -haydenvh/#hlircnet/marvvin:04 -hlircnet/#GNU/matrix/marvvin:05 -hlircnet/#bots/marvvin:05 -hlircnet/#haydenvh.com/marvvin:04 -hlircnet/#hlircnet/marvvin:05 -/mdashx:04 -/mohnish:42 -/mohnish_:5E -/mrnicke:09 -/mruno:3A -haydenvh/#hlircnet/mys:0D -hlircnet/#GNU/matrix/mys:01 -hlircnet/#hlircnet/mys:06 -/naitootat:01 -/neilalexander:5E -/nero:02 -/nesoi:42 -/nin:3C -/nirojan:01 -/njsg:03 -/obviyus:04 -/p80info:0C -/phlud:05 -/pigeons:09 -/plow:42 -/privbot:09 -/psycho:3C -/qy:32 -/r2d2:5E -/robrand:0A -/root:01 -/saba:42 -/shuckks:06 -/slackfam:09 -/smolder:0A -/snazo:04 -/snk:04 -/southey:3A -/ssd532_:42 -/steev:09 -/stid3r:09 -/sun-lightt:0C -/superalpine:3C -/synbiose:0A -/systwi_:3H -/tempette:05 -/test:4N -/themask:32 -/trans:42 -/trip:0A -/trper:0C -/waveframe:05 -/wayne:32 -/weather:0C -/weekend:04 -/wfnintr:0B -/whoami:3C -/xLink:42 -/xadammr:3H -/xeeder:3A -/yakamo:3A -/zelest:0D -/zer0rest:0B -/zeta:0A -/zgrep:3A diff --git a/.config/irssi/scripts/README b/.config/irssi/scripts/README @@ -0,0 +1 @@ +autorun/README +\ No newline at end of file diff --git a/.config/irssi/scripts/adv_windowlist.pl b/.config/irssi/scripts/adv_windowlist.pl @@ -0,0 +1 @@ +autorun/adv_windowlist.pl +\ No newline at end of file diff --git a/.config/irssi/scripts/ascii.pl b/.config/irssi/scripts/ascii.pl @@ -0,0 +1 @@ +autorun/ascii.pl +\ No newline at end of file diff --git a/.config/irssi/scripts/autonickprefix.pl b/.config/irssi/scripts/autonickprefix.pl @@ -0,0 +1 @@ +autorun/autonickprefix.pl +\ No newline at end of file diff --git a/.config/irssi/scripts/autorun/auto_whois.pl b/.config/irssi/scripts/autorun/auto_whois.pl @@ -1,80 +0,0 @@ -# /WHOIS all the users who send you a private message. -# v0.9 for irssi by Andreas 'ads' Scherbaum -# idea and some code taken from autowhois.pl from Timo Sirainen -use strict; -use Irssi; -use vars qw($VERSION %IRSSI); - -$VERSION = "0.9"; -%IRSSI = ( - authors => "Andreas \'ads\' Scherbaum", - contact => "ads\@ufp.de", - name => "auto_whois", - description => "/WHOIS all the users who send you a private message.", - license => "GPL", - url => "http://irssi.org/", - changed => "2004-02-10", - changes => "v0.9: don't /WHOIS if query exists for the nick already" -); - -# History: -# v0.9: don't /WHOIS if query exists for the nick already -# now we store all nicks we have seen in the last 10 minutes - -my @seen = (); - -sub msg_private_first { - my ($server, $msg, $nick, $address) = @_; - - # go through every stored connection and remove, if timed out - my $time = time(); - my ($connection); - my @new = (); - foreach $connection (@seen) { - if ($connection->{lasttime} >= $time - 600) { - # is ok, use it - push(@new, $connection); - # all timed out connections will be dropped - } - } - @seen = @new; -} - -sub msg_private { - my ($server, $msg, $nick, $address) = @_; - - # look, if we already know this connection - my ($connection, $a); - my $known_to_us = 0; - for ($a = 0; $a <= $#seen; $a++) { - $connection = $seen[$a]; - # the lc() works not exact, because irc uses another charset - if ($connection->{server} eq $server->{address} and $connection->{port} eq $server->{port} and lc($connection->{nick}) eq lc($nick)) { - $known_to_us = 1; - # mark as refreshed - $seen[$a]->{lasttime} = time(); - last; - } - } - - if ($known_to_us == 1) { - # all ok, return - return; - } - - # now store the new connection - $connection = {}; - # store our own server data here - $connection->{server} = $server->{address}; - $connection->{port} = $server->{port}; - # and the nick who queried us - $connection->{nick} = $nick; - $connection->{lasttime} = time(); - $connection->{starttime} = time(); - push(@seen, $connection); - - $server->command("whois $nick"); -} - -Irssi::signal_add_first('message private', 'msg_private_first'); -Irssi::signal_add('message private', 'msg_private'); diff --git a/.config/irssi/scripts/autorun/autonickprefix.pl b/.config/irssi/scripts/autorun/autonickprefix.pl @@ -0,0 +1,39 @@ +use strict; + +our $VERSION = '1.00'; +our %IRSSI = ( + authors => 'Juerd', + contact => '#####@juerd.nl', + name => 'autonickprefix', + description => "Change 'nick: ' prefix if the nick is changed while you're still editing.", + license => 'Any OSI', +); + +use Irssi::TextUI; +use Irssi qw( + signal_add active_win settings_get_str parse_special + gui_input_get_pos gui_input_set gui_input_set_pos +); + +signal_add 'nicklist changed' => sub { + my ($chan, $newnick, $oldnick) = @_; + $newnick = $newnick->{nick}; + + # Ignore other channels than current + my $viewing = active_win->{active} or return; + $viewing->{_irssi} == $chan->{_irssi} or return; + + my $char = settings_get_str 'completion_char'; + my $pos = gui_input_get_pos; + + # Incomplete nick could be something else. + $pos >= length("$oldnick$char") or return; + + my $delta = length($newnick) - length($oldnick); + + my $input = parse_special '$L'; + $input =~ s/^\Q$oldnick$char/$newnick$char/ or return; + + gui_input_set $input; + gui_input_set_pos $pos + $delta; +}; diff --git a/.config/irssi/scripts/autorun/dispatch.pl b/.config/irssi/scripts/autorun/dispatch.pl @@ -1,26 +0,0 @@ -use strict; -use warnings; -use Irssi; -use Irssi::Irc; -use vars qw($VERSION %IRSSI); - -$VERSION = "0.0.2"; -%IRSSI = ( - authors => "Sebastian 'yath' Schmidt", - contact => "yathen\@web.de", - name => "Command dispatcher", - description => "This scripts sends unknown commands to the server", - license => "GNU GPLv2", - changed => "Tue Mar 5 14:55:29 CET 2002", -); - -sub event_default_command { - my ($command, $server) = @_; - return if (Irssi::settings_get_bool("dispatch_unknown_commands") == 0 - || !$server); - $server->send_raw($command); - Irssi::signal_stop(); -} - -Irssi::settings_add_bool("misc", "dispatch_unknown_commands", 1); -Irssi::signal_add_first("default command", "event_default_command"); diff --git a/.config/irssi/scripts/autorun/go.pl b/.config/irssi/scripts/autorun/go.pl @@ -1,115 +0,0 @@ -use strict; -use vars qw($VERSION %IRSSI); -use Irssi; -use Irssi::Irc; - -# Usage: -# /script load go.pl -# If you are in #irssi you can type /go #irssi or /go irssi or even /go ir ... -# also try /go ir<tab> and /go <tab> (that's two spaces) -# -# The following settings exist: -# -# /SET go_match_case_sensitive [ON|OFF] -# Match window/item names sensitively (the default). Turning this off -# means e.g. "/go foo" would jump to a window named "Foobar", too. -# -# /SET go_match_anchored [ON|OFF] -# Match window/names only at the start of the word (the default). Turning -# this off will mean that strings can match anywhere in the window/names. -# The leading '#' of channel names is optional either way. -# -# /SET go_complete_case_sensitive [ON|OFF] -# When using tab-completion, match case-insensitively (the default). -# Turning this on means that "/go foo<tab>" will *not* suggest "Foobar". -# -# /SET go_complete_anchored [ON|OFF] -# Match window/names only at the start of the word. The default is 'off', -# which causes completion to match anywhere in the window/names during -# completion. The leading '#' of channel names is optional either way. -# - -$VERSION = '1.1.1'; - -%IRSSI = ( - authors => 'nohar', - contact => 'nohar@freenode', - name => 'go to window', - description => 'Implements /go command that activates a window given a name/partial name. It features a nice completion.', - license => 'GPLv2 or later', - changed => '2019-02-25' -); - -sub _make_regexp { - my ($name, $ci, $aw) = @_; - my $re = "\Q${name}\E"; - $re = "(?i:$re)" unless $ci; - $re = "^#?$re" if $aw; - return $re; -} - -sub signal_complete_go { - my ($complist, $window, $word, $linestart, $want_space) = @_; - my $channel = $window->get_active_name(); - my $k = Irssi::parse_special('$k'); - - return unless ($linestart =~ /^\Q${k}\Ego\b/i); - - my $re = _make_regexp($word, - Irssi::settings_get_bool('go_complete_case_sensitive'), - Irssi::settings_get_bool('go_complete_anchored')); - @$complist = (); - foreach my $w (Irssi::windows) { - my $name = $w->get_active_name(); - if ($word ne "") { - if ($name =~ $re) { - push(@$complist, $name) - } - } else { - push(@$complist, $name); - } - } - Irssi::signal_stop(); -}; - -sub cmd_go -{ - my($chan,$server,$witem) = @_; - - my $case_sensitive = Irssi::settings_get_bool('go_match_case_sensitive'); - my $match_anchored = Irssi::settings_get_bool('go_match_anchored'); - - $chan =~ s/ *//g; - my $re = _make_regexp($chan, $case_sensitive, $match_anchored); - - my @matches; - foreach my $w (Irssi::windows) { - my $name = $w->get_active_name(); - if (($case_sensitive && $name eq $chan) || - (!$case_sensitive && CORE::fc $name eq CORE::fc $chan)) { - $w->set_active(); - return; - } elsif ($name =~ /$re/) { - push(@matches, $w); - } - } - if (@matches) { - $matches[0]->set_active(); - } -} - -Irssi::command_bind("go", "cmd_go"); -Irssi::signal_add_first('complete word', 'signal_complete_go'); -Irssi::settings_add_bool('go', 'go_match_case_sensitive', 1); -Irssi::settings_add_bool('go', 'go_complete_case_sensitive', 0); -Irssi::settings_add_bool('go', 'go_match_anchored', 1); -Irssi::settings_add_bool('go', 'go_complete_anchored', 0); - -# Changelog -# -# 2017-02-02 1.1 martin f. krafft <madduck@madduck.net> -# - made case-sensitivity of match configurable -# - made anchoring of search strings configurable -# -# 2019-02-025 1.1.1 dylan lloyd <dylan@disinclined.org> -# - prefer exact channel matches diff --git a/.config/irssi/scripts/autorun/irssi-alert.pl b/.config/irssi/scripts/autorun/irssi-alert.pl @@ -1,35 +0,0 @@ -# irssi-alert.pl -use Irssi; - -# config -my $own_nick = 'haydenh'; -my $channel = '#GNU/matrix'; - -$::VERSION='1'; -%::IRSSI = ( - authors => 'haydenh', - contact => 'haydenh@AT@sdf.DOT.org', - name => 'irssi-alert', - description => 'Send the \a escape code on a message containing a certain - string, in a private message, or a specified channel', - license => 'MIT', -); - -sub priv { - system("echo -n '\a'"); -} - -sub pub { - my ($server, $msg, $nick, $address, $target) = @_; - - if ($msg =~ $own_nick) { - system("echo -n '\a'"); - } else { - if ($target =~ $channel) { - system("echo -n '\a'"); - } - } -} - -Irssi::signal_add('message public', 'pub'); -Irssi::signal_add('message private', 'priv'); diff --git a/.config/irssi/scripts/autorun/tmux_away.pl b/.config/irssi/scripts/autorun/tmux_away.pl @@ -0,0 +1,202 @@ +use Irssi; +use strict; +use FileHandle; + +use vars qw($VERSION %IRSSI); + +$VERSION = "2.1"; # e8934ed1ce04461 +%IRSSI = ( + authors => 'cdidier', + name => 'tmux_away', + description => 'set (un)away if tmux session is attached/detached', + license => 'GPL v2', + url => 'http://cybione.org', +); + +# tmux_away irssi module +# +# Written by Colin Didier <cdidier@cybione.org> and heavily based on +# screen_away irssi module version 0.9.7.1 written by Andreas 'ads' Scherbaum +# <ads@ufp.de>. +# +# Updated by John C. Vernaleo <john@netpurgatory.com> to handle tmux with +# named sessions and other code cleanup and forked as version 2.0. +# +# usage: +# +# put this script into your autorun directory and/or load it with +# /SCRIPT LOAD <name> +# +# there are 5 settings available: +# +# /set tmux_away_active ON/OFF/TOGGLE +# /set tmux_away_repeat <integer> +# /set tmux_away_grace <integer> +# /set tmux_away_message <string> +# /set tmux_away_window <string> +# /set tmux_away_nick <string> +# +# active means that you will be only set away/unaway, if this +# flag is set, default is ON +# repeat is the number of seconds, after the script will check the +# tmux session status again, default is 5 seconds +# grace is the number of seconds, to wait additionally, before +# setting you away, default is disabled (0) +# message is the away message sent to the server, default: not here ... +# window is a window number or name, if set, the script will switch +# to this window, if it sets you away, default is '1' +# nick is the new nick, if the script goes away +# will only be used it not empty + + +# variables +my $timer_name = undef; +my $away_status = 0; +my %old_nicks = (); +my %away = (); + +# Register formats +Irssi::theme_register( +[ + 'tmux_away_crap', + '{line_start}{hilight ' . $IRSSI{'name'} . ':} $0' +]); + +# try to find out if we are running in a tmux session +# (see if $ENV{TMUX} is set) +if (!defined($ENV{TMUX})) { + # just return, we will never be called again + Irssi::printformat(MSGLEVEL_CLIENTCRAP, 'tmux_away_crap', + "no tmux session!"); + return; +} + +my @args_env = split(',', $ENV{TMUX}); +my $tmux_socket = $args_env[0]; + +# register config variables +Irssi::settings_add_bool('misc', $IRSSI{'name'} . '_active', 1); +Irssi::settings_add_int('misc', $IRSSI{'name'} . '_repeat', 5); +Irssi::settings_add_int('misc', $IRSSI{'name'} . '_grace', 0); +Irssi::settings_add_str('misc', $IRSSI{'name'} . '_message', "not here..."); +Irssi::settings_add_str('misc', $IRSSI{'name'} . '_window', "1"); +Irssi::settings_add_str('misc', $IRSSI{'name'} . '_nick', ""); + + +# check, set or reset the away status +sub tmux_away { + my ($immediate) = @_; + my ($status, @res); + + # only run, if activated + if (Irssi::settings_get_bool($IRSSI{'name'} . '_active') != 1) { + $away_status = 0; + } else { + if ($away_status == 0) { + # display init message at first time + my $grace = Irssi::settings_get_int($IRSSI{'name'} . '_grace'); + $grace = ", $grace seconds grace" if $grace; + Irssi::printformat(MSGLEVEL_CLIENTCRAP, 'tmux_away_crap', + "activating $IRSSI{'name'} (interval: " . Irssi::settings_get_int($IRSSI{'name'} . '_repeat') . " seconds$grace)"); + $away_status = 2; + } + + # get actual tmux session status + chomp(@res = `tmux -S '$tmux_socket' lsc 2>&1`); + chomp(my $tmux_session = `tmux -S '$tmux_socket' display -p '#S' 2>/dev/null`); + if ($res[0] =~ /^server not found/ || $? >> 8) { + die "error getting tmux session status."; + } + $status = 1; # away, assumes the session is detached + foreach (@res) { + my @args_st = split(' '); + if ($args_st[1] eq $tmux_session) { + $status = 2; # unaway + } + } + + # unaway -> away + if ($status == 1 and $away_status != 1) { + if (my $grace = Irssi::settings_get_int($IRSSI{'name'} . '_grace')) { + if (!$immediate) { + Irssi::timeout_add_once($grace * 1000, 'tmux_away', '1'); + Irssi::printformat(MSGLEVEL_CLIENTCRAP, 'tmux_away_crap', + "(in grace for away: $grace seconds)"); + return 1; + } + } + if (length(Irssi::settings_get_str($IRSSI{'name'} . '_window')) > 0) { + # if length of window is greater then 0, make this window active + Irssi::command('window goto ' . Irssi::settings_get_str($IRSSI{'name'} . '_window')); + } + Irssi::printformat(MSGLEVEL_CLIENTCRAP, 'tmux_away_crap', "Set away"); + my $message = Irssi::settings_get_str($IRSSI{'name'} . '_message'); + if (length($message) == 0) { + # we have to set a message or we wouldnt go away + $message = "not here ..."; + } + foreach (Irssi::servers()) { + if (!$_->{usermode_away}) { + # user isn't yet away + $away{$_->{'tag'}} = 0; + $_->command("^AWAY " . ($_->{chat_type} ne 'SILC' ? "-one " : "") . "$message"); + if ($_->{chat_type} ne 'XMPP' and length(Irssi::settings_get_str($IRSSI{'name'} . '_nick')) > 0) { + # only change if actual nick isn't already the away nick + if (Irssi::settings_get_str($IRSSI{'name'} . '_nick') ne $_->{nick}) { + # keep old nick + $old_nicks{$_->{'tag'}} = $_->{nick}; + # set new nick + $_->command("NICK " . Irssi::settings_get_str($IRSSI{'name'} . '_nick')); + } + } + } else { + # user is already away, remember this + $away{$_->{'tag'}} = 1; + } + } + $away_status = $status; + + # away -> unaway + } elsif ($status == 2 and $away_status != 2) { + if (my $grace = Irssi::settings_get_int($IRSSI{'name'} . '_grace')) { + if (!$immediate) { + Irssi::timeout_add_once($grace * 1000, 'tmux_away', '1'); + Irssi::printformat(MSGLEVEL_CLIENTCRAP, 'tmux_away_crap', + "(in grace for unaway: $grace seconds)"); + return 1; + } + } + # unset away + Irssi::printformat(MSGLEVEL_CLIENTCRAP, 'tmux_away_crap', "Reset away"); + foreach (Irssi::servers()) { + if ($away{$_->{'tag'}} == 1) { + # user was already away, don't reset away + $away{$_->{'tag'}} = 0; + next; + } + $_->command("^AWAY" . (($_->{chat_type} ne 'SILC') ? " -one" : "")) if ($_->{usermode_away}); + if ($_->{chat_type} ne 'XMPP' and defined($old_nicks{$_->{'tag'}}) and length($old_nicks{$_->{'tag'}}) > 0) { + # set old nick + $_->command("NICK " . $old_nicks{$_->{'tag'}}); + $old_nicks{$_->{'tag'}} = ""; + } + } + $away_status = $status; + } elsif ($immediate) { + Irssi::printformat(MSGLEVEL_CLIENTCRAP, 'tmux_away_crap', + "in grace aborted"); + } + } + # but everytimes install a new timer + register_tmux_away_timer(); + return 0; +} + +# remove old timer and install a new one +sub register_tmux_away_timer { + # add new timer with new timeout (maybe the timeout has been changed) + Irssi::timeout_add_once(Irssi::settings_get_int($IRSSI{'name'} . '_repeat') * 1000, 'tmux_away', ''); +} + +# init process +tmux_away(); diff --git a/.config/irssi/scripts/autorun/trackbar.pl b/.config/irssi/scripts/autorun/trackbar.pl @@ -0,0 +1,606 @@ +## trackbar.pl +# +# This little script will do just one thing: it will draw a line each time you +# switch away from a window. This way, you always know just upto where you've +# been reading that window :) It also removes the previous drawn line, so you +# don't see double lines. +# +# redraw trackbar only works on irssi 0.8.17 or higher. +# +## + +## Usage: +# +# The script works right out of the box, but if you want you can change +# the working by /set'ing the following variables: +# +# Setting: trackbar_style +# Description: This setting will be the color of your trackbar line. +# By default the value will be '%K', only Irssi color +# formats are allowed. If you don't know the color formats +# by heart, you can take a look at the formats documentation. +# You will find the proper docs on http://www.irssi.org/docs. +# +# Setting: trackbar_string +# Description: This is the string that your line will display. This can +# be multiple characters or just one. For example: '~-~-' +# The default setting is '-'. +# Here are some unicode characters you can try: +# "───" => U+2500 => a line +# "═══" => U+2550 => a double line +# "━━━" => U+2501 => a wide line +# "▭ " => U+25ad => a white rectangle +# +# Setting: trackbar_use_status_window +# Description: If this setting is set to OFF, Irssi won't print a trackbar +# in the statuswindow +# +# Setting: trackbar_ignore_windows +# Description: A list of windows where no trackbar should be printed +# +# Setting: trackbar_print_timestamp +# Description: If this setting is set to ON, Irssi will print the formatted +# timestamp in front of the trackbar. +# +# Setting: trackbar_require_seen +# Description: Only clear the trackbar if it has been scrolled to. +# +# Setting: trackbar_all_manual +# Description: Never clear the trackbar until you do /mark. +# +# /mark is a command that will redraw the line at the bottom. +# +# Command: /trackbar, /trackbar goto +# Description: Jump to where the trackbar is, to pick up reading +# +# Command: /trackbar keep +# Description: Keep this window's trackbar where it is the next time +# you switch windows (then this flag is cleared again) +# +# Command: /mark, /trackbar mark +# Description: Remove the old trackbar and mark the bottom of this +# window with a new trackbar +# +# Command: /trackbar markvisible +# Description: Like mark for all visible windows +# +# Command: /trackbar markall +# Description: Like mark for all windows +# +# Command: /trackbar remove +# Description: Remove this window's trackbar +# +# Command: /trackbar removeall +# Description: Remove all windows' trackbars +# +# Command: /trackbar redraw +# Description: Force redraw of trackbars +# +## + +## +# +# For bugreports and other improvements contact one of the authors. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this script; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +## + +use strict; +use warnings; +use vars qw($VERSION %IRSSI); + +$VERSION = "2.9"; # a4c78e85092a271 + +%IRSSI = ( + authors => "Peter 'kinlo' Leurs, Uwe Dudenhoeffer, " . + "Michiel Holtkamp, Nico R. Wohlgemuth, " . + "Geert Hauwaerts", + contact => 'peter@pfoe.be', + patchers => 'Johan Kiviniemi (UTF-8), Uwe Dudenhoeffer (on-upgrade-remove-line)', + name => 'trackbar', + description => 'Shows a bar where you have last read a window.', + license => 'GNU General Public License', + url => 'http://www.pfoe.be/~peter/trackbar/', + commands => 'trackbar', +); + +## Comments and remarks. +# +# This script uses settings. +# Use /SET to change the value or /TOGGLE to switch it on or off. +# +# +# Tip: The command 'trackbar' is very useful if you bind that to a key, +# so you can easily jump to the trackbar. Please see 'help bind' for +# more information about keybindings in Irssi. +# +# Command: /BIND meta2-P key F1 +# /BIND F1 command trackbar +# +## + +## Bugfixes and new items in this rewrite. +# +# * Remove all the trackbars before upgrading. +# * New setting trackbar_use_status_window to control the statuswindow trackbar. +# * New setting trackbar_print_timestamp to print a timestamp or not. +# * New command 'trackbar' to scroll up to the trackbar. +# * When resizing your terminal, Irssi will update all the trackbars to the new size. +# * When changing trackbar settings, change all the trackbars to the new settings. +# * New command 'trackbar mark' to draw a new trackbar (The old '/mark'). +# * New command 'trackbar markall' to draw a new trackbar in each window. +# * New command 'trackbar remove' to remove the trackbar from the current window. +# * New command 'trackbar removeall' to remove all the trackbars. +# * Don't draw a trackbar in empty windows. +# * Added a version check to prevent Irssi redraw errors. +# * Fixed a bookmark NULL versus 0 bug. +# * Fixed a remove-line bug in Uwe Dudenhoeffer his patch. +# * New command 'help trackbar' to display the trackbar commands. +# * Fixed an Irssi startup bug, now processing each auto-created window. +# +## + +## Known bugs and the todolist. +# +# Todo: * Instead of drawing a line, invert the line. +# +## + +## Authors: +# +# - Main maintainer & author: Peter 'kinlo' Leurs +# - Many thanks to Timo 'cras' Sirainen for placing me on my way +# - on-upgrade-remove-line patch by Uwe Dudenhoeffer +# - trackbar resizing by Michiel Holtkamp (02 Jul 2012) +# - scroll to trackbar, window excludes, and timestamp options by Nico R. +# Wohlgemuth (22 Sep 2012) +# +## + +## Version history: +# +# 2.9: - fix crash on /mark in empty window +# 2.8: - fix /^join bug +# 2.7: - add /set trackbar_all_manual option +# 2.5: - merge back on scripts.irssi.org +# - fix /trackbar redraw broken in 2.4 +# - fix legacy encodings +# - add workaround for irssi issue #271 +# 2.4: - add support for horizontal splits +# 2.3: - add some features for seen tracking using other scripts +# 2.0: - big rewrite based on 1.4 +# * removed /tb, you can have it with /alias tb trackbar if you want +# * subcommand and settings changes: +# /trackbar vmark => /trackbar markvisible +# /trackbar scroll => /trackbar goto (or just /trackbar) +# /trackbar help => /help trackbar +# /set trackbar_hide_windows => /set trackbar_ignore_windows +# /set trackbar_timestamp => /set trackbar_print_timestamp +# * magic line strings were removed, just paste the unicode you want! +# * trackbar_timestamp_styled is not currently supported +# 1.9: - add version guard +# 1.8: - sub draw_bar +# 1.7: - Added /tb scroll, trackbar_hide_windows, trackbar_timestamp_timestamp +# and trackbar_timestamp_styled +# 1.6: - Work around Irssi resize bug, please do /upgrade! (see below) +# 1.5: - Resize trackbars in all windows when terminal is resized +# 1.4: - Changed our's by my's so the irssi script header is valid +# - Removed utf-8 support. In theory, the script should work w/o any +# problems for utf-8, just set trackbar_string to a valid utf-8 character +# and everything *should* work. However, this script is being plagued by +# irssi internal bugs. The function Irssi::settings_get_str does NOT handle +# unicode strings properly, hence you will notice problems when setting the bar +# to a unicode char. For changing your bar to utf-8 symbols, read the line sub. +# 1.3: - Upgrade now removes the trackbars. +# - Some code cleanups, other defaults +# - /mark sets the line to the bottom +# 1.2: - Support for utf-8 +# - How the bar looks can now be configured with trackbar_string +# and trackbar_style +# 1.1: - Fixed bug when closing window +# 1.0: - Initial release +# +## + +use Irssi; +use Irssi::TextUI; +use Encode; + +use POSIX qw(strftime); + +sub cmd_help { + my ($args) = @_; + if ($args =~ /^trackbar *$/i) { + print CLIENTCRAP <<HELP +%9Syntax:%9 + +TRACKBAR +TRACKBAR GOTO +TRACKBAR KEEP +TRACKBAR MARK +TRACKBAR MARKVISIBLE +TRACKBAR MARKALL +TRACKBAR REMOVE +TRACKBAR REMOVEALL +TRACKBAR REDRAW + +%9Parameters:%9 + + GOTO: Jump to where the trackbar is, to pick up reading + KEEP: Keep this window's trackbar where it is the next time + you switch windows (then this flag is cleared again) + MARK: Remove the old trackbar and mark the bottom of this + window with a new trackbar + MARKVISIBLE: Like mark for all visible windows + MARKALL: Like mark for all windows + REMOVE: Remove this window's trackbar + REMOVEALL: Remove all windows' trackbars + REDRAW: Force redraw of trackbars + +%9Description:%9 + + Manage a trackbar. Without arguments, it will scroll up to the trackbar. + +%9Examples:%9 + + /TRACKBAR MARK + /TRACKBAR REMOVE +HELP + } +} + +Irssi::theme_register([ + 'trackbar_loaded', '%R>>%n %_Scriptinfo:%_ Loaded $0 version $1 by $2.', + 'trackbar_wrong_version', '%R>>%n %_Trackbar:%_ Please upgrade your client to 0.8.17 or above if you would like to use this feature of trackbar.', + 'trackbar_all_removed', '%R>>%n %_Trackbar:%_ All the trackbars have been removed.', + 'trackbar_not_found', '%R>>%n %_Trackbar:%_ No trackbar found in this window.', +]); + +my $old_irssi = Irssi::version < 20140701; +sub check_version { + if ($old_irssi) { + Irssi::printformat(MSGLEVEL_CLIENTCRAP, 'trackbar_wrong_version'); + return; + } else { + return 1; + } +} + +sub is_utf8 { + lc Irssi::settings_get_str('term_charset') eq 'utf-8' +} + +my (%config, %keep_trackbar, %unseen_trackbar); + +sub remove_one_trackbar { + my $win = shift; + my $view = shift || $win->view; + my $line = $view->get_bookmark('trackbar'); + if (defined $line) { + my $bottom = $view->{bottom}; + $view->remove_line($line); + $win->command('^scrollback end') if $bottom && !$win->view->{bottom}; + $view->redraw; + } +} + +sub add_one_trackbar_pt1 { + my $win = shift; + my $view = shift || $win->view; + + my $last_cur_line = ($view->{buffer}{cur_line}||+{})->{_irssi}; + $win->print(line($win->{width}), MSGLEVEL_NEVER); + + my $cur_line = ($win->view->{buffer}{cur_line}||+{})->{_irssi}; # get a fresh buffer + + ($last_cur_line//'') ne ($cur_line//'') # printing was successful +} + +sub add_one_trackbar_pt2 { + my $win = shift; + my $view = $win->view; + + $view->set_bookmark_bottom('trackbar'); + $unseen_trackbar{ $win->{_irssi} } = 1; + Irssi::signal_emit("window trackbar added", $win); + $view->redraw; +} + +sub update_one_trackbar { + my $win = shift; + my $view = shift || $win->view; + my $force = shift; + my $ignored = win_ignored($win, $view); + my $success; + + $success = add_one_trackbar_pt1($win, $view) ? 1 : 0 + if $force || !$ignored; + + remove_one_trackbar($win, $view) + if ( $success || !defined $success ) && ( $force || !defined $force || !$ignored ); + + add_one_trackbar_pt2($win) + if $success; +} + +sub win_ignored { + my $win = shift; + my $view = shift || $win->view; + return 1 unless $view->{buffer}{lines_count}; + return 1 if $win->{name} eq '(status)' && !$config{use_status_window}; + no warnings 'uninitialized'; + return 1 if grep { $win->{name} eq $_ || $win->{refnum} eq $_ + || $win->get_active_name eq $_ } @{ $config{ignore_windows} }; + return 0; +} + +sub sig_window_changed { + my ($newwindow, $oldwindow) = @_; + return unless $oldwindow; + redraw_one_trackbar($newwindow) unless $old_irssi; + trackbar_update_seen($newwindow); + return if delete $keep_trackbar{ $oldwindow->{_irssi} }; + trackbar_update_seen($oldwindow); + return if $config{require_seen} && $unseen_trackbar{ $oldwindow->{_irssi } }; + return if $config{all_manual}; + update_one_trackbar($oldwindow, undef, 0); +} + +sub trackbar_update_seen { + my $win = shift; + return unless $win; + return unless $unseen_trackbar{ $win->{_irssi} }; + + my $view = $win->view; + my $line = $view->get_bookmark('trackbar'); + unless ($line) { + delete $unseen_trackbar{ $win->{_irssi} }; + Irssi::signal_emit("window trackbar seen", $win); + return; + } + my $startline = $view->{startline}; + return unless $startline; + + if ($startline->{info}{time} < $line->{info}{time} + || $startline->{_irssi} == $line->{_irssi}) { + delete $unseen_trackbar{ $win->{_irssi} }; + Irssi::signal_emit("window trackbar seen", $win); + } +} + +sub screen_length; +{ local $@; + eval { require Text::CharWidth; }; + unless ($@) { + *screen_length = sub { Text::CharWidth::mbswidth($_[0]) }; + } + else { + *screen_length = sub { + my $temp = shift; + Encode::_utf8_on($temp) if is_utf8(); + length($temp) + }; + } +} + +{ my %strip_table = ( + (map { $_ => '' } (split //, '04261537' . 'kbgcrmyw' . 'KBGCRMYW' . 'U9_8I:|FnN>#[' . 'pP')), + (map { $_ => $_ } (split //, '{}%')), + ); + sub c_length { + my $o = Irssi::strip_codes($_[0]); + $o =~ s/(%(%|Z.{6}|z.{6}|X..|x..|.))/exists $strip_table{$2} ? $strip_table{$2} : + $2 =~ m{x(?:0[a-f]|[1-6][0-9a-z]|7[a-x])|z[0-9a-f]{6}}i ? '' : $1/gex; + screen_length($o) + } +} + +sub line { + my ($width, $time) = @_; + my $string = $config{string}; + $string = ' ' unless length $string; + $time ||= time; + + Encode::_utf8_on($string) if is_utf8(); + my $length = c_length($string); + + my $format = ''; + if ($config{print_timestamp}) { + $format = $config{timestamp_str}; + $format =~ y/%/\01/; + $format =~ s/\01\01/%/g; + $format = strftime($format, localtime $time); + $format =~ y/\01/%/; + } + + my $times = $width / $length; + $times += 1 if $times != int $times; + my $style = "$config{style}"; + Encode::_utf8_on($style) if is_utf8(); + $format .= $style; + $width -= c_length($format); + $string x= $times; + chop $string while length $string && c_length($string) > $width; + return $format . $string; +} + +sub remove_all_trackbars { + for my $window (Irssi::windows) { + next unless ref $window; + remove_one_trackbar($window); + } +} + +sub UNLOAD { + remove_all_trackbars(); +} + +sub redraw_one_trackbar { + my $win = shift; + my $view = $win->view; + my $line = $view->get_bookmark('trackbar'); + return unless $line; + my $bottom = $view->{bottom}; + $win->print_after($line, MSGLEVEL_NEVER, line($win->{width}, $line->{info}{time}), + $line->{info}{time}); + $view->set_bookmark('trackbar', $win->last_line_insert); + $view->remove_line($line); + $win->command('^scrollback end') if $bottom && !$win->view->{bottom}; + $view->redraw; +} + +sub redraw_trackbars { + return unless check_version(); + for my $win (Irssi::windows) { + next unless ref $win; + redraw_one_trackbar($win); + } +} + +sub goto_trackbar { + my $win = Irssi::active_win; + my $line = $win->view->get_bookmark('trackbar'); + + if ($line) { + $win->command("scrollback goto ". strftime("%d %H:%M:%S", localtime($line->{info}{time}))); + } else { + $win->printformat(MSGLEVEL_CLIENTCRAP, 'trackbar_not_found'); + } +} + +sub cmd_mark { + update_one_trackbar(Irssi::active_win, undef, 1); +} + +sub cmd_markall { + for my $window (Irssi::windows) { + next unless ref $window; + update_one_trackbar($window); + } +} + +sub signal_stop { + Irssi::signal_stop; +} + +sub cmd_markvisible { + my @wins = Irssi::windows; + my $awin = + my $bwin = Irssi::active_win; + my $awin_counter = 0; + Irssi::signal_add_priority('window changed' => 'signal_stop', -99); + do { + Irssi::active_win->command('window up'); + $awin = Irssi::active_win; + update_one_trackbar($awin); + ++$awin_counter; + } until ($awin->{refnum} == $bwin->{refnum} || $awin_counter >= @wins); + Irssi::signal_remove('window changed' => 'signal_stop'); +} + +sub cmd_trackbar_remove_one { + remove_one_trackbar(Irssi::active_win); +} + +sub cmd_remove_all_trackbars { + remove_all_trackbars(); + Irssi::printformat(MSGLEVEL_CLIENTCRAP, 'trackbar_all_removed'); +} + +sub cmd_keep_once { + $keep_trackbar{ Irssi::active_win->{_irssi} } = 1; +} + +sub trackbar_runsub { + my ($data, $server, $item) = @_; + $data =~ s/\s+$//g; + + if ($data) { + Irssi::command_runsub('trackbar', $data, $server, $item); + } else { + goto_trackbar(); + } +} + +sub update_config { + my $was_status_window = $config{use_status_window}; + $config{style} = Irssi::settings_get_str('trackbar_style'); + $config{string} = Irssi::settings_get_str('trackbar_string'); + $config{require_seen} = Irssi::settings_get_bool('trackbar_require_seen'); + $config{all_manual} = Irssi::settings_get_bool('trackbar_all_manual'); + $config{ignore_windows} = [ split /[,\s]+/, Irssi::settings_get_str('trackbar_ignore_windows') ]; + $config{use_status_window} = Irssi::settings_get_bool('trackbar_use_status_window'); + $config{print_timestamp} = Irssi::settings_get_bool('trackbar_print_timestamp'); + if (defined $was_status_window && $was_status_window != $config{use_status_window}) { + if (my $swin = Irssi::window_find_name('(status)')) { + if ($config{use_status_window}) { + update_one_trackbar($swin); + } + else { + remove_one_trackbar($swin); + } + } + } + if ($config{print_timestamp}) { + my $ts_format = Irssi::settings_get_str('timestamp_format'); + my $ts_theme = Irssi::current_theme->get_format('fe-common/core', 'timestamp'); + my $render_str = Irssi::current_theme->format_expand($ts_theme); + (my $ts_escaped = $ts_format) =~ s/([%\$])/$1$1/g; + $render_str =~ s/(?|\$(.)(?!\w)|\$\{(\w+)\})/$1 eq 'Z' ? $ts_escaped : $1/ge; + $config{timestamp_str} = $render_str; + } + redraw_trackbars() unless $old_irssi; +} + +Irssi::settings_add_str('trackbar', 'trackbar_string', is_utf8() ? "\x{2500}" : '-'); +Irssi::settings_add_str('trackbar', 'trackbar_style', '%K'); +Irssi::settings_add_str('trackbar', 'trackbar_ignore_windows', ''); +Irssi::settings_add_bool('trackbar', 'trackbar_use_status_window', 1); +Irssi::settings_add_bool('trackbar', 'trackbar_print_timestamp', 0); +Irssi::settings_add_bool('trackbar', 'trackbar_require_seen', 0); +Irssi::settings_add_bool('trackbar', 'trackbar_all_manual', 0); + +update_config(); + +Irssi::signal_add_last( 'mainwindow resized' => 'redraw_trackbars') + unless $old_irssi; + +Irssi::signal_register({'window trackbar added' => [qw/Irssi::UI::Window/]}); +Irssi::signal_register({'window trackbar seen' => [qw/Irssi::UI::Window/]}); +Irssi::signal_register({'gui page scrolled' => [qw/Irssi::UI::Window/]}); +Irssi::signal_add_last('gui page scrolled' => 'trackbar_update_seen'); + +Irssi::signal_add('setup changed' => 'update_config'); +Irssi::signal_add_priority('session save' => 'remove_all_trackbars', Irssi::SIGNAL_PRIORITY_HIGH-1); + +Irssi::signal_add('window changed' => 'sig_window_changed'); + +Irssi::command_bind('trackbar goto' => 'goto_trackbar'); +Irssi::command_bind('trackbar keep' => 'cmd_keep_once'); +Irssi::command_bind('trackbar mark' => 'cmd_mark'); +Irssi::command_bind('trackbar markvisible' => 'cmd_markvisible'); +Irssi::command_bind('trackbar markall' => 'cmd_markall'); +Irssi::command_bind('trackbar remove' => 'cmd_trackbar_remove_one'); +Irssi::command_bind('trackbar removeall' => 'cmd_remove_all_trackbars'); +Irssi::command_bind('trackbar redraw' => 'redraw_trackbars'); +Irssi::command_bind('trackbar' => 'trackbar_runsub'); +Irssi::command_bind('mark' => 'cmd_mark'); +Irssi::command_bind_last('help' => 'cmd_help'); + +Irssi::printformat(MSGLEVEL_CLIENTCRAP, 'trackbar_loaded', $IRSSI{name}, $VERSION, $IRSSI{authors}); + +# workaround for issue #271 +{ package Irssi::Nick } diff --git a/.config/irssi/scripts/autorun/trigger.pl b/.config/irssi/scripts/autorun/trigger.pl @@ -0,0 +1,1257 @@ +# trigger.pl - execute a command or replace text, triggered by an event in irssi +# Do /TRIGGER HELP or look at http://wouter.coekaerts.be/irssi/ for help + +# Copyright (C) 2002-2010 Wouter Coekaerts <wouter@coekaerts.be> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +use strict; +use Irssi 20020324 qw(command_bind command_runsub command signal_add_first signal_continue signal_stop signal_remove); +use Text::ParseWords; +use IO::File; +use vars qw($VERSION %IRSSI); + +$VERSION = '1.2.4'; +%IRSSI = ( + authors => 'Wouter Coekaerts', + contact => 'wouter@coekaerts.be', + name => 'trigger', + description => 'execute a command or replace text, triggered by an event in irssi', + license => 'GPLv2 or later', + url => 'http://wouter.coekaerts.be/irssi/', + changed => '2020-03-10', +); + +sub cmd_help { + Irssi::print (<<'SCRIPTHELP_EOF', MSGLEVEL_CLIENTCRAP); + +TRIGGER LIST +TRIGGER SAVE +TRIGGER RELOAD +TRIGGER MOVE <number> <number> +TRIGGER DELETE <number> +TRIGGER CHANGE <number> ... +TRIGGER ADD ... + +%U%_When to match%_%U +%UOn which types of event to trigger%U + These are simply specified by -name_of_the_type + The normal IRC event types are: + publics, %|privmsgs, (pub|priv)actions, (pub|priv)notices, (pub|priv)ctcps, (pub|priv)ctcpreplies, joins, parts, quits, kicks, topics, invites, nick_changes, dcc_msgs, dcc_actions, dcc_ctcps + mode_channel: %|a mode on the (whole) channel (like +t, +i, +b) + mode_nick: %|a mode on someone in the channel (like +o, +v) + -all is an alias for all of those. + Additionally, there is: + rawin: %|raw text incoming from the server + send_command: %|commands you give to irssi + send_text: %|lines you type that aren't commands + beep: %|when irssi beeps + notify_join: %|someone in you notify list comes online + notify_part: %|someone in your notify list goes offline + notify_away: %|someone in your notify list goes away + notify_unaway: %|someone in your notify list goes unaway + notify_unidle: %|someone in your notify list stops idling + (pub|priv)flood: %|flood in a channel or in private detected. See /set flood. Be careful, these flood signals can trigger many times for one flood (unless you have autoignore enabled) + +%UFilters (conditions) the event has to satisfy%U +They all take one parameter. If you can give a list, seperate elements by space and use quotes around the list. +All filters except for -pattern and -regexp can also be inversed by prefixing with -not_. + -pattern: %|The message must match the given pattern. ? and * can be used as wildcards + -regexp: %|The message must match the given regexp. (see man perlre) + %|if -nocase is given as an option, the regexp or pattern is matched case insensitive + -tags: %|The servertag must be in the given list of tags + -channels: %|The event must be in one of the given list of channels. + Examples: %|-channels '#chan1 #chan2' or -channels 'IRCNet/#channel' + %|-channels 'EFNet/' means every channel on EFNet and is the same as -tags 'EFNet' + -masks: %|The person who triggers it must match one of the given list of masks + -hasmode: %|The person who triggers it must have the give mode + Examples: %|'-o' means not opped, '+ov' means opped OR voiced, '-o&-v' means not opped AND not voiced + -hasflag: %|Only trigger if friends.pl (friends_shasta.pl) or people.pl is loaded and the person who triggers it has the given flag in the script (same syntax as -hasmode) + -other_masks + -other_hasmode + -other_hasflag: %|Same as above but for the victim for kicks or mode_nick. + +%U%_What to do when it matches%_%U + -command: Execute the given Irssi-command + %|You are able to use $1, $2 and so on generated by your regexp pattern. + %|For multiple commands ; can be used as seperator + %|The following variables are also expanded: + $T: %|Server tag + $C: %|Channel name + $O: %|Your nick + $N: %|Nickname of the person who triggered this command + $A: %|His address (foo@bar.com), + $I: %|His ident (foo) + $H: %|His hostname (bar.com) + $M: %|The complete message + ${other}: %|The victim for kicks or mode_nick + ${mode_type}: %|The type ('+' or '-') for a mode_channel or mode_nick + ${mode_char}: %|The mode char ('o' for ops, 'b' for ban,...) + ${mode_arg} : %|The argument to the mode (if there is one) + %|$\X, with X being one of the above expands (e.g. $\M), escapes all non-alphanumeric characters, so it can be used with /eval or /exec. Don't use /eval or /exec without this, it's not safe. + -replace: %|replaces the matching part with the given replacement in the event (requires a -regexp or -pattern) + -once: %|remove the trigger if it is triggered, so it only executes once and then is forgotten. + -stop: %|stops the signal. It won't get displayed by Irssi. Like /IGNORE + -debug: %|print some debugging info + -last: %|Don't process any more triggers for this message + +%U%_Other options%_%U + -disabled: %|Same as removing it, but keeps it in case you might need it later + -name: %|Give the trigger a name. You can refer to the trigger with this name in add/del/change commands + +%U%_Examples%_%U + Knockout people who do a !list: + %#/TRIGGER ADD %|-publics -channels "#channel1 #channel2" -nocase -regexp ^!list -command "KN $N This is not a warez channel!" + React to !echo commands from people who are +o in your friends-script: + %#/TRIGGER ADD %|-publics -regexp '^!echo (.*)' -hasflag '+o' -command 'say echo: $1' + Ignore all non-ops on #channel: + %#/TRIGGER ADD %|-publics -actions -channels "#channel" -hasmode '-o' -stop + Send a mail to yourself every time a topic is changed: + %#/TRIGGER ADD %|-topics -command 'exec echo $\N changed topic of $\C to: $\M | mail you@somewhere.com -s topic' + + +%U%_Examples with -replace%_%U + %|Replace every occurence of shit with sh*t, case insensitive: + %#/TRIGGER ADD %|-all -nocase -regexp shit -replace sh*t + %|Strip all colorcodes from *!lamer@*: + %#/TRIGGER ADD %|-all -masks *!lamer@* -regexp '\x03\d?\d?(,\d\d?)?|\x02|\x1f|\x16|\x06' -replace '' + %|Never let *!bot1@foo.bar or *!bot2@foo.bar hilight you + %|(this works by cutting your nick in 2 different parts, 'myn' and 'ick' here) + %|you don't need to understand the -replace argument, just trust that it works if the 2 parts separately don't hilight: + %#/TRIGGER ADD %|-all masks '*!bot1@foo.bar *!bot2@foo.bar' -regexp '(myn)(ick)' -nocase -replace '$1\x02\x02$2' + %|Avoid being hilighted by !top10 in eggdrops with stats.mod (but show your nick in bold): + %#/TRIGGER ADD %|-publics -regexp '(Top.0\(.*\): 1.*)(my)(nick)' -replace '$1\x02$2\x02\x02$3\x02' + %|Convert a Windows-1252 Euro to an ISO-8859-15 Euro (same effect as euro.pl): + %#/TRIGGER ADD %|-regexp '\x80' -replace '\xA4' + %|Show tabs as spaces, not the inverted I (same effect as tab_stop.pl): + %#/TRIGGER ADD %|-all -regexp '\t' -replace ' ' +SCRIPTHELP_EOF +} # / + +my @triggers; # array of all triggers +my %triggers_by_type; # hash mapping types on triggers of that type +my $recursion_depth = 0; +my $changed_since_last_save = 0; + +############### +### formats ### +############### + +Irssi::theme_register([ + 'trigger_header' => 'Triggers:', + 'trigger_line' => '%#$[-4]0 $1', + 'trigger_added' => 'Trigger $0 added: $1', + 'trigger_not_found' => 'Trigger {hilight $0} not found', + 'trigger_saved' => 'Triggers saved to $0', + 'trigger_loaded' => 'Triggers loaded from $0' +]); + +######################################### +### catch the signals & do your thing ### +######################################### + +# trigger types with a message and a channel +my @allchanmsg_types = qw(publics pubactions pubnotices pubctcps pubctcpreplies parts kicks topics); +# trigger types with a message +my @allmsg_types = (@allchanmsg_types, qw(privmsgs privactions privnotices privctcps privctcpreplies dcc_msgs dcc_actions dcc_ctcps quits)); +# trigger types with a channel +my @allchan_types = (@allchanmsg_types, qw(mode_channel mode_nick joins invites pubflood send_text)); +# trigger types in -all +my @all_types = (@allmsg_types, qw(mode_channel mode_nick joins invites nick_changes)); +# trigger types that can use -masks +my @mask_types = (@all_types, qw(notify_join notify_part notify_away notify_unaway notify_unidle)); +# trigger types with a server +my @all_server_types = (@mask_types, qw(rawin pubflood privflood)); +# all trigger types +my @trigger_types = (@all_server_types, qw(send_command send_text beep)); +#trigger types that are not in -all +#my @notall_types = grep {my $a=$_; return (!grep {$_ eq $a} @all_types);} @trigger_types; +my @notall_types = qw(rawin notify_join notify_part notify_away notify_unaway notify_unidle send_command send_text beep pubflood privflood); + +my @signals = ( +# "message public", SERVER_REC, char *msg, char *nick, char *address, char *target +{ + 'types' => ['publics'], + 'signal' => 'message public', + 'sub' => sub {check_signal_message(\@_,1,$_[0],$_[4],$_[2],$_[3],'publics');}, +}, +# "message private", SERVER_REC, char *msg, char *nick, char *address +{ + 'types' => ['privmsgs'], + 'signal' => 'message private', + 'sub' => sub {check_signal_message(\@_,1,$_[0],undef,$_[2],$_[3],'privmsgs');}, +}, +# "message irc action", SERVER_REC, char *msg, char *nick, char *address, char *target +{ + 'types' => ['privactions','pubactions'], + 'signal' => 'message irc action', + 'sub' => sub { + if ($_[4] eq $_[0]->{nick}) { + check_signal_message(\@_,1,$_[0],undef,$_[2],$_[3],'privactions'); + } else { + check_signal_message(\@_,1,$_[0],$_[4],$_[2],$_[3],'pubactions'); + } + }, +}, +# "message irc notice", SERVER_REC, char *msg, char *nick, char *address, char *target +{ + 'types' => ['privnotices','pubnotices'], + 'signal' => 'message irc notice', + 'sub' => sub { + if ($_[4] eq $_[0]->{nick}) { + check_signal_message(\@_,1,$_[0],undef,$_[2],$_[3],'privnotices'); + } else { + check_signal_message(\@_,1,$_[0],$_[4],$_[2],$_[3],'pubnotices'); + } + } +}, +# "message join", SERVER_REC, char *channel, char *nick, char *address +{ + 'types' => ['joins'], + 'signal' => 'message join', + 'sub' => sub {check_signal_message(\@_,-1,$_[0],$_[1],$_[2],$_[3],'joins');} +}, +# "message part", SERVER_REC, char *channel, char *nick, char *address, char *reason +{ + 'types' => ['parts'], + 'signal' => 'message part', + 'sub' => sub {check_signal_message(\@_,4,$_[0],$_[1],$_[2],$_[3],'parts');} +}, +# "message quit", SERVER_REC, char *nick, char *address, char *reason +{ + 'types' => ['quits'], + 'signal' => 'message quit', + 'sub' => sub {check_signal_message(\@_,3,$_[0],undef,$_[1],$_[2],'quits');} +}, +# "message kick", SERVER_REC, char *channel, char *nick, char *kicker, char *address, char *reason +{ + 'types' => ['kicks'], + 'signal' => 'message kick', + 'sub' => sub {check_signal_message(\@_,5,$_[0],$_[1],$_[3],$_[4],'kicks',{'other'=>$_[2]});} +}, +# "message topic", SERVER_REC, char *channel, char *topic, char *nick, char *address +{ + 'types' => ['topics'], + 'signal' => 'message topic', + 'sub' => sub {check_signal_message(\@_,2,$_[0],$_[1],$_[3],$_[4],'topics');} +}, +# "message invite", SERVER_REC, char *channel, char *nick, char *address +{ + 'types' => ['invites'], + 'signal' => 'message invite', + 'sub' => sub {check_signal_message(\@_,-1,$_[0],$_[1],$_[2],$_[3],'invites');} +}, +# "message nick", SERVER_REC, char *newnick, char *oldnick, char *address +{ + 'types' => ['nick_changes'], + 'signal' => 'message nick', + 'sub' => sub {check_signal_message(\@_,-1,$_[0],undef,$_[1],$_[3],'nick_changes',{'other'=>$_[2]});} +}, +# "message dcc", DCC_REC *dcc, char *msg +{ + 'types' => ['dcc_msgs'], + 'signal' => 'message dcc', + 'sub' => sub {check_signal_message(\@_,1,$_[0]->{'server'},undef,$_[0]->{'nick'},undef,'dcc_msgs'); + } +}, +# "message dcc action", DCC_REC *dcc, char *msg +{ + 'types' => ['dcc_actions'], + 'signal' => 'message dcc action', + 'sub' => sub {check_signal_message(\@_,1,$_[0]->{'server'},undef,$_[0]->{'nick'},undef,'dcc_actions');} +}, +# "message dcc ctcp", DCC_REC *dcc, char *cmd, char *data +{ + 'types' => ['dcc_ctcps'], + 'signal' => 'message dcc ctcp', + 'sub' => sub {check_signal_message(\@_,1,$_[0]->{'server'},undef,$_[0]->{'nick'},undef,'dcc_ctcps');} +}, +# "server incoming", SERVER_REC, char *data +{ + 'types' => ['rawin'], + 'signal' => 'server incoming', + 'sub' => sub {check_signal_message(\@_,1,$_[0],undef,undef,undef,'rawin');} +}, +# "send command", char *args, SERVER_REC, WI_ITEM_REC +{ + 'types' => ['send_command'], + 'signal' => 'send command', + 'sub' => sub { + sig_send_text_or_command(\@_,1); + } +}, +# "send text", char *line, SERVER_REC, WI_ITEM_REC +{ + 'types' => ['send_text'], + 'signal' => 'send text', + 'sub' => sub { + sig_send_text_or_command(\@_,0); + } +}, +# "beep" +{ + 'types' => ['beep'], + 'signal' => 'beep', + 'sub' => sub {check_signal_message(\@_,-1,undef,undef,undef,undef,'beep');} +}, +# "event "<cmd>, SERVER_REC, char *args, char *sender_nick, char *sender_address +{ + 'types' => ['mode_channel', 'mode_nick'], + 'signal' => 'event mode', + 'sub' => sub { + my ($server, $event_args, $nickname, $address) = @_; + my ($target, $modes, $modeargs) = split(/ /, $event_args, 3); + return if (!$server->ischannel($target)); + my (@modeargs) = split(/ /,$modeargs); + my ($pos, $type, $event_type, $arg) = (0, '+'); + foreach my $char (split(//,$modes)) { + if ($char eq "+" || $char eq "-") { + $type = $char; + } else { + if ($char =~ /[Oovh]/) { # mode_nick + $event_type = 'mode_nick'; + $arg = $modeargs[$pos++]; + } elsif ($char =~ /[beIqdk]/ || ( $char =~ /[lfJ]/ && $type eq '+')) { # chan_mode with arg + $event_type = 'mode_channel'; + $arg = $modeargs[$pos++]; + } else { # chan_mode without arg + $event_type = 'mode_channel'; + $arg = undef; + } + check_signal_message(\@_,-1,$server,$target,$nickname,$address,$event_type,{ + 'mode_type' => $type, + 'mode_char' => $char, + 'mode_arg' => $arg, + 'other' => ($event_type eq 'mode_nick') ? $arg : undef + }); + } + } + } +}, +# "notifylist joined", SERVER_REC, char *nick, char *user, char *host, char *realname, char *awaymsg +{ + 'types' => ['notify_join'], + 'signal' => 'notifylist joined', + 'sub' => sub {check_signal_message(\@_, 5, $_[0], undef, $_[1], $_[2].'@'.$_[3], 'notify_join', {'realname' => $_[4]});} +}, +{ + 'types' => ['notify_part'], + 'signal' => 'notifylist left', + 'sub' => sub {check_signal_message(\@_, 5, $_[0], undef, $_[1], $_[2].'@'.$_[3], 'notify_left', {'realname' => $_[4]});} +}, +{ + 'types' => ['notify_unidle'], + 'signal' => 'notifylist unidle', + 'sub' => sub {check_signal_message(\@_, 5, $_[0], undef, $_[1], $_[2].'@'.$_[3], 'notify_unidle', {'realname' => $_[4]});} +}, +{ + 'types' => ['notify_away', 'notify_unaway'], + 'signal' => 'notifylist away changed', + 'sub' => sub {check_signal_message(\@_, 5, $_[0], undef, $_[1], $_[2].'@'.$_[3], ($_[5] ? 'notify_away' : 'notify_unaway'), {'realname' => $_[4]});} +}, +# "ctcp msg", SERVER_REC, char *args, char *nick, char *addr, char *target +{ + 'types' => ['pubctcps', 'privctcps'], + 'signal' => 'ctcp msg', + 'sub' => sub { + my ($server, $args, $nick, $addr, $target) = @_; + if ($target eq $server->{'nick'}) { + check_signal_message(\@_, 1, $server, undef, $nick, $addr, 'privctcps'); + } else { + check_signal_message(\@_, 1, $server, $target, $nick, $addr, 'pubctcps'); + } + } +}, +# "ctcp reply", SERVER_REC, char *args, char *nick, char *addr, char *target +{ + 'types' => ['pubctcpreplies', 'privctcpreplies'], + 'signal' => 'ctcp reply', + 'sub' => sub { + my ($server, $args, $nick, $addr, $target) = @_; + if ($target eq $server->{'nick'}) { + check_signal_message(\@_, 1, $server, undef, $nick, $addr, 'privctcpreplies'); + } else { + check_signal_message(\@_, 1, $server, $target, $nick, $addr, 'pubctcpreplies'); + } + } +}, +# "flood", SERVER_REC, char *nick, char *host, int level, char *target +{ + 'types' => ['pubflood', 'privflood'], + 'signal' => 'flood', + 'sub' => sub { + my ($server, $nick, $host, $level, $target) = @_; + if ($target eq $server->{'nick'}) { + check_signal_message(\@_, -1, $server, undef, $nick, $host, 'privflood'); + } else { + check_signal_message(\@_, -1, $server, $target, $nick, $host, 'pubflood'); + } + } +} +); + +sub sig_send_text_or_command { + my ($signal, $iscommand) = @_; + my ($line, $server, $item) = @$signal; + my ($channelname,$nickname,$address) = (undef,undef,undef); + if ($item && (ref($item) eq 'Irssi::Irc::Channel' || ref($item) eq 'Irssi::Silc::Channel')) { + $channelname = $item->{'name'}; + } elsif ($item && ref($item) eq 'Irssi::Irc::Query') { # TODO Silc query ? + $nickname = $item->{'name'}; + $address = $item->{'address'} + } + # TODO pass context also for non-channels (queries and other stuff) + check_signal_message($signal,0,$server,$channelname,$nickname,$address,$iscommand ? 'send_command' : 'send_text'); + +} + +my %filters = ( +'tags' => { + 'types' => \@all_server_types, + 'sub' => sub { + my ($param, $signal,$parammessage,$server,$channelname,$nickname,$address,$condition,$extra) = @_; + + if (!defined($server)) { + return 0; + } + my $matches = 0; + foreach my $tag (split(/ /,$param)) { + if (lc($server->{'tag'}) eq lc($tag)) { + $matches = 1; + last; + } + } + return $matches; + } +}, +'channels' => { + 'types' => \@allchan_types, + 'sub' => sub { + my ($param, $signal,$parammessage,$server,$channelname,$nickname,$address,$condition,$extra) = @_; + + if (!defined($channelname) || !defined($server)) { + return 0; + } + my $matches = 0; + foreach my $trigger_channel (split(/ /,$param)) { + if (lc($channelname) eq lc($trigger_channel) + || lc($server->{'tag'}.'/'.$channelname) eq lc($trigger_channel) + || lc($server->{'tag'}.'/') eq lc($trigger_channel)) { + $matches = 1; + last; # this channel matches, stop checking channels + } + } + return $matches; + } +}, +'masks' => { + 'types' => \@mask_types, + 'sub' => sub { + my ($param, $signal,$parammessage,$server,$channelname,$nickname,$address,$condition,$extra) = @_; + $address //= ''; + return (defined($nickname) && defined($server) && $server->masks_match($param, $nickname, $address)); + } +}, +'other_masks' => { + 'types' => ['kicks', 'mode_nick', 'nick_changes'], + 'sub' => sub { + my ($param, $signal,$parammessage,$server,$channelname,$nickname,$address,$condition,$extra) = @_; + return 0 unless defined($extra->{'other'}); + my $other_address = ($condition ne 'nick_changes') ? get_address($extra->{'other'}, $server, $channelname) : $address; + return defined($other_address) && $server->masks_match($param, $extra->{'other'}, $other_address); + } +}, +'hasmode' => { + 'types' => \@all_types, + 'sub' => sub { + my ($param, $signal,$parammessage,$server,$channelname,$nickname,$address,$condition,$extra) = @_; + return hasmode($param, $nickname, $server, $channelname); + } +}, +'other_hasmode' => { + 'types' => ['kicks', 'mode_nick'], + 'sub' => sub { + my ($param,$signal,$parammessage,$server,$channelname,$nickname,$address,$condition,$extra) = @_; + return defined($extra->{'other'}) && hasmode($param, $extra->{'other'}, $server, $channelname); + } +}, +'hasflag' => { + 'types' => \@all_types, + 'sub' => sub { + my ($param, $signal,$parammessage,$server,$channelname,$nickname,$address,$condition,$extra) = @_; + return 0 unless defined($nickname) && defined($address) && defined($server); + my $flags = get_flags ($server->{'chatnet'},$channelname,$nickname,$address); + return defined($flags) && check_modes($flags,$param); + } +}, +'other_hasflag' => { + 'types' => ['kicks', 'mode_nick'], + 'sub' => sub { + my ($param, $signal,$parammessage,$server,$channelname,$nickname,$address,$condition,$extra) = @_; + return 0 unless defined($extra->{'other'}); + my $other_address = get_address($extra->{'other'}, $server, $channelname); + return 0 unless defined($other_address); + my $flags = get_flags ($server->{'chatnet'},$channelname,$extra->{'other'},$other_address); + return defined($flags) && check_modes($flags,$param); + } +}, +'mode_type' => { + 'types' => ['mode_channel', 'mode_nick'], + 'sub' => sub { + my ($param, $signal,$parammessage,$server,$channelname,$nickname,$address,$condition,$extra) = @_; + return (($param) eq $extra->{'mode_type'}); + } +}, +'mode_char' => { + 'types' => ['mode_channel', 'mode_nick'], + 'sub' => sub { + my ($param, $signal,$parammessage,$server,$channelname,$nickname,$address,$condition,$extra) = @_; + return (($param) eq $extra->{'mode_char'}); + } +}, +'mode_arg' => { + 'types' => ['mode_channel', 'mode_nick'], + 'sub' => sub { + my ($param, $signal,$parammessage,$server,$channelname,$nickname,$address,$condition,$extra) = @_; + return (($param) eq $extra->{'mode_arg'}); + } +} +); + +sub get_address { + my ($nick, $server, $channel) = @_; + my $nickrec = get_nickrec($nick, $server, $channel); + return $nickrec ? $nickrec->{'host'} : undef; +} +sub get_nickrec { + my ($nick, $server, $channel) = @_; + return unless defined($server) && defined($channel) && defined($nick); + my $chanrec = $server->channel_find($channel); + return $chanrec ? $chanrec->nick_find($nick) : undef; +} + +sub hasmode { + my ($param, $nickname, $server, $channelname) = @_; + my $nickrec = get_nickrec($nickname, $server, $channelname); + return 0 unless defined $nickrec; + my $modes = + ($nickrec->{'op'} ? 'o' : '') + . ($nickrec->{'voice'} ? 'v' : '') + . ($nickrec->{'halfop'} ? 'h' : '') + ; + return check_modes($modes, $param); +} + +# list of all switches +my @trigger_switches = (@trigger_types, qw(all nocase stop once debug disabled last)); +# parameters (with an argument) +my @trigger_params = qw(pattern regexp command replace name); +# all options that can be used to set filters, including negative matches (not_<filter>) +my @trigger_filter_options = map(($_,'not_'.$_), keys(%filters)); +# list of all options (including switches) for /TRIGGER ADD +my @trigger_add_options = (@trigger_switches, @trigger_params, @trigger_filter_options); +# same for /TRIGGER CHANGE, this includes the -no<option>'s +my @trigger_options = map(($_,'no'.$_) ,@trigger_add_options); + +# check the triggers on $signal's $parammessage parameter, for triggers with $condition set +# on $server in $channelname, for $nickname!$address +# set $parammessage to -1 if the signal doesn't have a message +# for signal without channel, nick or address, set to undef +sub check_signal_message { + my ($signal, $parammessage, $server, $channelname, $nickname, $address, $condition, $extra) = @_; + my ($changed, $stopped, $context, $need_rebuild); + my $message = ($parammessage == -1) ? '' : $signal->[$parammessage]; + + return if (!$triggers_by_type{$condition}); + + if ($recursion_depth > 10) { + Irssi::print("Trigger error: Maximum recursion depth reached, aborting trigger.", MSGLEVEL_CLIENTERROR); + return; + } + $recursion_depth++; + +TRIGGER: + foreach my $trigger (@{$triggers_by_type{$condition}}) { + # check filters + foreach my $trigfilter (filters_for_trigger($trigger)) { + my $filter_sub = $trigfilter->{'filter'}->{'sub'}; + my $filter_matches = !!(&$filter_sub($trigfilter->{'param'}, $signal, $parammessage, $server, $channelname, $nickname, $address, $condition, $extra)); + if ($filter_matches != $trigfilter->{'must_match'}) { # if it didn't match, or if it's a -not_* filter and it did match + next TRIGGER; + } + } + + # check regexp (and keep matches in @- and @+, so don't make a this a {block}) + next if ($trigger->{'compregexp'} && ($parammessage == -1 || $message !~ m/$trigger->{'compregexp'}/)); + + # if we got this far, it fully matched, and we need to do the replace/command/stop/once + my $expands = $extra; + $expands->{'M'} = $message,; + $expands->{'T'} = (defined($server)) ? $server->{'tag'} : ''; + $expands->{'C'} = $channelname; + $expands->{'O'} = (defined($server)) ? $server->{'nick'} : ''; + $expands->{'N'} = $nickname; + $expands->{'A'} = $address; + $expands->{'I'} = ((!defined($address)) ? '' : substr($address,0,index($address,'@'))); + $expands->{'H'} = ((!defined($address)) ? '' : substr($address,index($address,'@')+1)); + $expands->{'$'} = '$'; + $expands->{';'} = ';'; + + if (defined($trigger->{'replace'})) { # it's a -replace + $message =~ s/$trigger->{'compregexp'}/do_expands(0,$trigger->{'compreplace'},$expands,$message)/ge; + $changed = 1; + } + + if ($trigger->{'command'}) { # it's a (nonempty) -command + my $command = $trigger->{'command'}; + # $1 = the stuff behind the $ we want to expand: a number, or a character from %expands + $command = do_expands(1, $command, $expands, $message); + + if (defined($server)) { + if (defined($channelname) && $server->channel_find($channelname)) { + $context = $server->channel_find($channelname); + } else { + $context = $server; + } + } else { + $context = undef; + } + + if (defined($context)) { + $context->command("eval $command"); + } else { + Irssi::command("eval $command"); + } + } + + if ($trigger->{'debug'}) { + print("DEBUG: trigger $condition pmesg=$parammessage message=$message server=$server->{tag} channel=$channelname nick=$nickname address=$address " . join(' ',map {$_ . '=' . $extra->{$_}} keys(%$extra))); + } + + if ($trigger->{'stop'}) { + $stopped = 1; + } + + if ($trigger->{'once'}) { + # find this trigger in the real trigger list, and remove it + for (my $realindex=0; $realindex < scalar(@triggers); $realindex++) { + if ($triggers[$realindex] == $trigger) { + splice (@triggers,$realindex,1); + last; + } + } + $need_rebuild = 1; + } + if ($trigger->{'last'}) { + last TRIGGER; + } + } + + if ($need_rebuild) { + rebuild(); + $changed_since_last_save = 1; + } + if ($stopped) { # stopped with -stop + signal_stop(); + } elsif ($changed) { # changed with -replace + $signal->[$parammessage] = $message; + signal_continue(@$signal); + } + $recursion_depth--; +} + +# return array of filters for the given trigger +sub filters_for_trigger($) { + my ($trigger) = @_; + return values(%{$trigger->{'filters'}}); +} + +# used in check_signal_message to expand $'s +# $inthis is a string that can contain $ stuff (like 'foo$1bar$N') +sub do_expands { + my ($escape, $inthis, $expands, $from) = @_; + # @+ and @- are copied because there are two s/// nested, and the inner needs the $1 and $2,... of the outer one + my @plus = @+; + my @min = @-; + my $p = \@plus; my $m = \@min; + $inthis =~ s/\$(\\*(\d+|[^0-9x{]|x[0-9a-fA-F][0-9a-fA-F]|{.*?}))/expand_and_escape($escape,$1,$expands,$m,$p,$from)/ge; + return $inthis; +} + +# \ $ and ; may need extra escaping because we use eval for -command +sub expand_and_escape { + my $escape = shift; + my $retval = expand(@_); + if ($escape) { + $retval =~ s/([\\\$;])/\\\1/g; + } + return $retval; +} + +# used in do_expands (via expand_and_escape), to_expand is the part after the $ +sub expand { + my ($to_expand, $expands, $min, $plus, $from) = @_; + if ($to_expand =~ /^\d+$/) { # a number => look up in $vars + # from man perlvar: + # $3 is the same as "substr $var, $-[3], $+[3] - $-[3])" + return ($to_expand > @{$min} ? '' : substr($from,$min->[$to_expand],$plus->[$to_expand]-$min->[$to_expand])); + } elsif ($to_expand =~ s/^\\//) { # begins with \, so strip that from to_expand + my $exp = expand($to_expand,$expands,$min,$plus,$from); # first expand without \ + $exp =~ s/([^a-zA-Z0-9])/\\\1/g; # escape non-word chars + return $exp; + } elsif ($to_expand =~ /^x([0-9a-fA-F]{2})/) { # $xAA + return chr(hex($1)); + } elsif ($to_expand =~ /^{(.*?)}$/) { # ${foo} + return expand($1, $expands, $min, $plus, $from); + } else { # look up in $expands + return $expands->{$to_expand}; + } +} + +sub check_modes { + my ($has_modes, $need_modes) = @_; + my $matches; + my $switch = 1; # if a '-' if found, will be 0 (meaning the modes should not be set) + foreach my $need_mode (split /&/, $need_modes) { + $matches = 0; + foreach my $char (split //, $need_mode) { + if ($char eq '-') { + $switch = 0; + } elsif ($char eq '+') { + $switch = 1; + } elsif ((index($has_modes, $char) != -1) == $switch) { + $matches = 1; + last; + } + } + if (!$matches) { + return 0; + } + } + return 1; +} + +# get someones flags from people.pl or friends(_shasta).pl +sub get_flags { + my ($chatnet, $channel, $nick, $address) = @_; + my $flags; + no strict 'refs'; + if (%{ 'Irssi::Script::people::' }) { + if (defined ($channel)) { + $flags = (&{ 'Irssi::Script::people::find_local_flags' }($chatnet,$channel,$nick,$address)); + } else { + $flags = (&{ 'Irssi::Script::people::find_global_flags' }($chatnet,$nick,$address)); + } + $flags = join('',keys(%{$flags})); + } else { + my $shasta; + if (%{ 'Irssi::Script::friends_shasta::' }) { + $shasta = 'friends_shasta'; + } elsif (defined &{ 'Irssi::Script::friends::get_idx' }) { + $shasta = 'friends'; + } else { + return undef; + } + my $idx = (&{ 'Irssi::Script::'.$shasta.'::get_idx' }($nick, $address)); + if ($idx == -1) { + return ''; + } + $flags = (&{ 'Irssi::Script::'.$shasta.'::get_friends_flags' }($idx,undef)); + if ($channel) { + $flags .= (&{ 'Irssi::Script::'.$shasta.'::get_friends_flags' }($idx,$channel)); + } + } + return $flags; +} + +######################################################## +### internal stuff called by manage, needed by above ### +######################################################## + +my %mask_to_regexp = (); +foreach my $i (0..255) { + my $ch = chr $i; + $mask_to_regexp{$ch} = "\Q$ch\E"; +} +$mask_to_regexp{'?'} = '(.)'; +$mask_to_regexp{'*'} = '(.*)'; + +sub compile_trigger { + my ($trigger) = @_; + my $regexp; + + if ($trigger->{'regexp'}) { + $regexp = $trigger->{'regexp'}; + } elsif ($trigger->{'pattern'}) { + $regexp = $trigger->{'pattern'}; + $regexp =~ s/(.)/$mask_to_regexp{$1}/g; + } else { + delete $trigger->{'compregexp'}; + return; + } + + if ($trigger->{'nocase'}) { + $regexp = '(?i)' . $regexp; + } + + $trigger->{'compregexp'} = qr/$regexp/; + + if(defined($trigger->{'replace'})) { + (my $replace = $trigger->{'replace'}) =~ s/\$/\$\$/g; + $trigger->{'compreplace'} = Irssi::parse_special($replace); + } +} + +# rebuilds triggers_by_type and updates signal binds +sub rebuild { + %triggers_by_type = (); + foreach my $trigger (@triggers) { + if (!$trigger->{'disabled'}) { + if ($trigger->{'all'}) { + # -all is an alias for all types in @all_types for which the filters can apply +ALLTYPES: + foreach my $type (@all_types) { + # check if all filters can apply to $type + foreach my $trigfilter (filters_for_trigger($trigger)) { + if (! grep {$_ eq $type} @{$trigfilter->{'filter'}->{'types'}}) { + next ALLTYPES; + } + } + push @{$triggers_by_type{$type}}, ($trigger); + } + } + + foreach my $type ($trigger->{'all'} ? @notall_types : @trigger_types) { + if ($trigger->{$type}) { + push @{$triggers_by_type{$type}}, ($trigger); + } + } + } + } + + foreach my $signal (@signals) { + my $should_bind = 0; + foreach my $type (@{$signal->{'types'}}) { + if (defined($triggers_by_type{$type})) { + $should_bind = 1; + } + } + if ($should_bind && !$signal->{'bind'}) { + signal_add_first($signal->{'signal'}, $signal->{'sub'}); + $signal->{'bind'} = 1; + } elsif (!$should_bind && $signal->{'bind'}) { + signal_remove($signal->{'signal'}, $signal->{'sub'}); + $signal->{'bind'} = 0; + } + } +} + +################################ +### manage the triggers-list ### +################################ + +my $trigger_file; # cached setting + +sub sig_setup_changed { + $trigger_file = Irssi::settings_get_str('trigger_file'); +} + +sub autosave { + cmd_save() if ($changed_since_last_save); +} + +# TRIGGER SAVE +sub cmd_save { + my $io = new IO::File $trigger_file, "w"; + if (defined $io) { + $io->print("#Triggers file version $VERSION\n"); + foreach my $trigger (@triggers) { + $io->print(to_string($trigger) . "\n"); + } + $io->close; + } + Irssi::printformat(MSGLEVEL_CLIENTNOTICE, 'trigger_saved', $trigger_file); + $changed_since_last_save = 0; +} + +# save on unload +sub UNLOAD { + cmd_save(); +} + +# TRIGGER LOAD +sub cmd_load { + sig_setup_changed(); # make sure we've read the trigger_file setting + my $converted = 0; + my $io = new IO::File $trigger_file, "r"; + if (not defined $io) { + if (-e $trigger_file) { + Irssi::print("Error opening triggers file", MSGLEVEL_CLIENTERROR); + } + return; + } + if (defined $io) { + @triggers = (); + my $text; + $text = $io->getline; + my $file_version = ''; + if ($text =~ /^#Triggers file version (.*)\n/) { + $file_version = $1; + } + if ($file_version lt '0.6.1+2') { + no strict 'vars'; + $text .= $_ foreach ($io->getlines); + my $rep = eval "$text"; + if (! ref $rep) { + Irssi::print("Error in triggers file"); + return; + } + my @old_triggers = @$rep; + + for (my $index=0;$index < scalar(@old_triggers);$index++) { + my $trigger = $old_triggers[$index]; + + if ($file_version lt '0.6.1') { + # convert old names: notices => pubnotices, actions => pubactions + foreach $oldname ('notices','actions') { + if ($trigger->{$oldname}) { + delete $trigger->{$oldname}; + $trigger->{'pub'.$oldname} = 1; + $converted = 1; + } + } + } + if ($file_version lt '0.6.1+1' && $trigger->{'modifiers'}) { + if ($trigger->{'modifiers'} =~ /i/) { + $trigger->{'nocase'} = 1; + Irssi::print("Trigger: trigger ".($index+1)." had 'i' in it's modifiers, it has been converted to -nocase"); + } + if ($trigger->{'modifiers'} !~ /^[ig]*$/) { + Irssi::print("Trigger: trigger ".($index+1)." had unrecognised modifier '". $trigger->{'modifiers'} ."', which couldn't be converted."); + } + delete $trigger->{'modifiers'}; + $converted = 1; + } + + # convert to text with compat, and then to new trigger hash + $text = to_string($trigger,1); + my @args = &shellwords($text . ' a'); + my $trigger = parse_options({},@args); + if ($trigger) { + push @triggers, $trigger; + } + } + } else { # new format + while ( $text = $io->getline ) { + chop($text); + next if ($text =~ /^[ ]*$|^#/); + my @args = &shellwords($text . ' a'); + my $trigger = parse_options({},@args); + if ($trigger) { + push @triggers, $trigger; + } + } + } + } + Irssi::printformat(MSGLEVEL_CLIENTNOTICE, 'trigger_loaded', $trigger_file); + if ($converted) { + Irssi::print("Trigger: Triggers file will be in new format next time it's saved."); + } + rebuild(); +} + +# escape for printing with to_string +# <<abcdef>> => << 'abcdef' >> +# <<abc'def>> => << "abc'def" >> +# <<abc'def\x02>> => << 'abc'\''def\x02' >> +sub param_to_string { + my ($text) = @_; + # avoid ugly escaping if we can use "-quotes without other escaping (no " or \) + if ($text =~ /^[^"\\]*'[^"\\]$/) { + return ' "' . $text . '" '; + } + # "'" signs without a (odd number of) \ in front of them, need be to escaped as '\'' + # this is ugly :( + $text =~ s/(^|[^\\](\\\\)*)'/$1'\\''/g; + return " '$text' "; +} + +# converts a trigger back to "-switch -options 'foo'" form +# if $compat, $trigger is in the old format (used to convert) +sub to_string { + my ($trigger, $compat) = @_; + my $string; + + foreach my $switch (@trigger_switches) { + if ($trigger->{$switch}) { + $string .= '-'.$switch.' '; + } + } + + if ($compat) { + foreach my $filter (keys(%filters)) { + if ($trigger->{$filter}) { + $string .= '-' . $filter . param_to_string($trigger->{$filter}); + } + } + } else { + foreach my $trigfilter (filters_for_trigger($trigger)) { + $string .= '-' . $trigfilter->{'option'} . param_to_string($trigfilter->{'param'}); + } + } + + foreach my $param (@trigger_params) { + if ($trigger->{$param} || ($param eq 'replace' && defined($trigger->{'replace'}))) { + $string .= '-' . $param . param_to_string($trigger->{$param}); + } + } + return $string; +} + +# find a trigger (for REPLACE and DELETE), returns index of trigger, or -1 if not found +sub find_trigger { + my ($data) = @_; + if ($data =~ /^[0-9]*$/ and defined($triggers[$data-1])) { + return $data-1; + } else { + for (my $i=0; $i < scalar(@triggers); $i++) { + if ($triggers[$i]->{'name'} eq $data) { + return $i; + } + } + } + Irssi::printformat(MSGLEVEL_CLIENTCRAP, 'trigger_not_found', $data); + return -1; # not found +} + + +# TRIGGER ADD <options> +sub cmd_add { + my ($data, $server, $item) = @_; + my @args = shellwords($data . ' a'); + + my $trigger = parse_options({}, @args); + if ($trigger) { + push @triggers, $trigger; + Irssi::printformat(MSGLEVEL_CLIENTCRAP, 'trigger_added', scalar(@triggers), to_string($trigger)); + rebuild(); + $changed_since_last_save = 1; + } +} + +# TRIGGER CHANGE <nr> <options> +sub cmd_change { + my ($data, $server, $item) = @_; + my @args = shellwords($data . ' a'); + my $index = find_trigger(shift @args); + if ($index != -1) { + if(parse_options($triggers[$index], @args)) { + Irssi::print("Trigger " . ($index+1) ." changed to: ". to_string($triggers[$index])); + } + rebuild(); + $changed_since_last_save = 1; + } +} + +# parses options for TRIGGER ADD and TRIGGER CHANGE +# if invalid args returns undef, else changes $thetrigger and returns it +sub parse_options { + my ($thetrigger,@args) = @_; + my ($trigger, $option); + + if (pop(@args) ne 'a') { + Irssi::print("Syntax error, probably missing a closing quote", MSGLEVEL_CLIENTERROR); + return undef; + } + + %$trigger = %$thetrigger; # make a copy to prevent changing the given trigger if args doesn't parse +ARGS: for (my $arg = shift @args; $arg; $arg = shift @args) { + # expand abbreviated options, put in $option + $arg =~ s/^-//; + $option = undef; + foreach my $ioption (@trigger_options) { + if (index($ioption, $arg) == 0) { # -$opt starts with $arg + if ($option) { # another already matched + Irssi::print("Ambiguous option: $arg", MSGLEVEL_CLIENTERROR); + return undef; + } + $option = $ioption; + last if ($arg eq $ioption); # exact match is unambiguous + } + } + if (!$option) { + Irssi::print("Unknown option: $arg", MSGLEVEL_CLIENTERROR); + return undef; + } + + # -<param> <value> or -no<param> + foreach my $param (@trigger_params) { + if ($option eq $param) { + $trigger->{$param} = shift @args; + next ARGS; + } + if ($option eq 'no'.$param) { + $trigger->{$param} = undef; + next ARGS; + } + } + + # -[no]<switch> + foreach my $switch (@trigger_switches) { + # -<switch> + if ($option eq $switch) { + $trigger->{$switch} = 1; + next ARGS; + } + # -no<switch> + elsif ($option eq 'no'.$switch) { + $trigger->{$switch} = undef; + next ARGS; + } + } + + # -[not_]<filter> <value> + if ($option =~ /^(not_)?(.*)$/ && $filters{$2}) { + $trigger->{'filters'}->{$option} = { + option => $option, + must_match => ($1 ne 'not_'), # if false, trigger must only be done if filter sub returns false + filter_name => $2, + filter => $filters{$2}, + param => shift @args + }; + + next ARGS; + } + + # -no<filter> + if ($option =~ /^no(.*)$/ && $filters{$1}) { + delete $trigger->{'filters'}->{$1}; + } + } + + if (defined($trigger->{'replace'}) && ! $trigger->{'regexp'} && !$trigger->{'pattern'}) { + Irssi::print("Trigger error: Can't have -replace without -regexp", MSGLEVEL_CLIENTERROR); + return undef; + } + + if ($trigger->{'pattern'} && $trigger->{'regexp'}) { + Irssi::print("Trigger error: Can't have -pattern and -regexp in same trigger", MSGLEVEL_CLIENTERROR); + return undef; + } + + # remove types that are implied by -all + if ($trigger->{'all'}) { + foreach my $type (@all_types) { + delete $trigger->{$type}; + } + } + + # remove types for which the filters don't apply + foreach my $type (@trigger_types) { + if ($trigger->{$type}) { + foreach my $trigfilter (filters_for_trigger($trigger)) { + if (!grep {$_ eq $type} @{$trigfilter->{'filter'}->{'types'}}) { + Irssi::print("Warning: the filter -" . $trigfilter->{'option'} . " can't apply to an event of type -$type, so I'm removing that type from this trigger."); + delete $trigger->{$type}; + } + } + } + } + + # check if it has at least one type + my $has_a_type; + foreach my $type (@trigger_types) { + if ($trigger->{$type}) { + $has_a_type = 1; + last; + } + } + if (!$has_a_type && !$trigger->{'all'}) { + Irssi::print("Warning: this trigger doesn't trigger on any type of message. you probably want to add -publics or -all"); + } + + compile_trigger($trigger); + %$thetrigger = %$trigger; # copy changes to real trigger + return $thetrigger; +} + +# TRIGGER DELETE <num> +sub cmd_del { + my ($data, $server, $item) = @_; + my @args = shellwords($data); + my $index = find_trigger(shift @args); + if ($index != -1) { + Irssi::print("Deleted ". ($index+1) .": ". to_string($triggers[$index])); + splice (@triggers,$index,1); + rebuild(); + $changed_since_last_save = 1; + } +} + +# TRIGGER MOVE <num> <num> +sub cmd_move { + my ($data, $server, $item) = @_; + my @args = &shellwords($data); + my $index = find_trigger(shift @args); + if ($index != -1) { + my $newindex = find_trigger(shift @args); + if ($newindex != -1) { + Irssi::print("Moved from " . ($index+1) . " to " . ($newindex+1) . ": " . to_string($triggers[$index])); + my $trigger = splice (@triggers,$index,1); # remove from old place + splice (@triggers,$newindex,0,($trigger)); # insert at new place + rebuild(); + $changed_since_last_save = 1; + } + } +} + +# TRIGGER LIST +sub cmd_list { + Irssi::printformat(MSGLEVEL_CLIENTCRAP, 'trigger_header'); + my $i=1; + foreach my $trigger (@triggers) { + Irssi::printformat(MSGLEVEL_CLIENTCRAP, 'trigger_line', $i++, to_string($trigger)); + } +} + +###################### +### initialisation ### +###################### + +command_bind('trigger help',\&cmd_help); +command_bind('help trigger',\&cmd_help); +command_bind('trigger add',\&cmd_add); +command_bind('trigger change',\&cmd_change); +command_bind('trigger move',\&cmd_move); +command_bind('trigger list',\&cmd_list); +command_bind('trigger delete',\&cmd_del); +command_bind('trigger save',\&cmd_save); +command_bind('trigger reload',\&cmd_load); +command_bind 'trigger' => sub { + my ( $data, $server, $item ) = @_; + $data =~ s/\s+$//g; + command_runsub('trigger', $data, $server, $item); +}; + +Irssi::signal_add('setup saved', \&autosave); +Irssi::signal_add('setup changed', \&sig_setup_changed); + +# This makes tab completion work +Irssi::command_set_options('trigger add',join(' ',@trigger_add_options)); +Irssi::command_set_options('trigger change',join(' ',@trigger_options)); + +Irssi::settings_add_str($IRSSI{'name'}, 'trigger_file', Irssi::get_irssi_dir()."/triggers"); + +cmd_load(); diff --git a/.config/irssi/scripts/cmdind.pl b/.config/irssi/scripts/cmdind.pl @@ -0,0 +1 @@ +autorun/cmdind.pl +\ No newline at end of file diff --git a/.config/irssi/scripts/ctcpspoof.pl b/.config/irssi/scripts/ctcpspoof.pl @@ -0,0 +1 @@ +autorun/ctcpspoof.pl +\ No newline at end of file diff --git a/.config/irssi/scripts/dim_nicks.pl b/.config/irssi/scripts/dim_nicks.pl @@ -0,0 +1 @@ +autorun/dim_nicks.pl +\ No newline at end of file diff --git a/.config/irssi/scripts/ls.pl b/.config/irssi/scripts/ls.pl @@ -0,0 +1 @@ +autorun/ls.pl +\ No newline at end of file diff --git a/.config/irssi/scripts/nickcolor.pl b/.config/irssi/scripts/nickcolor.pl @@ -0,0 +1 @@ +autorun/nickcolor.pl +\ No newline at end of file diff --git a/.config/irssi/scripts/nojointext.pl b/.config/irssi/scripts/nojointext.pl @@ -0,0 +1 @@ +autorun/nojointext.pl +\ No newline at end of file diff --git a/.config/irssi/scripts/printlevel.pl b/.config/irssi/scripts/printlevel.pl @@ -0,0 +1,19 @@ +use Irssi; +use strict; +use vars qw($VERSION %IRSSI); +$VERSION = '1.1'; +%IRSSI = ( + authors => 'Wouter Coekaerts', + contact => 'wouter@coekaerts.be', + name => 'printlevels', + description => 'prints the message level before every line. useful for debugging your level settings', + license => 'GPLv2', + url => 'http://wouter.coekaerts.be/irssi', + changed => '09/09/2003' +); + +Irssi::signal_add('print text', sub { + my ($dest, $text, $stripped) = @_; + $_[1] = '|' . Irssi::bits2level($dest->{'level'}) . '| ' . $text; + Irssi::signal_continue(@_); +}); diff --git a/.config/irssi/scripts/tmux-nicklist-portable.pl b/.config/irssi/scripts/tmux-nicklist-portable.pl @@ -0,0 +1 @@ +autorun/tmux-nicklist-portable.pl +\ No newline at end of file diff --git a/.config/irssi/scripts/tmux_away.pl b/.config/irssi/scripts/tmux_away.pl @@ -0,0 +1 @@ +autorun/tmux_away.pl +\ No newline at end of file diff --git a/.config/irssi/scripts/trackbar.pl b/.config/irssi/scripts/trackbar.pl @@ -0,0 +1 @@ +autorun/trackbar.pl +\ No newline at end of file diff --git a/.config/irssi/scripts/trigger.pl b/.config/irssi/scripts/trigger.pl @@ -0,0 +1 @@ +autorun/trigger.pl +\ No newline at end of file diff --git a/.config/irssi/scripts/uberprompt.pl b/.config/irssi/scripts/uberprompt.pl @@ -0,0 +1 @@ +autorun/uberprompt.pl +\ No newline at end of file diff --git a/.config/irssi/scripts/vim_mode.pl b/.config/irssi/scripts/vim_mode.pl @@ -0,0 +1 @@ +autorun/vim_mode.pl +\ No newline at end of file diff --git a/.config/irssi/triggers b/.config/irssi/triggers @@ -1,2 +1,3 @@ #Triggers file version 1.2.4 -all -regexp '\t' -replace ' ' +-all -regexp '([[:alnum:]]) ([[:punct:]])[[:space:]]*$' -replace '$1$2' diff --git a/.config/nvim/after/syntax/sh.vim b/.config/nvim/after/syntax/sh.vim @@ -1,8 +1,8 @@ -" if exists("b:current_syntax") -" unlet b:current_syntax -" endif -" syn include @AWKScript syntax/awk.vim -" syn region AWKScriptCode matchgroup=AWKCommand start=+[=\\]\@<!'+ skip=+\\'+ end=+'+ contains=@AWKScript contained -" syn region AWKScriptEmbedded matchgroup=AWKCommand start=+\<awk\>+ skip=+\\$+ end=+[=\\]\@<!'+me=e-1 contains=@shIdList,@shExprList2 nextgroup=AWKScriptCode -" syn cluster shCommandSubList add=AWKScriptEmbedded -" hi def link AWKCommand statement +if exists("b:current_syntax") + unlet b:current_syntax +endif +syn include @AWKScript syntax/awk.vim +syn region AWKScriptCode matchgroup=AWKCommand start=+[=\\]\@<!'+ skip=+\\'+ end=+'+ contains=@AWKScript contained +syn region AWKScriptEmbedded matchgroup=AWKCommand start=+\<awk\>+ skip=+\\$+ end=+[=\\]\@<!'+me=e-1 contains=@shIdList,@shExprList2 nextgroup=AWKScriptCode +syn cluster shCommandSubList add=AWKScriptEmbedded +hi def link AWKCommand statement diff --git a/.config/zsh/alias.zsh b/.config/zsh/alias.zsh @@ -58,6 +58,7 @@ alias irc=" ssh -p 15551 hayden@77.68.91.186" alias vps2=" ssh -p 15552 hayden@vps2.haydenvh.com" alias dd=" echo PLEASE TRIPLE CHECK, THEN RUN ddd" alias ddd=" dd" +alias diff=" colordiff" alias ~d=" cd ~/general/downloads; ls" alias ~do=" cd ~/general/documents; ls" alias ~iw=" cd ~/images/wallpapers; ls" diff --git a/.scripts/bin/dmenu/dpass b/.scripts/bin/dmenu/dpass @@ -9,6 +9,7 @@ [ -z $PASS ] && PASS=$HOME/.local/pass [ ! -f $PASS ] && touch $PASS +[ ! -z $1 ] && passwd=$(grep "^$1: " < $PASS) && shift && echo "$@ ${passwd##*: }" && exit chosen=$(printf "GENERATE\nEDIT\n$(cut -d ':' -f 1 < $PASS)" | dmenu -l 20 -i -p "Select a password, or GENERATE:" | tr '[:upper:]' '[:lower:]') passwd=$(grep "^$chosen: " < $PASS) diff --git a/.scripts/dwmblocks/bat b/.scripts/dwmblocks/bat @@ -15,7 +15,7 @@ colour="#aa6600" [ "$charging" = "y" ] && colour="#00aa00" [ $num -ge 19 ] && colour="#00aa00" [ "$discharging" = "y" ] && colour="#aa0000" -echo "[^r0,5,2,4^^r2,2,22,10^^c#000000^^r3,3,20,8^^c$colour^^r$((23-$num)),3,$num,8^^d^^f24^]" +echo " ^r0,5,2,4^^r2,2,22,10^^c#000000^^r3,3,20,8^^c$colour^^r$((23-$num)),3,$num,8^^d^^f24^ " echo echo echo \#C625C8 diff --git a/.scripts/dwmblocks/news b/.scripts/dwmblocks/news @@ -9,7 +9,7 @@ newsboat -x reload 2>/dev/null && { rss=$(newsboat -x print-unread | sed 's/ unread articles//g') rssbnb=$(srssbnbc -n) - echo "[NWS $unread]" + echo "[NWS $(($rss + $rssbnb))]" echo echo \#498364 } diff --git a/.zprofile b/.zprofile @@ -6,9 +6,6 @@ # Copyright (c) 2019 Hayden Hamilton. LICENSE:MIT # -export LC_CTYPE="en_US.UTF-8" -export LANG="en_US.UTF-8" -export LC_ALL="C" export SCRIPTS="$HOME/.scripts/bin" scripts=$(ls -d $SCRIPTS/*/ | tr '\n' ':') export PATH="$PATH:$scripts" @@ -22,6 +19,7 @@ export SUDO_ASKPASS="$HOME/.scripts/bin/dmenu/daskpass" export PASS="$HOME/.local/pass" export SHELL="/usr/bin/zsh" export ZDOTDIR="$HOME/.config/zsh" +export CC="tcc" . .config/zsh/ls.zsh [ "$hostname" != "" ] && { echo > /dev/null @@ -54,4 +52,4 @@ export LC_ADDRESS="sv_SE.UTF-8" export LC_TELEPHONE="sv_SE.UTF-8" export LC_MEASUREMENT="sv_SE.UTF-8" export LC_IDENTIFICATION="sv_SE.UTF-8" -export LC_ALL= +export LC_ALL="sv_SE.UTF-8" diff --git a/LICENSE b/LICENSE @@ -1,19 +0,0 @@ -Copyright (C) 2019 Hayden Hamilton <hayden@haydenvh.com> - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE.