diff --git a/.weechat/alias.conf b/.weechat/alias.conf index ca2bb44..af8ce24 100644 --- a/.weechat/alias.conf +++ b/.weechat/alias.conf @@ -1,5 +1,12 @@ # -# alias.conf -- weechat v1.0.1 +# weechat -- alias.conf +# +# WARNING: It is NOT recommended to edit this file by hand, +# especially if WeeChat is running. +# +# Use commands like /set or /fset to change settings in WeeChat. +# +# For more info, see: https://weechat.org/doc/quickstart # [cmd] @@ -48,4 +55,3 @@ WW = "whowas" [completion] MSGBUF = "%(buffers_plugins_names)" - diff --git a/.weechat/buflist.conf b/.weechat/buflist.conf index 0b225d5..d783b81 100644 --- a/.weechat/buflist.conf +++ b/.weechat/buflist.conf @@ -4,12 +4,14 @@ # WARNING: It is NOT recommended to edit this file by hand, # especially if WeeChat is running. # -# Use /set or similar command to change settings in WeeChat. +# Use commands like /set or /fset to change settings in WeeChat. # # For more info, see: https://weechat.org/doc/quickstart # [look] +add_newline = on +auto_scroll = 50 display_conditions = "${buffer.hidden}==0" enabled = on mouse_jump_visited_buffer = off @@ -19,6 +21,7 @@ nick_prefix = off nick_prefix_empty = on signals_refresh = "" sort = "number,-active" +use_items = 1 [format] buffer = "${format_number}${indent}${format_nick_prefix}${color_hotlist}${name}" @@ -32,6 +35,7 @@ hotlist_private = "${color:cyan}" hotlist_separator = "${color:default}," indent = " " lag = " ${color:green}[${color:brown}${lag}${color:green}]" +name = "${name}" nick_prefix = "${color_nick_prefix}${nick_prefix}" number = "${color:green}${number}${if:${number_displayed}?.: }" - +tls_version = " ${color:default}(${if:${tls_version}==TLS1.3?${color:green}:${if:${tls_version}==TLS1.2?${color:yellow}:${color:red}}}${translate:${tls_version}}${color:default})" diff --git a/.weechat/charset.conf b/.weechat/charset.conf index aadbdae..3fed54d 100644 --- a/.weechat/charset.conf +++ b/.weechat/charset.conf @@ -1,5 +1,12 @@ # -# charset.conf -- weechat v1.0.1 +# weechat -- charset.conf +# +# WARNING: It is NOT recommended to edit this file by hand, +# especially if WeeChat is running. +# +# Use commands like /set or /fset to change settings in WeeChat. +# +# For more info, see: https://weechat.org/doc/quickstart # [default] diff --git a/.weechat/exec.conf b/.weechat/exec.conf index 0f713aa..b3c0ee0 100644 --- a/.weechat/exec.conf +++ b/.weechat/exec.conf @@ -1,10 +1,18 @@ # -# exec.conf -- weechat v1.0.1 +# weechat -- exec.conf +# +# WARNING: It is NOT recommended to edit this file by hand, +# especially if WeeChat is running. +# +# Use commands like /set or /fset to change settings in WeeChat. +# +# For more info, see: https://weechat.org/doc/quickstart # [command] default_options = "" purge_delay = 0 +shell = "${env:SHELL}" [color] flag_finished = lightred diff --git a/.weechat/irc.conf b/.weechat/irc.conf index 6d3af2e..824b567 100644 --- a/.weechat/irc.conf +++ b/.weechat/irc.conf @@ -1,8 +1,17 @@ # -# irc.conf -- weechat v1.0.1 +# weechat -- irc.conf +# +# WARNING: It is NOT recommended to edit this file by hand, +# especially if WeeChat is running. +# +# Use commands like /set or /fset to change settings in WeeChat. +# +# For more info, see: https://weechat.org/doc/quickstart # [look] +buffer_open_before_autojoin = on +buffer_open_before_join = off buffer_switch_autojoin = on buffer_switch_join = on color_nicks_in_names = off @@ -10,10 +19,12 @@ color_nicks_in_nicklist = on color_nicks_in_server_messages = on color_pv_nick_like_channel = on ctcp_time_format = "%a, %d %b %Y %T %z" +display_account_message = on display_away = local display_ctcp_blocked = on display_ctcp_reply = on display_ctcp_unknown = on +display_extended_join = on display_host_join = on display_host_join_local = on display_host_quit = on @@ -21,11 +32,11 @@ display_join_message = "329,332,333,366" display_old_topic = on display_pv_away_once = on display_pv_back = on +display_pv_warning_address = off highlight_channel = "$nick" highlight_pv = "$nick" highlight_server = "$nick" highlight_tags_restrict = "irc_privmsg,irc_notice" -item_away_message = on item_channel_modes_hide_args = "k" item_display_server = buffer_plugin item_nick_modes = on @@ -34,9 +45,6 @@ join_auto_add_chantype = off msgbuffer_fallback = current new_channel_position = none new_pv_position = none -nick_color_force = "" -nick_color_hash = sum -nick_color_stop_chars = "_|[" nick_completion_smart = speakers nick_mode = prefix nick_mode_empty = off @@ -52,27 +60,39 @@ pv_tags = "notify_private" raw_messages = 256 server_buffer = merge_with_core smart_filter = on +smart_filter_account = on +smart_filter_chghost = on smart_filter_delay = 5 smart_filter_join = on smart_filter_join_unmask = 30 smart_filter_mode = "+" smart_filter_nick = on smart_filter_quit = on +temporary_servers = off topic_strip_colors = off +typing_status_nicks = off +typing_status_self = off [color] input_nick = lightcyan -item_away = 130 item_channel_modes = lightcyan item_lag_counting = default item_lag_finished = 130 item_nick_modes = lightgreen +item_tls_version_deprecated = yellow +item_tls_version_insecure = red +item_tls_version_ok = green +message_account = cyan +message_chghost = brown message_join = green +message_kick = red message_quit = red mirc_remap = "1,-1:darkgray" nick_prefixes = "q:lightred;a:lightcyan;o:lightgreen;h:lightmagenta;v:yellow;*:lightblue" notice = green +reason_kick = default reason_quit = default +topic_current = default topic_new = white topic_old = default @@ -89,6 +109,7 @@ lag_reconnect = 0 lag_refresh_interval = 1 notify_check_ison = 1 notify_check_whois = 5 +sasl_fail_unavailable = on send_unknown_commands = off whois_double_nick = off @@ -110,30 +131,38 @@ autorejoin = off autorejoin_delay = 30 away_check = 0 away_check_max_nicks = 25 -capabilities = "account-notify,away-notify,cap-notify,chghost,extended-join,invite-notify,multi-prefix,server-time,userhost-in-names" +capabilities = "*" +charset_message = message command = "" command_delay = 0 connection_timeout = 60 -default_msg_kick = "" -default_msg_part = "WeeChat %v" -default_msg_quit = "WeeChat %v" +default_chantypes = "#&" ipv6 = on local_hostname = "" +msg_kick = "" +msg_part = "WeeChat ${info:version}" +msg_quit = "WeeChat ${info:version}" nicks = "${env:USER},${env:USER}1" +nicks_alternate = on notify = "" password = "" proxy = "" realname = "" +sasl_fail = reconnect +sasl_key = "" sasl_mechanism = plain sasl_password = "" sasl_timeout = 15 sasl_username = "" +split_msg_max_length = 512 ssl = off ssl_cert = "" ssl_dhkey_size = 2048 ssl_fingerprint = "" +ssl_password = "" ssl_priorities = "NORMAL" ssl_verify = on +usermode = "" username = "${env:USER}" [server] @@ -142,6 +171,7 @@ tilde.proxy tilde.ipv6 tilde.ssl = on tilde.ssl_cert +tilde.ssl_password tilde.ssl_priorities tilde.ssl_dhkey_size tilde.ssl_fingerprint @@ -151,14 +181,18 @@ tilde.capabilities tilde.sasl_mechanism tilde.sasl_username tilde.sasl_password +tilde.sasl_key tilde.sasl_timeout +tilde.sasl_fail tilde.autoconnect = on tilde.autoreconnect tilde.autoreconnect_delay tilde.nicks tilde.nicks_alternate +tilde.username tilde.realname tilde.local_hostname +tilde.usermode tilde.command tilde.command_delay tilde.autojoin = "#meta,#team" @@ -169,7 +203,10 @@ tilde.anti_flood_prio_high tilde.anti_flood_prio_low tilde.away_check tilde.away_check_max_nicks -tilde.default_msg_kick -tilde.default_msg_part -tilde.default_msg_quit +tilde.msg_kick +tilde.msg_part +tilde.msg_quit tilde.notify +tilde.split_msg_max_length +tilde.charset_message +tilde.default_chantypes diff --git a/.weechat/iset.conf b/.weechat/iset.conf index 81785f2..6099d13 100644 --- a/.weechat/iset.conf +++ b/.weechat/iset.conf @@ -1,5 +1,12 @@ # -# iset.conf -- weechat v1.0.1 +# weechat -- iset.conf +# +# WARNING: It is NOT recommended to edit this file by hand, +# especially if WeeChat is running. +# +# Use commands like /set or /fset to change settings in WeeChat. +# +# For more info, see: https://weechat.org/doc/quickstart # [color] diff --git a/.weechat/logger.conf b/.weechat/logger.conf index b2369db..54aadfd 100644 --- a/.weechat/logger.conf +++ b/.weechat/logger.conf @@ -1,9 +1,17 @@ # -# logger.conf -- weechat v1.0.1 +# weechat -- logger.conf +# +# WARNING: It is NOT recommended to edit this file by hand, +# especially if WeeChat is running. +# +# Use commands like /set or /fset to change settings in WeeChat. +# +# For more info, see: https://weechat.org/doc/quickstart # [look] backlog = 20 +backlog_conditions = "" [color] backlog_end = default @@ -11,7 +19,9 @@ backlog_line = default [file] auto_log = on +color_lines = off flush_delay = 120 +fsync = off info_lines = off mask = "$plugin.$name.weechatlog" name_lower_case = on diff --git a/.weechat/logs/core.weechat.weechatlog b/.weechat/logs/core.weechat.weechatlog deleted file mode 100644 index f12d2ac..0000000 --- a/.weechat/logs/core.weechat.weechatlog +++ /dev/null @@ -1,38 +0,0 @@ -2021-09-21 11:43:47 =!= spell: warning: the plugin "aspell" has been renamed to "spell" and the file /etc/skel/.weechat//aspell.conf still exists (but not /etc/skel/.weechat//spell.conf); if you upgraded from an older version, you should check instructions in release notes (version 2.5) to recover your settings -2021-09-21 11:43:47 New key binding (context "default"): meta-B => /buflist toggle -2021-09-21 11:43:47 New key binding (context "default"): meta-OP => /bar scroll buflist * -100% -2021-09-21 11:43:47 New key binding (context "default"): meta2-11~ => /bar scroll buflist * -100% -2021-09-21 11:43:47 New key binding (context "default"): meta-OQ => /bar scroll buflist * +100% -2021-09-21 11:43:47 New key binding (context "default"): meta2-12~ => /bar scroll buflist * +100% -2021-09-21 11:43:47 New key binding (context "default"): meta2-11^ => /bar scroll buflist * -100% -2021-09-21 11:43:47 New key binding (context "default"): meta2-1;5P => /bar scroll buflist * -100% -2021-09-21 11:43:47 New key binding (context "default"): meta2-12^ => /bar scroll buflist * +100% -2021-09-21 11:43:47 New key binding (context "default"): meta2-1;5Q => /bar scroll buflist * +100% -2021-09-21 11:43:47 New key binding (context "default"): meta-meta-OP => /bar scroll buflist * b -2021-09-21 11:43:47 New key binding (context "default"): meta-meta2-11~ => /bar scroll buflist * b -2021-09-21 11:43:47 New key binding (context "default"): meta2-1;3P => /bar scroll buflist * b -2021-09-21 11:43:47 New key binding (context "default"): meta-meta-OQ => /bar scroll buflist * e -2021-09-21 11:43:47 New key binding (context "default"): meta-meta2-12~ => /bar scroll buflist * e -2021-09-21 11:43:47 New key binding (context "default"): meta2-1;3Q => /bar scroll buflist * e -2021-09-21 11:43:47 =!= Warning: /etc/skel/.weechat//xfer.conf, line 26: unknown option for section "network": speed_limit = 0 -2021-09-21 11:43:47 =!= Warning: /etc/skel/.weechat//irc.conf, line 28: unknown option for section "look": item_away_message = on -2021-09-21 11:43:47 =!= Warning: /etc/skel/.weechat//irc.conf, line 37: unknown option for section "look": nick_color_force = "" -2021-09-21 11:43:47 =!= Warning: /etc/skel/.weechat//irc.conf, line 38: unknown option for section "look": nick_color_hash = sum -2021-09-21 11:43:47 =!= Warning: /etc/skel/.weechat//irc.conf, line 39: unknown option for section "look": nick_color_stop_chars = "_|[" -2021-09-21 11:43:47 =!= Warning: /etc/skel/.weechat//irc.conf, line 65: unknown option for section "color": item_away = 130 -2021-09-21 11:43:47 =!= Warning: /etc/skel/.weechat//irc.conf, line 117: unknown option for section "server_default": default_msg_kick = "" -2021-09-21 11:43:47 =!= Warning: /etc/skel/.weechat//irc.conf, line 118: unknown option for section "server_default": default_msg_part = "WeeChat %v" -2021-09-21 11:43:47 =!= Warning: /etc/skel/.weechat//irc.conf, line 119: unknown option for section "server_default": default_msg_quit = "WeeChat %v" -2021-09-21 11:43:47 =!= irc: error creating server option "tilde.default_msg_kick" -2021-09-21 11:43:47 =!= Warning: /etc/skel/.weechat//irc.conf, line 172: invalid value for option: tilde.default_msg_kick -2021-09-21 11:43:47 =!= irc: error creating server option "tilde.default_msg_part" -2021-09-21 11:43:47 =!= Warning: /etc/skel/.weechat//irc.conf, line 173: invalid value for option: tilde.default_msg_part -2021-09-21 11:43:47 =!= irc: error creating server option "tilde.default_msg_quit" -2021-09-21 11:43:47 =!= Warning: /etc/skel/.weechat//irc.conf, line 174: invalid value for option: tilde.default_msg_quit -2021-09-21 11:43:47 =!= perl: wrong arguments for function "bar_new" (script: iset) -2021-09-21 11:43:47 perl scripts loaded: highmon, iset -2021-09-21 11:43:48 python: stdout/stderr (?): File "/etc/skel/.weechat/python/autoload/grep.py", line 630 -2021-09-21 11:43:48 python: stdout/stderr (?): except Exception, e: -2021-09-21 11:43:48 python: stdout/stderr (?): ^ -2021-09-21 11:43:48 python: stdout/stderr (?): SyntaxError: invalid syntax -2021-09-21 11:43:48 = \ No newline at end of file diff --git a/.weechat/logs/irc.server.tilde.weechatlog b/.weechat/logs/irc.server.tilde.weechatlog deleted file mode 100644 index 2329646..0000000 --- a/.weechat/logs/irc.server.tilde.weechatlog +++ /dev/null @@ -1,35 +0,0 @@ -2021-09-21 11:43:48 -- irc: connecting to server team.tilde.chat/6697 (SSL)... -2021-09-21 11:43:49 -- gnutls: receiving 3 certificates -2021-09-21 11:43:49 -- - certificate[1] info: -2021-09-21 11:43:49 -- - subject `CN=tilde.chat', issuer `CN=R3,O=Let's Encrypt,C=US', serial 0x03f1a6f23c07cb6ae66a0d9ed5f5479adabc, RSA key 2048 bits, signed using RSA-SHA256, activated `2021-08-07 03:30:45 UTC', expires `2021-11-05 03:30:43 UTC', pin-sha256="QLMUqICmNItSncKFAwchZWIqDHVVA1ZpK4FhuUmV3RM=" -2021-09-21 11:43:49 -- - certificate[2] info: -2021-09-21 11:43:49 -- - subject `CN=R3,O=Let's Encrypt,C=US', issuer `CN=ISRG Root X1,O=Internet Security Research Group,C=US', serial 0x00912b084acf0c18a753f6d62e25a75f5a, RSA key 2048 bits, signed using RSA-SHA256, activated `2020-09-04 00:00:00 UTC', expires `2025-09-15 16:00:00 UTC', pin-sha256="jQJTbIh0grw0/1TkHSumWb+Fs0Ggogr621gT3PvPKG0=" -2021-09-21 11:43:49 -- - certificate[3] info: -2021-09-21 11:43:49 -- - subject `CN=ISRG Root X1,O=Internet Security Research Group,C=US', issuer `CN=DST Root CA X3,O=Digital Signature Trust Co.', serial 0x4001772137d4e942b8ee76aa3c640ab7, RSA key 4096 bits, signed using RSA-SHA256, activated `2021-01-20 19:14:03 UTC', expires `2024-09-30 18:14:03 UTC', pin-sha256="C5+lpZ7tcVwmwQIMcRtPbsQtWLABXhQzejna0wHFr8M=" -2021-09-21 11:43:49 -- gnutls: peer's certificate is trusted -2021-09-21 11:43:49 -- irc: connected to team.tilde.chat/6697 (2607:5300:60:4f58::248) -2021-09-21 11:43:49 -- team.tilde.chat: *** Looking up your ident... -2021-09-21 11:43:49 -- team.tilde.chat: *** Looking up your hostname... -2021-09-21 11:43:49 -- team.tilde.chat: *** Found your hostname (tilde.team) -- cached -2021-09-21 11:43:49 -- irc: client capability, server supports: account-notify account-tag away-notify batch cap-notify chghost echo-message extended-join inspircd.org/poison inspircd.org/standard-replies invite-notify labeled-response message-tags multi-prefix sasl=EXTERNAL,PLAIN server-time setname tls userhost-in-names -2021-09-21 11:43:49 -- irc: client capability, requesting: account-notify away-notify cap-notify chghost extended-join invite-notify multi-prefix server-time userhost-in-names -2021-09-21 11:43:49 -- irc: client capability, enabled: account-notify away-notify cap-notify chghost extended-join invite-notify multi-prefix server-time userhost-in-names -2021-09-21 11:43:51 -- team.tilde.chat: *** Found your ident, 'UNKNOWN' -2021-09-21 11:43:51 -- Welcome to the tilde.chat IRC Network root!UNKNOWN@tilde.team -2021-09-21 11:43:51 -- Your host is team.tilde.chat, running version InspIRCd-3 -2021-09-21 11:43:51 -- This server was created 19:10:56 Aug 28 2021 -2021-09-21 11:43:51 -- team.tilde.chat InspIRCd-3 BILRSWcghiorswz ABEFHIJLMNOQRSTXYabcefghijklmnopqrstuvz :BEFHIJLXYabefghjkloqv -2021-09-21 11:43:51 -- ACCEPT=30 AWAYLEN=200 BOT=B CALLERID=g CASEMAPPING=rfc1459 CHANLIMIT=#:120 CHANMODES=IXbeg,k,BEFHJLfjl,AMNOQRSTcimnprstuz CHANNELLEN=64 CHANTYPES=# ELIST=CMNTU ESILENCE=CcdiNnPpTtx EXCEPTS=e :are supported by this server -2021-09-21 11:43:51 -- EXTBAN=,ANOQRSTUacmnprwz HOSTLEN=64 INVEX=I KEYLEN=32 KICKLEN=255 LINELEN=512 MAXLIST=I:100,X:100,b:100,e:100,g:100 MAXTARGETS=20 MODES=20 MONITOR=30 NAMELEN=128 NAMESX NETWORK=tilde.chat :are supported by this server -2021-09-21 11:43:51 -- NICKLEN=31 PREFIX=(Yqaohv)!~&@%+ REMOVE SAFELIST SECURELIST=60 SILENCE=32 STATUSMSG=!~&@%+ TOPICLEN=307 UHNAMES USERIP USERLEN=11 USERMODES=,,s,BILRSWcghiorwz WATCH=30 :are supported by this server -2021-09-21 11:43:51 -- WHOX :are supported by this server -2021-09-21 11:43:51 -- There are 1108 users and 114 invisible on 12 servers -2021-09-21 11:43:51 -- 10 :operator(s) online -2021-09-21 11:43:51 -- 1 :unknown connections -2021-09-21 11:43:51 -- 494 :channels formed -2021-09-21 11:43:51 -- I have 246 clients and 5 servers -2021-09-21 11:43:51 -- Current local users: 246 Max: 263 -2021-09-21 11:43:51 -- Current global users: 1222 Max: 1239 -2021-09-21 11:43:51 -- team.tilde.chat message of the day -2021-09-21 11:43:51 -- __ __ _ __ __ __ __ -202 \ No newline at end of file diff --git a/.weechat/logs/irc.tilde.#team.weechatlog b/.weechat/logs/irc.tilde.#team.weechatlog deleted file mode 100644 index e69de29..0000000 diff --git a/.weechat/perl/highmon.pl b/.weechat/perl/highmon.pl index 1c07712..f843cad 100644 --- a/.weechat/perl/highmon.pl +++ b/.weechat/perl/highmon.pl @@ -1,6 +1,5 @@ # # highmon.pl - Highlight Monitoring for weechat 0.3.0 -# Version 2.5 # # Add 'Highlight Monitor' buffer/bar to log all highlights in one spot # @@ -73,6 +72,10 @@ # Bugs and feature requests at: https://github.com/KenjiE20/highmon # History: +# 2020-06-21, Sebastien Helleu : +# v2.7: make call to bar_new compatible with WeeChat >= 2.9 +# 2019-05-13, HubbeKing +# v2.6: -add: send "logger_backlog" signal on buffer open if logging is enabled # 2014-08-16, KenjiE20 : # v2.5: -add: clearbar command to clear bar output # -add: firstrun output prompt to check the help text for set up hints as they were being missed @@ -264,7 +267,14 @@ sub highmon_bar_open # Make the bar item weechat::bar_item_new("highmon", "highmon_bar_build", ""); - $highmon_bar = weechat::bar_new ("highmon", "off", 100, "root", "", "bottom", "vertical", "vertical", 0, 0, "default", "cyan", "default", "on", "highmon"); + if (weechat::info_get("version_number", "") >= 0x02090000) + { + $highmon_bar = weechat::bar_new ("highmon", "off", 100, "root", "", "bottom", "vertical", "vertical", 0, 0, "default", "cyan", "default", "default", "on", "highmon"); + } + else + { + $highmon_bar = weechat::bar_new ("highmon", "off", 100, "root", "", "bottom", "vertical", "vertical", 0, 0, "default", "cyan", "default", "on", "highmon"); + } return weechat::WEECHAT_RC_OK; } @@ -306,7 +316,7 @@ sub highmon_buffer_open # Turn off notify, highlights if ($highmon_buffer ne "") { - if (weechat::config_get_plugin("hotlist_show" eq "off")) + if (weechat::config_get_plugin("hotlist_show") eq "off") { weechat::buffer_set($highmon_buffer, "notify", "0"); } @@ -317,6 +327,11 @@ sub highmon_buffer_open { weechat::buffer_set($highmon_buffer, "localvar_set_no_log", "1"); } + # send "logger_backlog" signal if logging is enabled to display backlog + if (weechat::config_get_plugin("logging") eq "on") + { + weechat::hook_signal_send("logger_backlog", weechat::WEECHAT_HOOK_SIGNAL_POINTER, $highmon_buffer) + } } return weechat::WEECHAT_RC_OK; } @@ -710,7 +725,7 @@ sub highmon_new_message if ($cb_high == "1" || (weechat::config_get_plugin("merge_private") eq "on" && $cb_tags =~ /notify_private/)) { # Pre bug #29618 (0.3.3) away detect - if (weechat::info_get("version_number", "") <= 197120) + if (weechat::info_get("version_number", "") <= 0x00030200) { $away = ''; # Get infolist for this server @@ -1124,7 +1139,7 @@ sub format_buffer_name } # Check result of register, and attempt to behave in a sane manner -if (!weechat::register("highmon", "KenjiE20", "2.5", "GPL3", "Highlight Monitor", "", "")) +if (!weechat::register("highmon", "KenjiE20", "2.7", "GPL3", "Highlight Monitor", "", "")) { # Double load weechat::print ("", "\tHighmon is already loaded"); diff --git a/.weechat/plugins.conf b/.weechat/plugins.conf index 3131fb5..a7684ea 100644 --- a/.weechat/plugins.conf +++ b/.weechat/plugins.conf @@ -1,5 +1,12 @@ # -# plugins.conf -- weechat v1.0.1 +# weechat -- plugins.conf +# +# WARNING: It is NOT recommended to edit this file by hand, +# especially if WeeChat is running. +# +# Use commands like /set or /fset to change settings in WeeChat. +# +# For more info, see: https://weechat.org/doc/quickstart # [var] diff --git a/.weechat/python/autojoin.py b/.weechat/python/autojoin.py index 3fe4b6b..0f0286c 100644 --- a/.weechat/python/autojoin.py +++ b/.weechat/python/autojoin.py @@ -43,6 +43,15 @@ # 2014-05-22, Nathaniel Wesley Filardo # version 0.2.5: Fix keyed channel support # +# 2016-01-13, The fox in the shell +# version 0.2.6: Support keeping chan list as secured data +# +# 2018-08-09, Julien Palard +# version 0.3.0: Support for Python 3 +# +# 2019-09-28, fructose +# version 0.3.1: Error on invalid arguments +# # @TODO: add options to ignore certain buffers # @TODO: maybe add an option to enable autosaving on part/join messages @@ -51,7 +60,7 @@ import re SCRIPT_NAME = "autojoin" SCRIPT_AUTHOR = "xt " -SCRIPT_VERSION = "0.2.5" +SCRIPT_VERSION = "0.3.1" SCRIPT_LICENSE = "GPL3" SCRIPT_DESC = "Configure autojoin for all servers according to currently joined channels" SCRIPT_COMMAND = "autojoin" @@ -71,8 +80,8 @@ if w.register(SCRIPT_NAME, SCRIPT_AUTHOR, SCRIPT_VERSION, SCRIPT_LICENSE, SCRIPT "autojoin_cb", "") - #w.hook_signal('*,irc_in2_join', 'autosave_channels_on_activity', '') - #w.hook_signal('*,irc_in2_part', 'autosave_channels_on_activity', '') + # w.hook_signal('*,irc_in2_join', 'autosave_channels_on_activity', '') + # w.hook_signal('*,irc_in2_part', 'autosave_channels_on_activity', '') w.hook_signal('quit', 'autosave_channels_on_quit', '') # Init everything @@ -80,6 +89,7 @@ for option, default_value in settings.items(): if w.config_get_plugin(option) == "": w.config_set_plugin(option, default_value) + def autosave_channels_on_quit(signal, callback, callback_data): ''' Autojoin current channels ''' if w.config_get_plugin(option) != "on": @@ -88,10 +98,8 @@ def autosave_channels_on_quit(signal, callback, callback_data): items = find_channels() # print/execute commands - for server, channels in items.iteritems(): - channels = channels.rstrip(',') - command = "/set irc.server.%s.autojoin '%s'" % (server, channels) - w.command('', command) + for server, channels in items.items(): + process_server(server, channels) return w.WEECHAT_RC_OK @@ -104,44 +112,66 @@ def autosave_channels_on_activity(signal, callback, callback_data): items = find_channels() # print/execute commands - for server, channels in items.iteritems(): + for server, channels in items.items(): nick = w.info_get('irc_nick', server) pattern = "^:%s!.*(JOIN|PART) :?(#[^ ]*)( :.*$)?" % nick match = re.match(pattern, callback_data) - if match: # check if nick is my nick. In that case: save - channel = match.group(2) - channels = channels.rstrip(',') - command = "/set irc.server.%s.autojoin '%s'" % (server, channels) - w.command('', command) - else: # someone else: ignore + if match: # check if nick is my nick. In that case: save + process_server(server, channels) + else: # someone else: ignore continue return w.WEECHAT_RC_OK + def autojoin_cb(data, buffer, args): - """Old behaviour: doesn't save empty channel list""" - """In fact should also save open buffers with a /part'ed channel""" - """But I can't believe somebody would want that behaviour""" + if args == '--run': + run = True + elif args != '': + w.prnt('', 'Unexpected argument: %s' % args) + return w.WEECHAT_RC_ERROR + else: + run = False + + # Old behaviour: doesn't save empty channel list + # In fact should also save open buffers with a /part'ed channel + # But I can't believe somebody would want that behaviour items = find_channels() # print/execute commands - for server, channels in items.iteritems(): - channels = channels.rstrip(',') - if not channels: # empty channel list - continue - command = '/set irc.server.%s.autojoin %s' % (server, channels) - if args == '--run': - w.command('', command) - else: - w.prnt('', command) + for server, channels in items.items(): + process_server(server, channels, run) return w.WEECHAT_RC_OK + +def process_server(server, channels, run=True): + option = "irc.server.%s.autojoin" % server + channels = channels.rstrip(',') + oldchans = w.config_string(w.config_get(option)) + + if not channels: # empty channel list + return + + # Note: re already caches the result of regexp compilation + sec = re.match('^\${sec\.data\.(.*)}$', oldchans) + if sec: + secvar = sec.group(1) + command = "/secure set %s %s" % (secvar, channels) + else: + command = "/set irc.server.%s.autojoin '%s'" % (server, channels) + + if run: + w.command('', command) + else: + w.prnt('', command) + + def find_channels(): """Return list of servers and channels""" - #@TODO: make it return a dict with more options like "nicks_count etc." + # TODO: make it return a dict with more options like "nicks_count etc." items = {} infolist = w.infolist_get('irc_server', '', '') # populate servers @@ -155,18 +185,18 @@ def find_channels(): keys = [] keyed_channels = [] unkeyed_channels = [] - items[server] = '' #init if connected but no channels + items[server] = '' # init if connected but no channels infolist = w.infolist_get('irc_channel', '', server) while w.infolist_next(infolist): if w.infolist_integer(infolist, 'nicks_count') == 0: - #parted but still open in a buffer: bit hackish + # parted but still open in a buffer: bit hackish continue if w.infolist_integer(infolist, 'type') == 0: key = w.infolist_string(infolist, "key") if len(key) > 0: keys.append(key) keyed_channels.append(w.infolist_string(infolist, "name")) - else : + else: unkeyed_channels.append(w.infolist_string(infolist, "name")) items[server] = ','.join(keyed_channels + unkeyed_channels) if len(keys) > 0: @@ -174,4 +204,3 @@ def find_channels(): w.infolist_free(infolist) return items - diff --git a/.weechat/python/grep.py b/.weechat/python/grep.py index 4fd5c64..68e067d 100644 --- a/.weechat/python/grep.py +++ b/.weechat/python/grep.py @@ -53,6 +53,9 @@ # It can be used for force or disable background process, using '0' forces to always grep in # background, while using '' (empty string) will disable it. # +# * plugins.var.python.grep.timeout_secs: +# Timeout (in seconds) for background grepping. +# # * plugins.var.python.grep.default_tail_head: # Config option for define default number of lines returned when using --head or --tail options. # Can be overriden in the command with --number option. @@ -66,6 +69,37 @@ # # History: # +# 2021-05-02, Sébastien Helleu +# version 0.8.5: add compatibility with WeeChat >= 3.2 (XDG directories) +# +# 2020-10-11, Thom Wiggers +# version 0.8.4: Python3 compatibility fix +# +# 2020-05-06, Dominique Martinet and hexa- +# version 0.8.3: more python3 compatibility fixes... +# +# 2019-06-30, dabbill +# and Sébastien Helleu +# version 0.8.2: make script compatible with Python 3 +# +# 2018-04-10, Sébastien Helleu +# version 0.8.1: fix infolist_time for WeeChat >= 2.2 (WeeChat returns a long +# integer instead of a string) +# +# 2017-09-20, mickael9 +# version 0.8: +# * use weechat 1.5+ api for background processing (old method was unsafe and buggy) +# * add timeout_secs setting (was previously hardcoded to 5 mins) +# +# 2017-07-23, Sébastien Helleu +# version 0.7.8: fix modulo by zero when nick is empty string +# +# 2016-06-23, mickael9 +# version 0.7.7: fix get_home function +# +# 2015-11-26 +# version 0.7.6: fix a typo +# # 2015-01-31, Nicd- # version 0.7.5: # '~' is now expaned to the home directory in the log file path so @@ -96,9 +130,9 @@ # * supress highlights when printing in grep buffer # # 2010-10-06 -# version 0.6.7: by xt +# version 0.6.7: by xt # * better temporary file: -# use tempfile.mkstemp. to create a temp file in log dir, +# use tempfile.mkstemp. to create a temp file in log dir, # makes it safer with regards to write permission and multi user # # 2010-04-08 @@ -189,7 +223,12 @@ ### from os import path -import sys, getopt, time, os, re, tempfile +import sys, getopt, time, os, re + +try: + import cPickle as pickle +except ImportError: + import pickle try: import weechat @@ -200,20 +239,21 @@ except ImportError: SCRIPT_NAME = "grep" SCRIPT_AUTHOR = "Elián Hanisch " -SCRIPT_VERSION = "0.7.5" +SCRIPT_VERSION = "0.8.5" SCRIPT_LICENSE = "GPL3" SCRIPT_DESC = "Search in buffers and logs" SCRIPT_COMMAND = "grep" ### Default Settings ### settings = { -'clear_buffer' : 'off', -'log_filter' : '', -'go_to_buffer' : 'on', -'max_lines' : '4000', -'show_summary' : 'on', -'size_limit' : '2048', -'default_tail_head' : '10', + 'clear_buffer' : 'off', + 'log_filter' : '', + 'go_to_buffer' : 'on', + 'max_lines' : '4000', + 'show_summary' : 'on', + 'size_limit' : '2048', + 'default_tail_head' : '10', + 'timeout_secs' : '300', } ### Class definitions ### @@ -232,14 +272,14 @@ class linesDict(dict): def get_matches_count(self): """Return the sum of total matches stored.""" if dict.__len__(self): - return sum(map(lambda L: L.matches_count, self.itervalues())) + return sum(map(lambda L: L.matches_count, self.values())) else: return 0 def __len__(self): """Return the sum of total lines stored.""" if dict.__len__(self): - return sum(map(len, self.itervalues())) + return sum(map(len, self.values())) else: return 0 @@ -247,7 +287,7 @@ class linesDict(dict): """Returns buffer count or buffer name if there's just one stored.""" n = len(self.keys()) if n == 1: - return self.keys()[0] + return list(self.keys())[0] elif n > 1: return '%s logs' %n else: @@ -255,18 +295,18 @@ class linesDict(dict): def items(self): """Returns a list of items sorted by line count.""" - items = dict.items(self) + items = list(dict.items(self)) items.sort(key=lambda i: len(i[1])) return items def items_count(self): """Returns a list of items sorted by match count.""" - items = dict.items(self) + items = list(dict.items(self)) items.sort(key=lambda i: i[1].matches_count) return items def strip_separator(self): - for L in self.itervalues(): + for L in self.values(): L.strip_separator() def get_last_lines(self, n): @@ -275,7 +315,7 @@ class linesDict(dict): if n >= total_lines: # nothing to do return - for k, v in reversed(self.items()): + for k, v in reversed(list(self.items())): l = len(v) if n > 0: if l > n: @@ -372,13 +412,15 @@ def color_nick(nick): else: mode = mode_color = '' # nick color - nick_color = weechat.info_get('irc_nick_color', nick) - if not nick_color: - # probably we're in WeeChat 0.3.0 - #debug('no irc_nick_color') - color_nicks_number = config_int('weechat.look.color_nicks_number') - idx = (sum(map(ord, nick))%color_nicks_number) + 1 - nick_color = wcolor(config_string('weechat.color.chat_nick_color%02d' %idx)) + nick_color = '' + if nick: + nick_color = weechat.info_get('irc_nick_color', nick) + if not nick_color: + # probably we're in WeeChat 0.3.0 + #debug('no irc_nick_color') + color_nicks_number = config_int('weechat.look.color_nicks_number') + idx = (sum(map(ord, nick))%color_nicks_number) + 1 + nick_color = wcolor(config_string('weechat.color.chat_nick_color%02d' %idx)) return ''.join((prefix_c, prefix, mode_color, mode, nick_color, nick, suffix_c, suffix)) ### Config and value validation ### @@ -413,9 +455,14 @@ def get_config_log_filter(): return [] def get_home(): - home = weechat.config_string(weechat.config_get('logger.file.path')) - home = path.abspath(path.expanduser(home)) - return home.replace('%h', weechat.info_get('weechat_dir', '')) + options = { + 'directory': 'data', + } + home = weechat.string_eval_path_home( + weechat.config_string(weechat.config_get('logger.file.path')), + {}, {}, options, + ) + return home def strip_home(s, dir=''): """Strips home dir from the begging of the log path, this makes them sorter.""" @@ -457,7 +504,7 @@ def dir_list(dir, filter_list=(), filter_excludes=True, include_dir=False): return cache_dir[key] except KeyError: pass - + filter_list = filter_list or get_config_log_filter() dir_len = len(dir) if filter_list: @@ -562,7 +609,10 @@ def get_file_by_name(buffer_name): if '$server' in mask: mask = mask.replace('$server', server) # change the unreplaced vars by '*' - from string import letters + try: + from string import letters + except ImportError: + from string import ascii_letters as letters if '%' in mask: # vars for time formatting mask = mask.replace('%', '$') @@ -627,8 +677,8 @@ def make_regexp(pattern, matchcase=False): regexp = re.compile(pattern, re.IGNORECASE) else: regexp = re.compile(pattern) - except Exception, e: - raise Exception, 'Bad pattern, %s' %e + except Exception as e: + raise Exception('Bad pattern, %s' % e) return regexp def check_string(s, regexp, hilight='', exact=False): @@ -686,7 +736,7 @@ def grep_file(file, head, tail, after_context, before_context, count, regexp, hi return s else: check = lambda s: check_string(s, regexp, hilight, exact) - + try: file_object = open(file, 'r') except IOError: @@ -706,7 +756,7 @@ def grep_file(file, head, tail, after_context, before_context, count, regexp, hi before_context, after_context = after_context, before_context if before_context: - before_context_range = range(1, before_context + 1) + before_context_range = list(range(1, before_context + 1)) before_context_range.reverse() limit = tail or head @@ -770,7 +820,7 @@ def grep_file(file, head, tail, after_context, before_context, count, regexp, hi while id < after_context + offset: id += 1 try: - context_line = file_object.next() + context_line = next(file_object) _context_line = check(context_line) if _context_line: offset = id @@ -818,6 +868,10 @@ def grep_buffer(buffer, head, tail, after_context, before_context, count, regexp prefix = string_remove_color(infolist_string(infolist, 'prefix'), '') message = string_remove_color(infolist_string(infolist, 'message'), '') date = infolist_time(infolist, 'date') + # since WeeChat 2.2, infolist_time returns a long integer + # instead of a string + if not isinstance(date, str): + date = time.strftime('%F %T', time.localtime(int(date))) return '%s\t%s\t%s' %(date, prefix, message) return function get_line = make_get_line_funcion() @@ -847,8 +901,7 @@ def grep_buffer(buffer, head, tail, after_context, before_context, count, regexp check = lambda s: check_string(s, regexp, hilight, exact) if before_context: - before_context_range = range(1, before_context + 1) - before_context_range.reverse() + before_context_range = reversed(range(1, before_context + 1)) while infolist_next(infolist): line = get_line(infolist) @@ -931,104 +984,88 @@ def show_matching_lines(): elif size_limit == '': background = False + regexp = make_regexp(pattern, matchcase) + + global grep_options, log_pairs + grep_options = (head, tail, after_context, before_context, + count, regexp, hilight, exact, invert) + + log_pairs = [(strip_home(log), log) for log in search_in_files] + if not background: # run grep normally - regexp = make_regexp(pattern, matchcase) - for log in search_in_files: - log_name = strip_home(log) - matched_lines[log_name] = grep_file(log, head, tail, after_context, before_context, - count, regexp, hilight, exact, invert) + for log_name, log in log_pairs: + matched_lines[log_name] = grep_file(log, *grep_options) buffer_update() else: - # we hook a process so grepping runs in background. - #debug('on background') - global hook_file_grep, script_path, bytecode - timeout = 1000*60*5 # 5 min - - quotify = lambda s: '"%s"' %s - files_string = ', '.join(map(quotify, search_in_files)) - - global tmpFile - # we keep the file descriptor as a global var so it isn't deleted until next grep - tmpFile = tempfile.NamedTemporaryFile(prefix=SCRIPT_NAME, - dir=weechat.info_get('weechat_dir', '')) - cmd = grep_process_cmd %dict(logs=files_string, head=head, pattern=pattern, tail=tail, - hilight=hilight, after_context=after_context, before_context=before_context, - exact=exact, matchcase=matchcase, home_dir=home_dir, script_path=script_path, - count=count, invert=invert, bytecode=bytecode, filename=tmpFile.name, - python=weechat.info_get('python2_bin', '') or 'python') - - #debug(cmd) - hook_file_grep = weechat.hook_process(cmd, timeout, 'grep_file_callback', tmpFile.name) - global pattern_tmpl + global hook_file_grep, grep_stdout, grep_stderr, pattern_tmpl + grep_stdout = grep_stderr = b'' + hook_file_grep = weechat.hook_process( + 'func:grep_process', + get_config_int('timeout_secs') * 1000, + 'grep_process_cb', + '' + ) if hook_file_grep: - buffer_create("Searching for '%s' in %s worth of data..." %(pattern_tmpl, - human_readable_size(size))) + buffer_create("Searching for '%s' in %s worth of data..." % ( + pattern_tmpl, + human_readable_size(size) + )) else: buffer_update() -# defined here for commodity -grep_process_cmd = """%(python)s -%(bytecode)sc ' -import sys, cPickle, os -sys.path.append("%(script_path)s") # add WeeChat script dir so we can import grep -from grep import make_regexp, grep_file, strip_home -logs = (%(logs)s, ) -try: - regexp = make_regexp("%(pattern)s", %(matchcase)s) - d = {} - for log in logs: - log_name = strip_home(log, "%(home_dir)s") - lines = grep_file(log, %(head)s, %(tail)s, %(after_context)s, %(before_context)s, - %(count)s, regexp, "%(hilight)s", %(exact)s, %(invert)s) - d[log_name] = lines - fd = open("%(filename)s", "wb") - cPickle.dump(d, fd, -1) - fd.close() -except Exception, e: - print >> sys.stderr, e' -""" -grep_stdout = grep_stderr = '' -def grep_file_callback(filename, command, rc, stdout, stderr): - global hook_file_grep, grep_stderr, grep_stdout - global matched_lines - #debug("rc: %s\nstderr: %s\nstdout: %s" %(rc, repr(stderr), repr(stdout))) - if stdout: - grep_stdout += stdout - if stderr: - grep_stderr += stderr - if int(rc) >= 0: - - def set_buffer_error(): - grep_buffer = buffer_create() - title = weechat.buffer_get_string(grep_buffer, 'title') - title = title + ' %serror' %color_title - weechat.buffer_set(grep_buffer, 'title', title) +def grep_process(*args): + result = {} + try: + global grep_options, log_pairs + for log_name, log in log_pairs: + result[log_name] = grep_file(log, *grep_options) + except Exception as e: + result = e + + return pickle.dumps(result, 0) + +def grep_process_cb(data, command, return_code, out, err): + global grep_stdout, grep_stderr, matched_lines, hook_file_grep + + if isinstance(out, str): + out = out.encode() + grep_stdout += out + + if isinstance(err, str): + err = err.encode() + grep_stderr += err + + def set_buffer_error(message): + error(message) + grep_buffer = buffer_create() + title = weechat.buffer_get_string(grep_buffer, 'title') + title = title + ' %serror' % color_title + weechat.buffer_set(grep_buffer, 'title', title) + + if return_code == weechat.WEECHAT_HOOK_PROCESS_ERROR: + set_buffer_error("Background grep timed out") + hook_file_grep = None + return WEECHAT_RC_OK + + elif return_code >= 0: + hook_file_grep = None + if grep_stderr: + set_buffer_error(grep_stderr) + return WEECHAT_RC_OK try: - if grep_stderr: - error(grep_stderr) - set_buffer_error() - #elif grep_stdout: - #debug(grep_stdout) - elif path.exists(filename): - import cPickle - try: - #debug(file) - fd = open(filename, 'rb') - d = cPickle.load(fd) - matched_lines.update(d) - fd.close() - except Exception, e: - error(e) - set_buffer_error() - else: - buffer_update() - global tmpFile - tmpFile = None - finally: - grep_stdout = grep_stderr = '' - hook_file_grep = None + data = pickle.loads(grep_stdout) + if isinstance(data, Exception): + raise data + matched_lines.update(data) + except Exception as e: + set_buffer_error(repr(e)) + return WEECHAT_RC_OK + else: + buffer_update() + return WEECHAT_RC_OK def get_grep_file_status(): @@ -1165,7 +1202,7 @@ def buffer_update(): # free matched_lines so it can be removed from memory del matched_lines - + def split_line(s): """Splits log's line 's' in 3 parts, date, nick and msg.""" global weechat_format @@ -1265,12 +1302,12 @@ def buffer_input(data, buffer, input_data): weechat.infolist_free(infolist) try: cmd_grep_parsing(input_data) - except Exception, e: - error('Argument error, %s' %e, buffer=buffer) + except Exception as e: + error('Argument error, %s' % e, buffer=buffer) return WEECHAT_RC_OK try: show_matching_lines() - except Exception, e: + except Exception as e: error(e) except NameError: error("There isn't any previous search to repeat.", buffer=buffer) @@ -1327,11 +1364,11 @@ def cmd_grep_parsing(args): args = ' '.join(args) # join pattern for keep spaces if args: - pattern_tmpl = args + pattern_tmpl = args pattern = _tmplRe.sub(tmplReplacer, args) debug('Using regexp: %s', pattern) if not pattern: - raise Exception, 'No pattern for grep the logs.' + raise Exception('No pattern for grep the logs.') def positive_number(opt, val): try: @@ -1344,7 +1381,7 @@ def cmd_grep_parsing(args): opt = '-' + opt else: opt = '--' + opt - raise Exception, "argument for %s must be a positive integer." %opt + raise Exception("argument for %s must be a positive integer." % opt) for opt, val in opts: opt = opt.strip('-') @@ -1403,18 +1440,18 @@ def cmd_grep_parsing(args): tail = n def cmd_grep_stop(buffer, args): - global hook_file_grep, pattern, matched_lines, tmpFile + global hook_file_grep, pattern, matched_lines if hook_file_grep: if args == 'stop': weechat.unhook(hook_file_grep) hook_file_grep = None - s = 'Search for \'%s\' stopped.' %pattern + + s = 'Search for \'%s\' stopped.' % pattern say(s, buffer) grep_buffer = weechat.buffer_search('python', SCRIPT_NAME) if grep_buffer: weechat.buffer_set(grep_buffer, 'title', s) - del matched_lines - tmpFile = None + matched_lines = {} else: say(get_grep_file_status(), buffer) raise Exception @@ -1439,8 +1476,8 @@ def cmd_grep(data, buffer, args): # parse try: cmd_grep_parsing(args) - except Exception, e: - error('Argument error, %s' %e) + except Exception as e: + error('Argument error, %s' % e) return WEECHAT_RC_OK # find logs @@ -1486,7 +1523,7 @@ def cmd_grep(data, buffer, args): # grepping try: show_matching_lines() - except Exception, e: + except Exception as e: error(e) return WEECHAT_RC_OK @@ -1505,8 +1542,8 @@ def cmd_logs(data, buffer, args): opt = opt.strip('-') if opt in ('size', 's'): sort_by_size = True - except Exception, e: - error('Argument error, %s' %e) + except Exception as e: + error('Argument error, %s' % e) return WEECHAT_RC_OK # is there's a filter, filter_excludes should be False @@ -1529,7 +1566,7 @@ def cmd_logs(data, buffer, args): buffer = buffer_create() if get_config_boolean('clear_buffer'): weechat.buffer_clear(buffer) - file_list = zip(file_list, file_sizes) + file_list = list(zip(file_list, file_sizes)) msg = 'Found %s logs.' %len(file_list) print_line(msg, buffer, display=True) @@ -1639,7 +1676,7 @@ if __name__ == '__main__' and import_ok and \ If used with 'log ' search in all logs that matches . -b --buffer: Search only in buffers, not in file logs. -c --count: Just count the number of matched lines instead of showing them. - -m --matchcase: Don't do case insensible search. + -m --matchcase: Don't do case insensitive search. -H --hilight: Colour exact matches in output buffer. -o --only-match: Print only the matching part of the line (unique matches). -v -i --invert: Print lines that don't match the regular expression. @@ -1688,7 +1725,7 @@ Examples: 'completion_grep_args', '') # settings - for opt, val in settings.iteritems(): + for opt, val in settings.items(): if not weechat.config_is_set_plugin(opt): weechat.config_set_plugin(opt, val) @@ -1701,7 +1738,7 @@ Examples: color_summary = weechat.color('lightcyan') color_delimiter = weechat.color('chat_delimiters') color_script_nick = weechat.color('chat_nick') - + # pretty [grep] script_nick = '%s[%s%s%s]%s' %(color_delimiter, color_script_nick, SCRIPT_NAME, color_delimiter, color_reset) @@ -1719,8 +1756,11 @@ Examples: debug = pybuffer.debugBuffer(globals(), '%s_debug' % SCRIPT_NAME) except: def debug(s, *args): - if not isinstance(s, basestring): - s = str(s) + try: + if not isinstance(s, basestring): + s = str(s) + except NameError: + pass if args: s = s %args prnt('', '%s\t%s' %(script_nick, s)) diff --git a/.weechat/relay.conf b/.weechat/relay.conf index fa3976a..d6974cc 100644 --- a/.weechat/relay.conf +++ b/.weechat/relay.conf @@ -1,5 +1,12 @@ # -# relay.conf -- weechat v1.0.1 +# weechat -- relay.conf +# +# WARNING: It is NOT recommended to edit this file by hand, +# especially if WeeChat is running. +# +# Use commands like /set or /fset to change settings in WeeChat. +# +# For more info, see: https://weechat.org/doc/quickstart # [look] @@ -18,21 +25,35 @@ text_bg = default text_selected = white [network] +allow_empty_password = off allowed_ips = "" +auth_timeout = 60 bind_address = "" clients_purge_delay = 0 compression_level = 6 ipv6 = on max_clients = 5 +nonce_size = 16 password = "" +password_hash_algo = "*" +password_hash_iterations = 100000 ssl_cert_key = "%h/ssl/relay.pem" +ssl_priorities = "NORMAL:-VERS-SSL3.0" +totp_secret = "" +totp_window = 0 websocket_allowed_origins = "" [irc] backlog_max_minutes = 1440 backlog_max_number = 256 backlog_since_last_disconnect = on +backlog_since_last_message = off backlog_tags = "irc_privmsg" backlog_time_format = "[%H:%M] " +[weechat] +commands = "" + [port] + +[path] diff --git a/.weechat/script.conf b/.weechat/script.conf index d0e3ecf..342375e 100644 --- a/.weechat/script.conf +++ b/.weechat/script.conf @@ -1,5 +1,12 @@ # -# script.conf -- weechat v1.0.1 +# weechat -- script.conf +# +# WARNING: It is NOT recommended to edit this file by hand, +# especially if WeeChat is running. +# +# Use commands like /set or /fset to change settings in WeeChat. +# +# For more info, see: https://weechat.org/doc/quickstart # [look] @@ -43,8 +50,8 @@ text_version_selected = lightmagenta [scripts] autoload = on cache_expire = 1440 +download_enabled = on download_timeout = 30 -path = "%h/script" hold = "" +path = "%h/script" url = "http://weechat.org/files/plugins.xml.gz" -url_force_https = on diff --git a/.weechat/script/plugins.xml.gz b/.weechat/script/plugins.xml.gz index 4dcd39f..f3a0db8 100644 Binary files a/.weechat/script/plugins.xml.gz and b/.weechat/script/plugins.xml.gz differ diff --git a/.weechat/sec.conf b/.weechat/sec.conf index c8a08d8..11611fe 100644 --- a/.weechat/sec.conf +++ b/.weechat/sec.conf @@ -1,11 +1,18 @@ # -# sec.conf -- weechat v1.0.1 +# weechat -- sec.conf +# +# WARNING: It is NOT recommended to edit this file by hand, +# especially if WeeChat is running. +# +# Use commands like /set or /fset to change settings in WeeChat. +# +# For more info, see: https://weechat.org/doc/quickstart # [crypt] cipher = aes256 hash_algo = sha256 -passphrase_file = "" +passphrase_command = "" salt = on [data] diff --git a/.weechat/trigger.conf b/.weechat/trigger.conf index 2a1384c..9dfff2e 100644 --- a/.weechat/trigger.conf +++ b/.weechat/trigger.conf @@ -1,5 +1,12 @@ # -# trigger.conf -- weechat v1.0.1 +# weechat -- trigger.conf +# +# WARNING: It is NOT recommended to edit this file by hand, +# especially if WeeChat is running. +# +# Use commands like /set or /fset to change settings in WeeChat. +# +# For more info, see: https://weechat.org/doc/quickstart # [look] @@ -9,6 +16,7 @@ monitor_strip_colors = off [color] flag_command = lightgreen flag_conditions = 130 +flag_post_action = lightblue flag_regex = lightcyan flag_return_code = lightmagenta regex = white @@ -22,6 +30,7 @@ beep.command = "/print -beep" beep.conditions = "${tg_highlight} || ${tg_msg_pv}" beep.enabled = on beep.hook = print +beep.post_action = none beep.regex = "" beep.return_code = ok cmd_pass.arguments = "5000|input_text_display;5000|history_add;5000|irc_command_auth" @@ -29,6 +38,7 @@ cmd_pass.command = "" cmd_pass.conditions = "" cmd_pass.enabled = on cmd_pass.hook = modifier +cmd_pass.post_action = none cmd_pass.regex = "==^((/(msg|m|quote) +nickserv +(id|identify|register|ghost +[^ ]+|release +[^ ]+|regain +[^ ]+) +)|/oper +[^ ]+ +|/quote +pass +|/set +[^ ]*password[^ ]* +|/secure +(passphrase|decrypt|set +[^ ]+) +)(.*)==${re:1}${hide:*,${re:+}}" cmd_pass.return_code = ok msg_auth.arguments = "5000|irc_message_auth" @@ -36,6 +46,7 @@ msg_auth.command = "" msg_auth.conditions = "" msg_auth.enabled = on msg_auth.hook = modifier +msg_auth.post_action = none msg_auth.regex = "==^(.*(id|identify|register|ghost +[^ ]+|release +[^ ]+) +)(.*)==${re:1}${hide:*,${re:+}}" msg_auth.return_code = ok server_pass.arguments = "5000|input_text_display;5000|history_add" @@ -43,5 +54,6 @@ server_pass.command = "" server_pass.conditions = "" server_pass.enabled = on server_pass.hook = modifier +server_pass.post_action = none server_pass.regex = "==^(/(server|connect) .*-(sasl_)?password=)([^ ]+)(.*)==${re:1}${hide:*,${re:4}}${re:5}" server_pass.return_code = ok diff --git a/.weechat/weechat.conf b/.weechat/weechat.conf index 328907e..9bc46d1 100644 --- a/.weechat/weechat.conf +++ b/.weechat/weechat.conf @@ -1,5 +1,12 @@ # -# weechat.conf -- weechat v1.0.1 +# weechat -- weechat.conf +# +# WARNING: It is NOT recommended to edit this file by hand, +# especially if WeeChat is running. +# +# Use commands like /set or /fset to change settings in WeeChat. +# +# For more info, see: https://weechat.org/doc/quickstart # [debug] @@ -13,6 +20,7 @@ sys_rlimit = "" [look] align_end_of_lines = message +align_multiline_words = on bar_more_down = "++" bar_more_left = "<<" bar_more_right = ">>" @@ -27,6 +35,7 @@ buffer_search_force_default = off buffer_search_regex = off buffer_search_where = prefix_message buffer_time_format = "${color:250}%H${color:lightcyan}:${color:245}%M${color:lightcyan}:${color:240}%S" +buffer_time_same = "" color_basic_force_bold = off color_inactive_buffer = on color_inactive_message = on @@ -38,7 +47,9 @@ color_nick_offline = on color_pairs_auto_reset = 5 color_real_white = off command_chars = "" +command_incomplete = off confirm_quit = off +confirm_upgrade = off day_change = on day_change_message_1date = "-- %a, %d %b %Y --" day_change_message_2dates = "-- %%a, %%d %%b %%Y (%a, %d %b %Y) --" @@ -61,21 +72,30 @@ hotlist_short_names = on hotlist_sort = group_time_asc hotlist_suffix = "" hotlist_unique_numbers = on +hotlist_update_on_buffer_switch = on input_cursor_scroll = 20 input_share = none input_share_overwrite = off input_undo_max = 32 +item_away_message = on item_buffer_filter = "*" item_buffer_zoom = "!" +item_mouse_status = "M" item_time_format = "%H:%M" jump_current_to_previous_buffer = on jump_previous_buffer_when_closing = on jump_smart_back_to_buffer = on key_bind_safe = on +key_grab_delay = 800 mouse = off mouse_timer_delay = 100 +nick_color_force = "" +nick_color_hash = djb2 +nick_color_hash_salt = "" +nick_color_stop_chars = "_|[" nick_prefix = "" nick_suffix = "" +paste_auto_add_newline = on paste_bracketed = on paste_bracketed_timer_delay = 10 paste_max_lines = 1 @@ -94,11 +114,17 @@ prefix_join = "-->" prefix_network = "--" prefix_quit = "<--" prefix_same_nick = "" +prefix_same_nick_middle = "" prefix_suffix = "│" +quote_nick_prefix = "<" +quote_nick_suffix = ">" +quote_time_format = "%H:%M:%S" read_marker = line read_marker_always_show = off read_marker_string = "- " +read_marker_update_on_buffer_switch = on save_config_on_exit = on +save_config_with_fsync = off save_layout_on_exit = none scroll_amount = 3 scroll_bottom_after_switch = off @@ -112,6 +138,8 @@ window_auto_zoom = off window_separator_horizontal = on window_separator_vertical = on window_title = "WeeChat ${info:version}" +word_chars_highlight = "!\u00A0,-,_,|,alnum" +word_chars_input = "!\u00A0,-,_,|,alnum" [palette] @@ -155,10 +183,12 @@ chat_text_found_bg = lightmagenta chat_time = default chat_time_delimiters = brown chat_value = cyan +chat_value_null = blue emphasized = 130 emphasized_bg = magenta input_actions = lightgreen input_text_not_found = red +item_away = yellow nicklist_away = cyan nicklist_group = green separator = 235 @@ -172,6 +202,7 @@ status_data_other = default status_data_private = lightgreen status_filter = green status_more = 130 +status_mouse = green status_name = white status_name_ssl = lightgreen status_nicklist_count = default @@ -180,8 +211,10 @@ status_time = default [completion] base_word_until_cursor = on +command_inline = on default_template = "%(nicks)|%(irc_channels)" nick_add_space = on +nick_case_sensitive = off nick_completer = ": " nick_first_only = off nick_ignore_chars = "[]`_-^" @@ -190,6 +223,7 @@ partial_completion_command = off partial_completion_command_arg = off partial_completion_count = on partial_completion_other = off +partial_completion_templates = "config_options" [history] display_default = 5 @@ -202,7 +236,8 @@ max_visited_buffers = 50 [network] connection_timeout = 60 -gnutls_ca_file = "/etc/ssl/certs/ca-certificates.crt" +gnutls_ca_system = on +gnutls_ca_user = "" gnutls_handshake_timeout = 30 proxy_curl = "" @@ -213,8 +248,16 @@ extension = ".so,.dll" path = "%h/plugins" save_config_on_unload = on +[signal] +sighup = "${if:${info:weechat_headless}?/reload:/quit -yes}" +sigquit = "/quit -yes" +sigterm = "/quit -yes" +sigusr1 = "" +sigusr2 = "" + [bar] buflist.color_bg = default +buflist.color_bg_inactive = default buflist.color_delim = default buflist.color_fg = default buflist.conditions = "" @@ -228,7 +271,23 @@ buflist.separator = on buflist.size = 0 buflist.size_max = 0 buflist.type = root +fset.color_bg = default +fset.color_bg_inactive = default +fset.color_delim = cyan +fset.color_fg = default +fset.conditions = "${buffer.full_name} == fset.fset" +fset.filling_left_right = vertical +fset.filling_top_bottom = horizontal +fset.hidden = off +fset.items = "fset" +fset.position = top +fset.priority = 0 +fset.separator = on +fset.size = 3 +fset.size_max = 3 +fset.type = window isetbar.color_bg = default +isetbar.color_bg_inactive = default isetbar.color_delim = cyan isetbar.color_fg = default isetbar.conditions = "" @@ -243,6 +302,7 @@ isetbar.size = 3 isetbar.size_max = 3 isetbar.type = window nicklist.color_bg = default +nicklist.color_bg_inactive = default nicklist.color_delim = cyan nicklist.color_fg = default nicklist.conditions = "${nicklist}" @@ -257,6 +317,7 @@ nicklist.size = 0 nicklist.size_max = 0 nicklist.type = window rootinput.color_bg = default +rootinput.color_bg_inactive = default rootinput.color_delim = cyan rootinput.color_fg = default rootinput.conditions = "" @@ -271,6 +332,7 @@ rootinput.size = 1 rootinput.size_max = 0 rootinput.type = root rootstatus.color_bg = 235 +rootstatus.color_bg_inactive = default rootstatus.color_delim = lightcyan rootstatus.color_fg = default rootstatus.conditions = "" @@ -285,6 +347,7 @@ rootstatus.size = 1 rootstatus.size_max = 0 rootstatus.type = root title.color_bg = 235 +title.color_bg_inactive = default title.color_delim = lightcyan title.color_fg = default title.conditions = "" @@ -311,6 +374,7 @@ default.window = "3;1;0;0;core;weechat" default.current = on [notify] +perl.highmon = none [filter] @@ -342,6 +406,11 @@ ctrl-U = "/input delete_beginning_of_line" ctrl-W = "/input delete_previous_word" ctrl-X = "/input switch_active_buffer" ctrl-Y = "/input clipboard_paste" +meta-ctrl-M = "/input insert \n" +meta-meta-OP = "/bar scroll buflist * b" +meta-meta-OQ = "/bar scroll buflist * e" +meta-meta2-11~ = "/bar scroll buflist * b" +meta-meta2-12~ = "/bar scroll buflist * e" meta-meta2-1~ = "/window scroll_top" meta-meta2-23~ = "/bar scroll nicklist * b" meta-meta2-24~ = "/bar scroll nicklist * e" @@ -369,16 +438,24 @@ meta-9 = "/buffer *9" meta-< = "/input jump_previously_visited_buffer" meta-= = "/filter toggle" meta-> = "/input jump_next_visited_buffer" +meta-B = "/buflist toggle" +meta-N = "/bar toggle nicklist" meta-OA = "/input history_global_previous" meta-OB = "/input history_global_next" meta-OC = "/input move_next_word" meta-OD = "/input move_previous_word" meta-OF = "/input move_end_of_line" meta-OH = "/input move_beginning_of_line" +meta-OP = "/bar scroll buflist * -100%" +meta-OQ = "/bar scroll buflist * +100%" meta-Oa = "/input history_global_previous" meta-Ob = "/input history_global_next" meta-Oc = "/input move_next_word" meta-Od = "/input move_previous_word" +meta2-11^ = "/bar scroll buflist * -100%" +meta2-11~ = "/bar scroll buflist * -100%" +meta2-12^ = "/bar scroll buflist * +100%" +meta2-12~ = "/bar scroll buflist * +100%" meta2-15~ = "/buffer -1" meta2-17~ = "/buffer +1" meta2-18~ = "/window -1" @@ -389,18 +466,26 @@ meta2-1;3C = "/buffer +1" meta2-1;3D = "/buffer -1" meta2-1;3F = "/window scroll_bottom" meta2-1;3H = "/window scroll_top" +meta2-1;3P = "/bar scroll buflist * b" +meta2-1;3Q = "/bar scroll buflist * e" meta2-1;5A = "/input history_global_previous" meta2-1;5B = "/input history_global_next" meta2-1;5C = "/input move_next_word" meta2-1;5D = "/input move_previous_word" +meta2-1;5P = "/bar scroll buflist * -100%" +meta2-1;5Q = "/bar scroll buflist * +100%" meta2-1~ = "/input move_beginning_of_line" meta2-200~ = "/input paste_start" meta2-201~ = "/input paste_stop" meta2-20~ = "/bar scroll title * -30%" meta2-21~ = "/bar scroll title * +30%" meta2-23;3~ = "/bar scroll nicklist * b" +meta2-23;5~ = "/bar scroll nicklist * -100%" +meta2-23^ = "/bar scroll nicklist * -100%" meta2-23~ = "/bar scroll nicklist * -100%" meta2-24;3~ = "/bar scroll nicklist * e" +meta2-24;5~ = "/bar scroll nicklist * +100%" +meta2-24^ = "/bar scroll nicklist * +100%" meta2-24~ = "/bar scroll nicklist * +100%" meta2-3~ = "/input delete_next_char" meta2-4~ = "/input move_end_of_line" @@ -425,7 +510,10 @@ meta-a = "/input jump_smart" meta-b = "/input move_previous_word" meta-d = "/input delete_next_word" meta-f = "/input move_next_word" -meta-h = "/input hotlist_clear" +meta-hmeta-R = "/input hotlist_restore_all" +meta-hmeta-c = "/input hotlist_clear" +meta-hmeta-m = "/input hotlist_remove_buffer" +meta-hmeta-r = "/input hotlist_restore_buffer" meta-jmeta-f = "/buffer -" meta-jmeta-l = "/buffer +" meta-jmeta-r = "/server raw" @@ -555,6 +643,7 @@ ctrl-_ = "/input undo" ctrl-I = "/input search_switch_where" ctrl-J = "/input search_stop" ctrl-M = "/input search_stop" +ctrl-Q = "/input search_stop" ctrl-R = "/input search_switch_regex" meta2-A = "/input search_previous" meta2-B = "/input search_next" @@ -592,6 +681,10 @@ meta2-D = "/cursor move left" @bar(nicklist):button1-gesture-down-long = "/bar scroll nicklist ${_window_number} e" @bar(nicklist):button1-gesture-up = "/bar scroll nicklist ${_window_number} -100%" @bar(nicklist):button1-gesture-up-long = "/bar scroll nicklist ${_window_number} b" +@chat(fset.fset):button1 = "/window ${_window_number};/fset -go ${_chat_line_y}" +@chat(fset.fset):button2* = "hsignal:fset_mouse" +@chat(fset.fset):wheeldown = "/fset -down 5" +@chat(fset.fset):wheelup = "/fset -up 5" @chat(perl.iset):button1 = "hsignal:iset_mouse" @chat(perl.iset):button2* = "hsignal:iset_mouse" @chat(perl.iset):wheeldown = "/repeat 5 /iset **down" @@ -605,6 +698,12 @@ meta2-D = "/cursor move left" @item(buffer_nicklist):button1-gesture-left-long = "/window ${_window_number};/kickban ${nick}" @item(buffer_nicklist):button2 = "/window ${_window_number};/whois ${nick}" @item(buffer_nicklist):button2-gesture-left = "/window ${_window_number};/ban ${nick}" +@item(buflist):button1* = "hsignal:buflist_mouse" +@item(buflist):button2* = "hsignal:buflist_mouse" +@item(buflist2):button1* = "hsignal:buflist_mouse" +@item(buflist2):button2* = "hsignal:buflist_mouse" +@item(buflist3):button1* = "hsignal:buflist_mouse" +@item(buflist3):button2* = "hsignal:buflist_mouse" @bar:wheeldown = "/bar scroll ${_bar_name} ${_window_number} +20%" @bar:wheelup = "/bar scroll ${_bar_name} ${_window_number} -20%" @chat:button1 = "/window ${_window_number}" diff --git a/.weechat/weechat.log b/.weechat/weechat.log deleted file mode 100644 index 04dfc57..0000000 --- a/.weechat/weechat.log +++ /dev/null @@ -1,32 +0,0 @@ -[2021-09-21 11:43:46] WeeChat 3.3 (compiled on Sep 19 2021 12:08:53) -[2021-09-21 11:43:46] Reading configuration file sec.conf -[2021-09-21 11:43:46] Reading configuration file weechat.conf -[2021-09-21 11:43:46] Reading configuration file plugins.conf -[2021-09-21 11:43:47] Reading configuration file charset.conf -[2021-09-21 11:43:47] Reading configuration file logger.conf -[2021-09-21 11:43:47] Reading configuration file exec.conf -[2021-09-21 11:43:47] Reading configuration file trigger.conf -[2021-09-21 11:43:47] Writing configuration file spell.conf (default options) -[2021-09-21 11:43:47] Reading configuration file spell.conf -[2021-09-21 11:43:47] Reading configuration file alias.conf -[2021-09-21 11:43:47] Reading configuration file buflist.conf -[2021-09-21 11:43:47] Writing configuration file fifo.conf (default options) -[2021-09-21 11:43:47] Reading configuration file fifo.conf -[2021-09-21 11:43:47] Writing configuration file typing.conf (default options) -[2021-09-21 11:43:47] Reading configuration file typing.conf -[2021-09-21 11:43:47] Reading configuration file xfer.conf -[2021-09-21 11:43:47] Reading configuration file irc.conf -[2021-09-21 11:43:47] Reading configuration file relay.conf -[2021-09-21 11:43:47] Writing configuration file perl.conf (default options) -[2021-09-21 11:43:47] Reading configuration file perl.conf -[2021-09-21 11:43:47] Reading configuration file iset.conf -[2021-09-21 11:43:47] Writing configuration file lua.conf (default options) -[2021-09-21 11:43:47] Reading configuration file lua.conf -[2021-09-21 11:43:47] Writing configuration file python.conf (default options) -[2021-09-21 11:43:47] Reading configuration file python.conf -[2021-09-21 11:43:48] Writing configuration file ruby.conf (default options) -[2021-09-21 11:43:48] Reading configuration file ruby.conf -[2021-09-21 11:43:48] Reading configuration file script.conf -[2021-09-21 11:43:48] Writing configuration file fset.conf (default options) -[2021-09-21 11:43:48] Reading configuration file fset.conf -[2021-09-21 11:43:48] irc: connecting to server team.tilde.chat/6697 (SSL)... diff --git a/.weechat/xfer.conf b/.weechat/xfer.conf index 10d14d7..8373fd0 100644 --- a/.weechat/xfer.conf +++ b/.weechat/xfer.conf @@ -1,5 +1,12 @@ # -# xfer.conf -- weechat v1.0.1 +# weechat -- xfer.conf +# +# WARNING: It is NOT recommended to edit this file by hand, +# especially if WeeChat is running. +# +# Use commands like /set or /fset to change settings in WeeChat. +# +# For more info, see: https://weechat.org/doc/quickstart # [look] @@ -23,7 +30,9 @@ blocksize = 65536 fast_send = on own_ip = "" port_range = "" -speed_limit = 0 +send_ack = on +speed_limit_recv = 0 +speed_limit_send = 0 timeout = 300 [file] @@ -35,5 +44,6 @@ auto_rename = on auto_resume = on convert_spaces = on download_path = "%h/xfer" +download_temporary_suffix = ".part" upload_path = "~" use_nick_in_filename = on