···66#
77# Use commands like /set or /fset to change settings in WeeChat.
88#
99-# For more info, see: https://weechat.org/doc/quickstart/
99+# For more info, see: https://weechat.org/doc/weechat/quickstart/
1010#
11111212[sorting]
+1-1
weechat/.weechat/buffer_autoset.conf
···66#
77# Use commands like /set or /fset to change settings in WeeChat.
88#
99-# For more info, see: https://weechat.org/doc/quickstart/
99+# For more info, see: https://weechat.org/doc/weechat/quickstart/
1010#
11111212[look]
+1-1
weechat/.weechat/buflist.conf
···66#
77# Use commands like /set or /fset to change settings in WeeChat.
88#
99-# For more info, see: https://weechat.org/doc/quickstart/
99+# For more info, see: https://weechat.org/doc/weechat/quickstart/
1010#
11111212[look]
+1-1
weechat/.weechat/charset.conf
···66#
77# Use commands like /set or /fset to change settings in WeeChat.
88#
99-# For more info, see: https://weechat.org/doc/quickstart/
99+# For more info, see: https://weechat.org/doc/weechat/quickstart/
1010#
11111212[default]
+1-1
weechat/.weechat/colorize_nicks.conf
···66#
77# Use commands like /set or /fset to change settings in WeeChat.
88#
99-# For more info, see: https://weechat.org/doc/quickstart/
99+# For more info, see: https://weechat.org/doc/weechat/quickstart/
1010#
11111212[look]
+1-1
weechat/.weechat/exec.conf
···66#
77# Use commands like /set or /fset to change settings in WeeChat.
88#
99-# For more info, see: https://weechat.org/doc/quickstart/
99+# For more info, see: https://weechat.org/doc/weechat/quickstart/
1010#
11111212[command]
+1-1
weechat/.weechat/fifo.conf
···66#
77# Use commands like /set or /fset to change settings in WeeChat.
88#
99-# For more info, see: https://weechat.org/doc/quickstart/
99+# For more info, see: https://weechat.org/doc/weechat/quickstart/
1010#
11111212[file]
+18-14
weechat/.weechat/fset.conf
···66#
77# Use commands like /set or /fset to change settings in WeeChat.
88#
99-# For more info, see: https://weechat.org/doc/quickstart/
99+# For more info, see: https://weechat.org/doc/weechat/quickstart/
1010#
11111212[look]
···2020show_plugins_desc = off
2121sort = "~name"
2222unmarked_string = " "
2323-use_color_value = off
2323+use_color_value = on
2424use_keys = on
2525use_mute = off
2626···3232option2 = "${marked} ${name} ${type} ${value2}${newline} ${empty_name} ${_default_value}${color:darkgray} -- ${min}..${max}${newline} ${empty_name} ${description}"
33333434[color]
3535+allowed_values = default
3636+allowed_values_selected = white
3737+color_name = 246
3838+color_name_selected = default
3539default_value = default
3640default_value_selected = white
3737-description = default
3838-description_selected = white
4141+description = 242
4242+description_selected = default
3943file = default
4044file_changed = brown
4145file_changed_selected = yellow
···4751help_values = default
4852index = cyan
4953index_selected = lightcyan
5050-line_marked_bg1 = default
5151-line_marked_bg2 = default
5252-line_selected_bg1 = blue
5353-line_selected_bg2 = red
5454+line_marked_bg1 = 17
5555+line_marked_bg2 = 17
5656+line_selected_bg1 = 24
5757+line_selected_bg2 = 24
5458marked = brown
5559marked_selected = yellow
5660max = default
···5862min = default
5963min_selected = white
6064name = default
6161-name_changed = brown
6565+name_changed = 185
6266name_changed_selected = yellow
6367name_selected = white
6468option = default
···8488title_filter = yellow
8589title_marked_options = lightgreen
8690title_sort = white
8787-type = green
8888-type_selected = lightgreen
9191+type = 138
9292+type_selected = 216
8993unmarked = default
9094unmarked_selected = white
9191-value = cyan
9292-value_changed = brown
9595+value = 38
9696+value_changed = 185
9397value_changed_selected = yellow
9494-value_selected = lightcyan
9898+value_selected = 159
9599value_undef = magenta
96100value_undef_selected = lightmagenta
···66#
77# Use commands like /set or /fset to change settings in WeeChat.
88#
99-# For more info, see: https://weechat.org/doc/quickstart/
99+# For more info, see: https://weechat.org/doc/weechat/quickstart/
1010#
11111212[look]
···1414backlog_conditions = ""
15151616[color]
1717-backlog_end = default
1818-backlog_line = default
1717+backlog_end = 246
1818+backlog_line = 246
19192020[file]
2121auto_log = on
···2323flush_delay = 120
2424fsync = off
2525info_lines = off
2626+log_conditions = ""
2627mask = "$plugin.$name.weechatlog"
2728name_lower_case = on
2829nick_prefix = ""
2930nick_suffix = ""
3031path = "%h/logs/"
3132replacement_char = "_"
3333+rotation_compression_level = 20
3434+rotation_compression_type = none
3535+rotation_size_max = "0"
3236time_format = "%Y-%m-%d %H:%M:%S"
33373438[level]
3535-core.weechat = 0
3939+core.weechat = 1
3640irc = 3
3737-irc.server.pisslocal = 0
38413942[mask]
+1-1
weechat/.weechat/perl.conf
···66#
77# Use commands like /set or /fset to change settings in WeeChat.
88#
99-# For more info, see: https://weechat.org/doc/quickstart/
99+# For more info, see: https://weechat.org/doc/weechat/quickstart/
1010#
11111212[look]
+3-2
weechat/.weechat/perl/colorize_lines.pl
···1919# along with this program. If not, see <http://www.gnu.org/licenses/>.
20202121# history:
2222+# 4.0.1: fix display of multiline messages
2223# 4.0: add compatibility with XDG directories (WeeChat >= 3.2)
2324# 3.9: add compatibility with new weechat_print modifier data (WeeChat >= 2.9)
2425# 3.8: new option custom_action_text (https://github.com/weechat/scripts/issues/313) (idea by 3v1n0)
···88898990use strict;
9091my $PRGNAME = "colorize_lines";
9191-my $VERSION = "4.0";
9292+my $VERSION = "4.0.1";
9293my $AUTHOR = "Nils Görs <weechatter\@arcor.de>";
9394my $LICENCE = "GPL3";
9495my $DESCR = "Colorize users' text in chat area with their nick color, including highlights";
···172173 my $servername = weechat::buffer_get_string($buf_ptr, "localvar_server");
173174174175 # find stuff between \t
175175- $string =~ m/^([^\t]*)\t(.*)/;
176176+ $string =~ m/^([^\t]*)\t(.*)/s;
176177 my $left = $1;
177178 my $right = $2;
178179
+6-3
weechat/.weechat/plugins.conf
···66#
77# Use commands like /set or /fset to change settings in WeeChat.
88#
99-# For more info, see: https://weechat.org/doc/quickstart/
99+# For more info, see: https://weechat.org/doc/weechat/quickstart/
1010#
11111212[var]
···6161python.autosavekey.mute = "off"
6262python.autosavekey.secure = "on"
6363python.buffer_autoclose.age_limit = "30"
6464-python.buffer_autoclose.ignore = "bitlbee.maddie"
6464+python.buffer_autoclose.ignore = "bitlbee.marley"
6565python.buffer_autoclose.interval = "1"
6666+python.buffer_autoclose.prefer = ""
6667python.check_license = "off"
6768python.completion.replace_values = "shrug=>¯\_(ツ)_/¯;;wiki=>https://tilde.team/wiki/;;sword=>o()xxxx[{::::::::::::::::::::::::::::::::::>;;lenny=>( ͡° ͜ʖ ͡°);;byobu=>https://superuser.com/a/423397/866501;;fg=>(☞゚ヮ゚)☞;;huh=>(-_-)ゞ゛;;tablefix=>┬─┬ノ( º _ ºノ);;weedoc=>https://weechat.org/files/doc/stable/weechat_user.en.html;;weekeys=>https://weechat.org/files/doc/stable/weechat_user.en.html#key_bindings;;denko=>(´・ω・`);;yuno=>ლ(́ಠ◞益◟ಠ‵ლ);;tf=>(ノಥ益ಥ)ノ彡┻━┻;;tb=>┬─┬ノ( º _ ºノ);;ducc=>・゜゜・。。・゜゜\_o< QUACK!;;wat=>https://bhh.sh/wat.jpg;;matrix=>https://www.moparisthebest.com/images/xmpp-vs-matrix.jpg;;servers=>https://tilde.wiki/wiki/User:Ben/Servers;;nft=>https://youtu.be/YQ_xWvX1n9g"
6869python.go.auto_jump = "off"
···7576python.go.color_number_selected = "yellow,red"
7677python.go.fuzzy_search = "on"
7778python.go.message = "Go to: "
7979+python.go.min_chars = "0"
7880python.go.short_name = "off"
7981python.go.short_name_server = "off"
8082python.go.sort = "number,beginning"
···9698python.screen_away.away_suffix = ""
9799python.screen_away.command_on_attach = ""
98100python.screen_away.command_on_detach = ""
9999-python.screen_away.ignore = ""
101101+python.screen_away.ignore = "thermite"
100102python.screen_away.ignore_relays = "on"
101103python.screen_away.interval = "5"
102104python.screen_away.message = "detached from byobu"
···198200python.go.color_number_selected = "color for selected buffer number (default: "yellow,red")"
199201python.go.fuzzy_search = "search buffer matches using approximation (default: "off")"
200202python.go.message = "message to display before list of buffers (default: "Go to: ")"
203203+python.go.min_chars = "Minimum chars to search and display list of matching buffers (default: "0")"
201204python.go.short_name = "display and search in short names instead of buffer name (default: "off")"
202205python.go.short_name_server = "prefix short names with server names for search and display (default: "off")"
203206python.go.sort = "comma-separated list of keys to sort buffers (the order is important, sorts are performed in the given order): name = sort by name (or short name), (default: "number,beginning")"
+1-1
weechat/.weechat/python.conf
···66#
77# Use commands like /set or /fset to change settings in WeeChat.
88#
99-# For more info, see: https://weechat.org/doc/quickstart/
99+# For more info, see: https://weechat.org/doc/weechat/quickstart/
1010#
11111212[look]
-121
weechat/.weechat/python/aformat.py
···11-# -*- coding: utf-8 -*-
22-#
33-# Copyright (c) 2016 Hairo R. Carela <hairocr8@gmail.com>
44-#
55-# Everyone is permitted to copy and distribute verbatim or modified
66-# copies of this license document, and changing it is allowed as long
77-# as the name is changed.
88-#
99-# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
1010-# TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
1111-#
1212-# 0. You just DO WHAT THE FUCK YOU WANT TO.
1313-#
1414-# Alternate way of text formatting, useful for relays without text formatting
1515-# features (Glowingbear, WeechatAndroid, etc)
1616-#
1717-# Usage:
1818-# /aformat *text* for bold text
1919-# /aformat /text/ for italic text
2020-# /aformat _text_ for underlined text
2121-# /aformat |text| for reversed (black on white) text
2222-#
2323-# History:
2424-# 2016-09-24:
2525-# v0.1: Initial release
2626-# 2018-06-19:
2727-# v0.2: py3k-ok
2828-#
2929-# TODO:
3030-# - Colors support
3131-3232-import sys
3333-3434-try:
3535- import weechat
3636- from weechat import WEECHAT_RC_OK
3737- import_ok = True
3838-except ImportError:
3939- print("This script must be run under WeeChat.")
4040- print("Get WeeChat now at: http://www.weechat.org/")
4141- import_ok = False
4242-4343-SCRIPT_NAME = "aformat"
4444-SCRIPT_AUTHOR = "Hairo R. Carela <hairocr8@gmail.com>"
4545-SCRIPT_VERSION = "0.2"
4646-SCRIPT_LICENSE = "WTFPL"
4747-SCRIPT_DESC = ("Alternate way of text formatting, see /help for instructions")
4848-4949-PY3 = sys.version > '3'
5050-5151-class format:
5252- # Special byte sequences, using weechat.color("stuff") had some unwanted
5353- # results, i'll look into it if needed. Colors are unused for now
5454- BOLD = '\x02'
5555- ITALIC = '\x1D'
5656- UNDERLINE = '\x1F'
5757- REVERSE = '\x16'
5858- END = '\x0F'
5959-6060-if PY3:
6161- unichr = chr
6262- def send(buf, text):
6363- weechat.command(buf, "/input send {}".format(text))
6464-else:
6565- def send(buf, text):
6666- weechat.command(buf, "/input send {}".format(text.encode("utf-8")))
6767-6868-def cb_aformat_cmd(data, buf, args):
6969- if not PY3:
7070- args = args.decode("utf-8")
7171-7272- # Get the indexes of the separators (*/_|) in the string
7373- bolds = [i for i, ltr in enumerate(args) if ltr == "*"]
7474- italics = [i for i, ltr in enumerate(args) if ltr == "/"]
7575- underlines = [i for i, ltr in enumerate(args) if ltr == "_"]
7676- reverses = [i for i, ltr in enumerate(args) if ltr == "|"]
7777-7878- if len(bolds) != 0:
7979- for i, v in enumerate(bolds):
8080- if i%2 == 0:
8181- args = args[:v] + format.BOLD + args[v+1:]
8282- else:
8383- args = args[:v] + format.END + args[v+1:]
8484-8585- if len(italics) != 0:
8686- for i, v in enumerate(italics):
8787- if i%2 == 0:
8888- args = args[:v] + format.ITALIC + args[v+1:]
8989- else:
9090- args = args[:v] + format.END + args[v+1:]
9191-9292- if len(underlines) != 0:
9393- for i, v in enumerate(underlines):
9494- if i%2 == 0:
9595- args = args[:v] + format.UNDERLINE + args[v+1:]
9696- else:
9797- args = args[:v] + format.END + args[v+1:]
9898-9999- if len(reverses) != 0:
100100- for i, v in enumerate(reverses):
101101- if i%2 == 0:
102102- args = args[:v] + format.REVERSE + args[v+1:]
103103- else:
104104- args = args[:v] + format.END + args[v+1:]
105105-106106- send(buf, args)
107107- return weechat.WEECHAT_RC_OK
108108-109109-110110-if import_ok and __name__ == "__main__":
111111- weechat.register(SCRIPT_NAME, SCRIPT_AUTHOR, SCRIPT_VERSION,
112112- SCRIPT_LICENSE, SCRIPT_DESC, '', '')
113113- weechat.hook_command("aformat", "Alternate way of text formatting, useful for relays without text formatting features (Glowingbear, WeechatAndroid, etc)",
114114- "text <*/_|> text <*/_|> more text",
115115- " *: bold text\n"
116116- " /: italic text\n"
117117- " _: underlined text\n"
118118- " |: reversed (black on white) text\n\n"
119119- " eg.: typing: /aformat This /must/ be the *work* of an _enemy_ |stand|\n"
120120- " will output: This {0}must{4} be the {1}work{4} of an {2}enemy{4} {3}stand{4}".format(weechat.color("italic"), weechat.color("bold"), weechat.color("underline"), weechat.color("reverse"), weechat.color("reset")),
121121- "", "cb_aformat_cmd", "")
···25252626#
2727# Changelog:
2828+# 3.10:
2929+# * Fix exception in `/autosort helpers swap`.
2830# 3.9:
2931# * Remove `buffers.pl` from recommended settings.
3032# 3,8:
···87898890SCRIPT_NAME = 'autosort'
8991SCRIPT_AUTHOR = 'Maarten de Vries <maarten@de-vri.es>'
9090-SCRIPT_VERSION = '3.9'
9292+SCRIPT_VERSION = '3.10'
9193SCRIPT_LICENSE = 'GPL3'
9294SCRIPT_DESC = 'Flexible automatic (or manual) buffer sorting based on eval expressions.'
9395···616618 except KeyError as e:
617619 raise HumanReadableError('No such helper: {0}'.format(e.args[0]))
618620619619- config.helpers.swap(index_a, index_b)
620621 config.save_helpers()
621622 command_helper_list(buffer, command, '')
622623 return weechat.WEECHAT_RC_OK
···829830830831def add_completions(completion, words):
831832 for word in words:
832832- weechat.hook_completion_list_add(completion, word, 0, weechat.WEECHAT_LIST_POS_END)
833833+ weechat.completion_list_add(completion, word, 0, weechat.WEECHAT_LIST_POS_END)
833834834835def autosort_complete_rules(words, completion):
835836 if len(words) == 0:
···1001100210021003{*white}# Recommended settings
10031004For the best visual effect, consider setting the following options:
10041004- {*white}/set {cyan}irc.look.server_buffer{reset} {brown}independent{reset}
10051005+{*white}/set {cyan}irc.look.server_buffer{reset} {brown}independent{reset}
1005100610061007This setting allows server buffers to be sorted independently, which is
10071008needed to create a hierarchical tree view of the server and channel buffers.
1008100910091010If you are using the {*default}buflist{reset} plugin you can (ab)use Unicode to draw a tree
10101011structure with the following setting (modify to suit your need):
10111011- {*white}/set {cyan}buflist.format.indent {brown}"${{color:237}}${{if:${{buffer.next_buffer.local_variables.type}}=~^(channel|private)$?├─:└─}}"{reset}
10121012+{*white}/set {cyan}buflist.format.indent {brown}"${{color:237}}${{if:${{buffer.next_buffer.local_variables.type}}=~^(channel|private)$?├─:└─}}"{reset}
10121013'''
1013101410141015command_completion = '%(plugin_autosort) %(plugin_autosort) %(plugin_autosort) %(plugin_autosort) %(plugin_autosort)'
-114
weechat/.weechat/python/bitlbee_completion.py
···11-# -*- coding: utf-8 -*-
22-# Add tab completion to bitlbee commands
33-# based on http://scripts.irssi.org/scripts/bitlbee_tab_completion.pl
44-#
55-# History:
66-#
77-# 2015-11-02, Mickaël Thomas <mickael9@gmail.com>:
88-# version 0.2: strip color attributes for topic detection
99-# 2015-03-22, Roger Duran <rogerduran@gmail.com>:
1010-# version 0.1: initial version
1111-1212-import weechat
1313-1414-SCRIPT_NAME = "bitlbee_completion"
1515-SCRIPT_AUTHOR = "Roger Duran <rogerduran@gmail.com>"
1616-SCRIPT_VERSION = "0.2"
1717-SCRIPT_LICENSE = "GPL3"
1818-SCRIPT_DESC = "Add tab completion to bitlbee commands"
1919-2020-OPTS = {
2121- "server": None,
2222- "channel": None
2323- }
2424-2525-TOPIC = "Welcome to the control channel. "\
2626- "Type help for help information."
2727-2828-commands = []
2929-3030-3131-def request_completion():
3232- """
3333- Request the completion to the bitlbee server and wait for response
3434- """
3535- server = OPTS["server"]
3636- weechat.command(server, "/quote -server %s COMPLETIONS" % server)
3737-3838-3939-def modifier_cb(data, modifier, modifier_data, string):
4040- """
4141- When the server returns the completion, update the commands list
4242- """
4343-4444- if ":COMPLETIONS" not in string:
4545- return string
4646- command = string.split(":COMPLETIONS ")[1]
4747- if command not in ("OK", "END"):
4848- commands.append(command)
4949- return ""
5050-5151-5252-def bitlbee_completion(data, completion_item, buffer, completion):
5353- """
5454- Complete bitlbee commands only in the bitlbee buffer
5555- """
5656-5757- server = OPTS["server"]
5858- channel = OPTS["channel"]
5959- if not server or not channel:
6060- return weechat.WEECHAT_RC_OK
6161-6262- buff_name = weechat.buffer_get_string(buffer, "name")
6363- if buff_name == "%s.%s" % (server, channel):
6464- for command in commands:
6565- weechat.hook_completion_list_add(completion, command, 0,
6666- weechat.WEECHAT_LIST_POS_SORT)
6767- return weechat.WEECHAT_RC_OK
6868-6969-7070-def find_buffer():
7171- """
7272- Find the buffer when the plugin starts
7373- """
7474- infolist = weechat.infolist_get("buffer", "", "")
7575- while weechat.infolist_next(infolist):
7676- topic = weechat.infolist_string(infolist, "title")
7777- if weechat.string_remove_color(topic, "") == TOPIC:
7878- name = weechat.infolist_string(infolist, "name")
7979- set_options(name)
8080- request_completion()
8181- break
8282- weechat.infolist_free(infolist)
8383-8484-8585-def set_options(name):
8686- server, channel = name.split(".")
8787- OPTS["server"] = server
8888- OPTS["channel"] = channel
8989-9090-9191-def print_332(data, buffer, time, tags, displayed, highlight, prefix, message):
9292- """
9393- Find the buffer when a new one is open
9494- """
9595- if weechat.string_remove_color(message, "") == TOPIC:
9696- name = weechat.buffer_get_string(buffer, "name")
9797- set_options(name)
9898- request_completion()
9999- return weechat.WEECHAT_RC_OK
100100-101101-102102-def main():
103103- weechat.hook_modifier("irc_in_notice", "modifier_cb", "")
104104- weechat.hook_completion("bitlbee", "bitlbee completion",
105105- "bitlbee_completion", "")
106106-107107- weechat.hook_print('', 'irc_332', '', 1, 'print_332', '')
108108- weechat.hook_print('', 'irc_topic', '', 1, 'print_332', '')
109109- find_buffer()
110110-111111-if __name__ == "__main__":
112112- if weechat.register(SCRIPT_NAME, SCRIPT_AUTHOR, SCRIPT_VERSION,
113113- SCRIPT_LICENSE, SCRIPT_DESC, "", ""):
114114- main()
+9-1
weechat/.weechat/python/buffer_autoclose.py
···2020# (this script requires WeeChat 0.3.0 or newer)
2121#
2222# History:
2323+# 2024-05-04, Miklos Vajna
2424+# version 0.6: Allow autoclosing explicitly listed non-private buffers as well
2325# 2018-04-10, Sébastien Helleu <flashcode@flashtux.org>
2426# version 0.5: fix infolist_time for WeeChat >= 2.2 (WeeChat returns a long
2527# integer instead of a string)
···37393840SCRIPT_NAME = "buffer_autoclose"
3941SCRIPT_AUTHOR = "xt <xt@bash.no>"
4040-SCRIPT_VERSION = "0.5"
4242+SCRIPT_VERSION = "0.6"
4143SCRIPT_LICENSE = "GPL3"
4244SCRIPT_DESC = "Automatically close inactive private message buffers"
4345···4547 'interval': '1', # How often in minutes to check
4648 'age_limit': '30', # How old in minutes before auto close
4749 'ignore': '', # Buffers to ignore (use full name: server.buffer_name)
5050+ 'prefer': '', # Buffers to prefer, even if they are not private (use full name: server.buffer_name)
4851}
49525053if w.register(SCRIPT_NAME, SCRIPT_AUTHOR, SCRIPT_VERSION, SCRIPT_LICENSE,
···6467 '''Returns list with pointers of all open buffers.'''
6568 buffers = []
6669 infolist = w.infolist_get('buffer', '', '')
7070+ preferlist = w.config_get_plugin('prefer').split(',')
6771 while w.infolist_next(infolist):
6872 buffer_type = w.buffer_get_string(w.infolist_pointer(infolist, 'pointer'), 'localvar_type')
7373+ name = w.buffer_get_string(w.infolist_pointer(infolist, 'pointer'), 'name')
7474+ if name in preferlist:
7575+ buffers.append(w.infolist_pointer(infolist, 'pointer'))
7676+ continue
6977 if buffer_type == 'private': # we only close private message buffers for now
7078 buffers.append(w.infolist_pointer(infolist, 'pointer'))
7179 w.infolist_free(infolist)
+25-10
weechat/.weechat/python/colorize_nicks.py
···2121#
2222#
2323# History:
2424+# 2023-10-30: Sébastien Helleu <flashcode@flashtux.org>
2525+# version 32: revert to info "nick_color" with WeeChat >= 4.1.1
2626+# 2023-10-16: Sébastien Helleu <flashcode@flashtux.org>
2727+# version 31: use info "irc_nick_color" on IRC buffers with WeeChat >= 4.1.0
2828+# 2022-11-07: mva
2929+# version 30: add ":" and "," to VALID_NICK regexp,
3030+# to don't reset colorization in input_line
3131+# 2022-07-11: ncfavier
3232+# version 29: check nick for exclusion *after* stripping
3333+# decrease minimum min_nick_length to 1
2434# 2020-11-29: jess
2535# version 28: fix ignore_tags having been broken by weechat 2.9 changes
2636# 2020-05-09: Sébastien Helleu <flashcode@flashtux.org>
···9010091101SCRIPT_NAME = "colorize_nicks"
92102SCRIPT_AUTHOR = "xt <xt@bash.no>"
9393-SCRIPT_VERSION = "28"
103103+SCRIPT_VERSION = "32"
94104SCRIPT_LICENSE = "GPL"
95105SCRIPT_DESC = "Use the weechat nick colors in the chat area"
9610697107# Based on the recommendations in RFC 7613. A valid nick is composed
98108# of anything but " ,*?.!@".
9999-VALID_NICK = r'([@~&!%+-])?([^\s,\*?\.!@]+)'
109109+VALID_NICK = r'([@~&!%+-])?([^\s,\*?\.!@:,]+)'
100110valid_nick_re = re.compile(VALID_NICK)
101111ignore_channels = []
102112ignore_nicks = []
···138148 colorize_config_option["min_nick_length"] = weechat.config_new_option(
139149 colorize_config_file, section_look, "min_nick_length",
140150 "integer", "Minimum length nick to colorize", "",
141141- 2, 20, "", "", 0, "", "", "", "", "", "")
151151+ 1, 20, "2", "2", 0, "", "", "", "", "", "")
142152 colorize_config_option["colorize_input"] = weechat.config_new_option(
143153 colorize_config_file, section_look, "colorize_input",
144154 "boolean", "Whether to colorize input", "", 0,
···165175 global colorize_config_file
166176 return weechat.config_read(colorize_config_file)
167177168168-def colorize_nick_color(nick, my_nick):
178178+def colorize_nick_color(buffer, nick, my_nick):
169179 ''' Retrieve nick color from weechat. '''
170180 if nick == my_nick:
171181 return w.color(w.config_string(w.config_get('weechat.color.chat_nick_self')))
172182 else:
173173- return w.info_get('irc_nick_color', nick)
183183+ version = int(w.info_get('version_number', '') or 0)
184184+ if w.buffer_get_string(buffer, 'plugin') == 'irc' and version == 0x4010000:
185185+ server = w.buffer_get_string(buffer, 'localvar_server')
186186+ return w.info_get('irc_nick_color', '%s,%s' % (server, nick))
187187+ return w.info_get('nick_color', nick)
174188175189def colorize_cb(data, modifier, modifier_data, line):
176190 ''' Callback that does the colorizing, and returns new line if changed '''
···206220207221 for words in valid_nick_re.findall(line):
208222 nick = words[1]
209209- # Check that nick is not ignored and longer than minimum length
210210- if len(nick) < min_length or nick in ignore_nicks:
211211- continue
212223213224 # If the matched word is not a known nick, we try to match the
214225 # word without its first or last character (if not a letter).
···224235 elif not nick[-1].isalpha():
225236 if nick[:-1] in colored_nicks[buffer]:
226237 nick = nick[:-1]
238238+239239+ # Check that nick is not ignored and longer than minimum length
240240+ if len(nick) < min_length or nick in ignore_nicks:
241241+ continue
227242228243 # Check that nick is in the dictionary colored_nicks
229244 if nick in colored_nicks[buffer]:
···336351 continue
337352338353 nick = w.infolist_string(nicklist, 'name')
339339- nick_color = colorize_nick_color(nick, my_nick)
354354+ nick_color = colorize_nick_color(buffer_ptr, nick, my_nick)
340355341356 colored_nicks[buffer_ptr][nick] = nick_color
342357···358373 colored_nicks[pointer] = {}
359374360375 my_nick = w.buffer_get_string(pointer, 'localvar_nick')
361361- nick_color = colorize_nick_color(nick, my_nick)
376376+ nick_color = colorize_nick_color(pointer, nick, my_nick)
362377363378 colored_nicks[pointer][nick] = nick_color
364379
+33-14
weechat/.weechat/python/go.py
···11# -*- coding: utf-8 -*-
22#
33-# Copyright (C) 2009-2014 Sébastien Helleu <flashcode@flashtux.org>
33+# Copyright (C) 2009-2023 Sébastien Helleu <flashcode@flashtux.org>
44# Copyright (C) 2010 m4v <lambdae2@gmail.com>
55# Copyright (C) 2011 stfn <stfnmd@googlemail.com>
66#
···2121#
2222# History:
2323#
2424+# 2024-05-30, Sébastien Helleu <flashcode@flashtux.org>:
2525+# version 3.0.1: refresh buffer input at the end of search
2626+# 2024-05-30, Sébastien Helleu <flashcode@flashtux.org>:
2727+# version 3.0: refresh immediately buffer input when /go command is executed
2828+# (needed for WeeChat >= 4.3.0)
2929+# 2023-06-21, Sébastien Helleu <flashcode@flashtux.org>:
3030+# version 2.9: add option "min_chars"
3131+# 2023-01-08, Sébastien Helleu <flashcode@flashtux.org>:
3232+# version 2.8: send buffer pointer with signal "input_text_changed"
2433# 2021-05-25, Tomáš Janoušek <tomi@nomi.cz>:
2534# version 2.7: add new option to prefix short names with server names
2635# 2019-07-11, Simmo Saan <simmo.saan@gmail.com>
···9610597106SCRIPT_NAME = 'go'
98107SCRIPT_AUTHOR = 'Sébastien Helleu <flashcode@flashtux.org>'
9999-SCRIPT_VERSION = '2.7'
108108+SCRIPT_VERSION = '3.0.1'
100109SCRIPT_LICENSE = 'GPL3'
101110SCRIPT_DESC = 'Quick jump to buffers'
102111···108117 import weechat
109118except ImportError:
110119 print('This script must be run under WeeChat.')
111111- print('Get WeeChat now at: http://www.weechat.org/')
120120+ print('Get WeeChat now at: https://weechat.org/')
112121 IMPORT_OK = False
113122114123import re
115124116125# script options
117126SETTINGS = {
127127+ 'auto_jump': (
128128+ 'off',
129129+ 'automatically jump to buffer when it is uniquely selected'),
130130+ 'buffer_number': (
131131+ 'on',
132132+ 'display buffer number'),
118133 'color_number': (
119134 'yellow,magenta',
120135 'color for buffer number (not selected)'),
···133148 'color_name_highlight_selected': (
134149 'red,brown',
135150 'color for highlight in a selected buffer name'),
151151+ 'fuzzy_search': (
152152+ 'off',
153153+ 'search buffer matches using approximation'),
136154 'message': (
137155 'Go to: ',
138156 'message to display before list of buffers'),
157157+ 'min_chars': (
158158+ '0',
159159+ 'Minimum chars to search and display list of matching buffers'),
139160 'short_name': (
140161 'off',
141162 'display and search in short names instead of buffer name'),
···154175 'use_core_instead_weechat': (
155176 'off',
156177 'use name "core" instead of "weechat" for core buffer'),
157157- 'auto_jump': (
158158- 'off',
159159- 'automatically jump to buffer when it is uniquely selected'),
160160- 'fuzzy_search': (
161161- 'off',
162162- 'search buffer matches using approximation'),
163163- 'buffer_number': (
164164- 'on',
165165- 'display buffer number'),
166178}
167179168180# hooks management
···208220 go_unhook_one('modifier')
209221 for hook in HOOK_COMMAND_RUN:
210222 go_unhook_one(hook)
223223+ weechat.bar_item_update('input_text')
211224212225213226def go_hook_all():
···227240 if 'modifier' not in hooks:
228241 hooks['modifier'] = weechat.hook_modifier(
229242 'input_text_display_with_cursor', 'go_input_modifier', '')
243243+ weechat.bar_item_update('input_text')
230244231245232246def go_start(buf):
···410424411425def go_buffers_to_string(listbuf, pos, strinput):
412426 """Return string built with list of buffers found (matching user input)."""
427427+ try:
428428+ if len(strinput) < int(weechat.config_get_plugin('min_chars')):
429429+ return ''
430430+ except:
431431+ pass
413432 string = ''
414433 strinput = strinput.lower()
415434 for i in range(len(listbuf)):
···500519 if buffers_pos >= len(buffers):
501520 buffers_pos = 0
502521 weechat.hook_signal_send('input_text_changed',
503503- weechat.WEECHAT_HOOK_SIGNAL_STRING, '')
522522+ weechat.WEECHAT_HOOK_SIGNAL_POINTER, buf)
504523 return weechat.WEECHAT_RC_OK_EAT
505524 elif command == '/input complete_previous':
506525 # choose previous buffer in list
···508527 if buffers_pos < 0:
509528 buffers_pos = len(buffers) - 1
510529 weechat.hook_signal_send('input_text_changed',
511511- weechat.WEECHAT_HOOK_SIGNAL_STRING, '')
530530+ weechat.WEECHAT_HOOK_SIGNAL_POINTER, buf)
512531 return weechat.WEECHAT_RC_OK_EAT
513532 elif command == '/input return':
514533 # switch to selected buffer (if any)
···11-# -*- coding: utf-8 -*-
22-#
33-# ListBuffer, version 0.8.1 for WeeChat version 0.3
44-# Latest development version: https://github.com/FiXato/listbuffer
55-#
66-# Show /list results in a common buffer and interact with them.
77-#
88-# This script allows you to easily join channels from the /list output.
99-# It will open a common buffer for the /list result, through which you
1010-# browse with your cursor keys, and join with the meta-enter keys.
1111-# Adjust sorting with meta->, meta-< and meta-/ keybindings.
1212-#
1313-## History:
1414-### 2011-09-08: FiXato:
1515-#
1616-# * version 0.1: initial release.
1717-# * added a common buffer for /list results
1818-# * added highlighting for currently selected line
1919-# * added /join support via enter key
2020-# * added scroll_top and scroll_bottom support
2121-#
2222-# * version 0.2: /list format bugfix
2323-# * added support for /list results without modes
2424-# * some servers don't send 321 (/list start). Taken into account.
2525-#
2626-# * version 0.3: Sorting support
2727-# * Added some basic sorting support. Scroll through sort options
2828-# with meta-> and meta-< (users, channel, topic, modes)
2929-#
3030-### 2011-09-19: FiXato
3131-#
3232-# * version 0.4:
3333-# * Case-insensitive buffer lookup fix.
3434-# * Removed default enter keybind
3535-#
3636-### 2011-12-28: troydm:
3737-#
3838-# * version 0.5: It's an upside-down-world
3939-# * Added inverted sorting support provided by Dmitry "troydm" Geurkov
4040-# Use meta-/ to switch between inverted and regular sorting.
4141-#
4242-### 2012-02-10: FiXato:
4343-#
4444-# * version 0.6: Stop shoving that buffer in my face!
4545-# * The listbuffer should no longer pop up by itself when you load the script.
4646-# It should only pop up now when you actually do a /list query.
4747-#
4848-# * version 0.7: .. but please pop it up in my current window when I ask for it
4949-# * Added setting plugins.var.python.listbuffer.autofocus
5050-# This will autofocus the listbuffer in the current window if another window isn't
5151-# already showing it, and of course only when the user issues /list
5252-#
5353-### 2012-07-10: FiXato:
5454-#
5555-# * version 0.7.1: Forgetful bugfix
5656-# * Made sure lb_curline global variable is defined
5757-#
5858-### 2013-03-19: FiXato:
5959-#
6060-# * version 0.8: Sorted out the sorting
6161-# * Added automatically updating options for sorting:
6262-# * plugins.var.python.listbuffer.sort_inverted
6363-# * plugins.var.python.listbuffer.sort_order
6464-# * version 0.8.1: Pad it baby!
6565-# * Channel modes are equally padded even when there are no channel modes.
6666-# * Added padding options:
6767-# * plugins.var.python.listbuffer.modes_min_width
6868-# * plugins.var.python.listbuffer.channel_min_width
6969-# * plugins.var.python.listbuffer.users_min_width
7070-#
7171-### 2019-07-05: Sébastien Helleu:
7272-#
7373-# * version 0.8.2: Make script compatible with Python 3.
7474-#
7575-## Acknowledgements:
7676-# * Dmitry "troydm" Geurkov, for providing the inverse-sorting patch to the project.
7777-# * Sebastien "Flashcode" Helleu, for developing the kick-ass IRC client WeeChat
7878-# and the iset.pl script which inspired me to this script.
7979-# * Nils "nils_2" Görs, for his contributions to iset.pl which served as
8080-# example code.
8181-# * David "drubin" Rubin, for his urlgrab.py script, which also served
8282-# as example code.
8383-# * ArZa, whose listsort.pl script helped me getting started with
8484-# grabbing the /list results. Parts of his code have been shamelessly
8585-# copied and ported to Python.
8686-# * Khaled Mardam-Bey, for making me yearn for similar /list support in
8787-# WeeChat as mIRC already offered. :P
8888-# * mave_, for pointing out that sort orders weren't remembered.
8989-#
9090-## TODO:
9191-# - Auto-scroll selected line upon window scroll.
9292-# - Add option to hide already joined channels.
9393-# - Improve sorting methods
9494-# - Add auto-join support
9595-# - Detect if channel is already in auto-join
9696-# - Allow automatically switching to the listbuffer
9797-# - Add support for ALIS (/squery alis LIST * -mix 100 (IRCNet)
9898-# - Make colours configurable
9999-# - Limit number of channels to parse
100100-# - Add filter support a la iset
101101-# - Allow selecting multiple channels
102102-# - Add optional command redirection.
103103-#
104104-## Copyright (c) 2011,2012,2013 Filip H.F. "FiXato" Slagter,
105105-# <FiXato [at] Gmail [dot] com>
106106-# http://profile.fixato.org
107107-#
108108-# Permission is hereby granted, free of charge, to any person obtaining
109109-# a copy of this software and associated documentation files (the
110110-# "Software"), to deal in the Software without restriction, including
111111-# without limitation the rights to use, copy, modify, merge, publish,
112112-# distribute, sublicense, and/or sell copies of the Software, and to
113113-# permit persons to whom the Software is furnished to do so, subject to
114114-# the following conditions:
115115-#
116116-# The above copyright notice and this permission notice shall be
117117-# included in all copies or substantial portions of the Software.
118118-#
119119-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
120120-# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
121121-# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
122122-# NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
123123-# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
124124-# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
125125-# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
126126-#
127127-128128-from __future__ import print_function
129129-130130-SCRIPT_NAME = "listbuffer"
131131-SCRIPT_AUTHOR = "Filip H.F. 'FiXato' Slagter <fixato [at] gmail [dot] com>"
132132-SCRIPT_VERSION = "0.8.2"
133133-SCRIPT_LICENSE = "MIT"
134134-SCRIPT_DESC = "A common buffer for /list output."
135135-SCRIPT_COMMAND = "listbuffer"
136136-137137-import_ok = True
138138-139139-try:
140140- import weechat
141141-except ImportError:
142142- print("This script must be run under WeeChat.")
143143- import_ok = False
144144-145145-import re
146146-147147-lb_settings = (
148148- ("autofocus", "on", "Focus the listbuffer in the current window if it isn't already displayed by a window."),
149149- ("sort_order", "users", "Last used sort order for the channel list."),
150150- ("sort_inverted", "on", "Invert the sort order for the channel list."),
151151- ("modes_min_width", "8", "The minimum width used for modes in the channel list. If a channel has less modes than this amount, the column will be padded with spaces."),
152152- ("channel_min_width", "25", "The minimum width used for the channel name in the channel list. If a channelname is shorter than this amount, the column will be padded with spaces."),
153153- ("users_min_width", "8", "The minimum width used for the usercount in the channel list. If the usercount has less digits than this amount, the column will be padded with spaces."),
154154-)
155155-lb_buffer = None
156156-lb_curline = 0
157157-lb_channels = []
158158-lb_network = None
159159-lb_list_started = False
160160-lb_current_sort = None
161161-lb_sort_inverted = False
162162-lb_sort_options = (
163163- 'channel',
164164- 'users',
165165- 'modes',
166166- 'topic',
167167-)
168168-169169-# server numeric Nick Chan Users Modes Topic
170170-lb_channel_list_expression = '(:\S+) (\d{3}) (\S+) (\S+) (\d+) :(\[(.*?)\] )?(.*)'
171171-172172-# Create listbuffer.
173173-def lb_create_buffer():
174174- global lb_buffer, lb_curline
175175-176176- if not lb_buffer:
177177- lb_buffer = weechat.buffer_new("listbuffer", "lb_input_cb", \
178178- "", "lb_close_cb", "")
179179- lb_set_buffer_title()
180180- # Sets notify to 0 as this buffer does not need to be in hotlist.
181181- weechat.buffer_set(lb_buffer, "notify", "0")
182182- weechat.buffer_set(lb_buffer, "nicklist", "0")
183183- weechat.buffer_set(lb_buffer, "type", "free")
184184- weechat.buffer_set(lb_buffer, "key_bind_ctrl-L", "/listbuffer **refresh")
185185- weechat.buffer_set(lb_buffer, "key_bind_meta2-A", "/listbuffer **up")
186186- weechat.buffer_set(lb_buffer, "key_bind_meta2-B", "/listbuffer **down")
187187- weechat.buffer_set(lb_buffer, "key_bind_meta2-1~", "/listbuffer **scroll_top")
188188- weechat.buffer_set(lb_buffer, "key_bind_meta2-4~", "/listbuffer **scroll_bottom")
189189- weechat.buffer_set(lb_buffer, "key_bind_meta-ctrl-J", "/listbuffer **enter")
190190- weechat.buffer_set(lb_buffer, "key_bind_meta-ctrl-M", "/listbuffer **enter")
191191- weechat.buffer_set(lb_buffer, "key_bind_meta->", "/listbuffer **sort_next")
192192- weechat.buffer_set(lb_buffer, "key_bind_meta-<", "/listbuffer **sort_previous")
193193- weechat.buffer_set(lb_buffer, "key_bind_meta-/", "/listbuffer **sort_invert")
194194- lb_curline = 0
195195- if weechat.config_get_plugin("autofocus") == "on":
196196- if not weechat.window_search_with_buffer(lb_buffer):
197197- weechat.command("", "/buffer " + weechat.buffer_get_string(lb_buffer,"name"))
198198-199199-def lb_set_buffer_title():
200200- global lb_buffer, lb_current_sort
201201- ascdesc = '(v)' if lb_sort_inverted else '(^)'
202202- weechat.buffer_set(lb_buffer, "title", lb_line_format({
203203- 'channel': 'Channel name%s' % (ascdesc if lb_current_sort == 'channel' else ''),
204204- 'users': 'Users%s' % (ascdesc if lb_current_sort == 'users' else ''),
205205- 'modes': 'Modes%s' % (ascdesc if lb_current_sort == 'modes' else ''),
206206- 'topic': 'Topic%s' % (ascdesc if lb_current_sort == 'topic' else ''),
207207- 'nomodes': None,
208208- }))
209209-210210-def lb_list_start(data, signal, message):
211211- lb_initialise_list
212212-213213- return weechat.WEECHAT_RC_OK
214214-215215-def lb_initialise_list(signal):
216216- global lb_channels, lb_network, lb_list_started
217217-218218- lb_create_buffer()
219219- lb_channels = []
220220- lb_network = signal.split(',')[0]
221221- lb_list_started = True
222222- return
223223-224224-225225-def lb_list_chan(data, signal, message):
226226- global lb_channels, lb_buffer, lb_list_started
227227-228228- # Work-around for IRCds which don't send 321 Numeric (/List start)
229229- if not lb_list_started:
230230- lb_initialise_list(signal)
231231-232232- for chan_data in re.findall(lb_channel_list_expression,message):
233233- lb_channels.append({
234234- 'server': chan_data[0][1:-1],
235235- 'numeric': chan_data[1],
236236- 'nick': chan_data[2],
237237- 'channel': chan_data[3],
238238- 'users': chan_data[4],
239239- 'nomodes': chan_data[5] == '',
240240- 'modes': chan_data[6],
241241- 'topic': weechat.hook_modifier_exec("irc_color_decode", "1", chan_data[7])
242242- })
243243- return weechat.WEECHAT_RC_OK
244244-245245-def lb_list_end(data, signal, message):
246246- global lb_list_started
247247-248248- # Work-around for IRCds which don't send 321 Numeric (/List start)
249249- if not lb_list_started:
250250- lb_initialise_list(signal)
251251-252252- lb_list_started = False
253253- if lb_current_sort:
254254- lb_sort()
255255- lb_refresh()
256256- return weechat.WEECHAT_RC_OK
257257-258258-def keyEvent (data, buffer, args):
259259- global lb_options
260260- lb_options[args]()
261261-262262-def lb_input_cb(data, buffer, input_data):
263263- global lb_options, lb_curline
264264- lb_options[input_data]()
265265- return weechat.WEECHAT_RC_OK
266266-267267-def lb_refresh():
268268- global lb_channels, lb_buffer
269269- weechat.buffer_clear(lb_buffer)
270270-271271- y = 0
272272- for list_data in lb_channels:
273273- lb_refresh_line(y)
274274- y += 1
275275- return
276276-277277-def lb_refresh_line(y):
278278- global lb_buffer, lb_curline, lb_channels
279279- if y >= 0 and y < len(lb_channels):
280280- formatted_line = lb_line_format(lb_channels[y], y == lb_curline)
281281- weechat.prnt_y(lb_buffer, y, formatted_line)
282282-283283-def lb_refresh_curline():
284284- global lb_curline
285285- lb_refresh_line(lb_curline-1)
286286- lb_refresh_line(lb_curline)
287287- lb_refresh_line(lb_curline+1)
288288- return
289289-290290-def lb_line_format(list_data,curr=False):
291291- str = ""
292292- if (curr):
293293- str += weechat.color("yellow,red")
294294- channel_text = list_data['channel'].ljust(int(weechat.config_get_plugin('channel_min_width')))
295295- users_text = "(%s)" % list_data['users']
296296- padded_users_text = users_text.rjust(int(weechat.config_get_plugin('users_min_width')) + 2)
297297- str += "%s%s %s " % (weechat.color("bold"), channel_text, padded_users_text)
298298- if not list_data['nomodes']:
299299- modes = "[%s]" % list_data['modes']
300300- else:
301301- modes = "[]"
302302- str += "%s: " % modes.rjust(int(weechat.config_get_plugin('modes_min_width')) + 2)
303303- str += "%s" % list_data['topic']
304304- return str
305305-306306-def lb_line_up():
307307- global lb_curline
308308- if lb_curline <= 0:
309309- return
310310- lb_curline -= 1
311311- lb_refresh_curline()
312312- lb_check_outside_window()
313313- return
314314-315315-def lb_line_down():
316316- global lb_curline, lb_channels
317317- if lb_curline+1 >= len(lb_channels):
318318- return
319319- lb_curline += 1
320320- lb_refresh_curline()
321321- lb_check_outside_window()
322322- return
323323-324324-def lb_line_run():
325325- global lb_channels, lb_curline, lb_network
326326- buff = weechat.info_get("irc_buffer", lb_network)
327327- channel = lb_channels[lb_curline]['channel']
328328- command = "/join %s" % channel
329329- weechat.command(buff, command)
330330- return
331331-332332-def lb_line_select():
333333- return
334334-335335-def lb_scroll_top():
336336- global lb_curline
337337- old_y = lb_curline
338338- lb_curline = 0
339339- lb_refresh_curline()
340340- lb_refresh_line(old_y)
341341- weechat.command(lb_buffer, "/window scroll_top")
342342- return
343343-344344-def lb_scroll_bottom():
345345- global lb_curline, lb_channels
346346- old_y = lb_curline
347347- lb_curline = len(lb_channels)-1
348348- lb_refresh_curline()
349349- lb_refresh_line(old_y)
350350- weechat.command(lb_buffer, "/window scroll_bottom")
351351- return
352352-353353-def lb_check_outside_window():
354354- global lb_buffer, lb_curline
355355- if (lb_buffer):
356356- infolist = weechat.infolist_get("window", "", "current")
357357- if (weechat.infolist_next(infolist)):
358358- start_line_y = weechat.infolist_integer(infolist, "start_line_y")
359359- chat_height = weechat.infolist_integer(infolist, "chat_height")
360360- if(start_line_y > lb_curline):
361361- weechat.command(lb_buffer, "/window scroll -%i" %(start_line_y - lb_curline))
362362- elif(start_line_y <= lb_curline - chat_height):
363363- weechat.command(lb_buffer, "/window scroll +%i"%(lb_curline - start_line_y - chat_height + 1))
364364- weechat.infolist_free(infolist)
365365-366366-def lb_sort_next():
367367- global lb_current_sort, lb_sort_options
368368- if lb_current_sort:
369369- new_index = lb_sort_options.index(lb_current_sort) + 1
370370- else:
371371- new_index = 0
372372-373373- if len(lb_sort_options) <= new_index:
374374- new_index = 0
375375-376376- lb_set_current_sort_order(lb_sort_options[new_index])
377377- lb_sort()
378378-379379-def lb_set_current_sort_order(value):
380380- global lb_current_sort
381381- lb_current_sort = value
382382- weechat.config_set_plugin('sort_order', lb_current_sort)
383383-384384-def lb_set_invert_sort_order(value):
385385- global lb_sort_inverted
386386- lb_sort_inverted = value
387387- weechat.config_set_plugin('sort_inverted', ('on' if lb_sort_inverted else 'off'))
388388-389389-def lb_sort_previous():
390390- global lb_current_sort, lb_sort_options
391391- if lb_current_sort:
392392- new_index = lb_sort_options.index(lb_current_sort) - 1
393393- else:
394394- new_index = 0
395395-396396- if new_index < 0:
397397- new_index = len(lb_sort_options) - 1
398398-399399- lb_set_current_sort_order(lb_sort_options[new_index])
400400- lb_sort()
401401-402402-def lb_sort(sort_key=None):
403403- global lb_channels, lb_current_sort, lb_sort_inverted
404404- if sort_key:
405405- lb_set_current_sort_order(sort_key)
406406- if lb_current_sort == 'users':
407407- lb_channels = sorted(lb_channels, key=lambda chan_data: int(chan_data[lb_current_sort]))
408408- else:
409409- lb_channels = sorted(lb_channels, key=lambda chan_data: chan_data[lb_current_sort])
410410- if lb_sort_inverted:
411411- lb_channels.reverse()
412412- lb_set_buffer_title()
413413- lb_refresh()
414414-415415-def lb_sort_invert():
416416- global lb_current_sort, lb_sort_inverted
417417- if lb_current_sort:
418418- lb_set_invert_sort_order(not lb_sort_inverted)
419419- lb_sort()
420420-421421-def lb_close_cb(*kwargs):
422422- """ A callback for buffer closing. """
423423- global lb_buffer
424424-425425- lb_buffer = None
426426- return weechat.WEECHAT_RC_OK
427427-428428-lb_options = {
429429- 'refresh' : lb_refresh,
430430- 'up' : lb_line_up,
431431- 'down' : lb_line_down,
432432- 'enter' : lb_line_run,
433433- 'space' : lb_line_select,
434434- 'scroll_top' : lb_scroll_top,
435435- 'scroll_bottom': lb_scroll_bottom,
436436- 'sort_next' : lb_sort_next,
437437- 'sort_previous': lb_sort_previous,
438438- 'sort_invert': lb_sort_invert
439439-}
440440-441441-def lb_command_main(data, buffer, args):
442442- if args[0:2] == "**":
443443- keyEvent(data, buffer, args[2:])
444444- return weechat.WEECHAT_RC_OK
445445-446446-def lb_set_default_settings():
447447- global lb_settings
448448- # Set default settings
449449- for option, default_value, description in lb_settings:
450450- if not weechat.config_is_set_plugin(option):
451451- weechat.config_set_plugin(option, default_value)
452452- version = weechat.info_get("version_number", "") or 0
453453- if int(version) >= 0x00030500:
454454- weechat.config_set_desc_plugin(option, description)
455455-456456-def lb_reset_stored_sort_order():
457457- global lb_current_sort, lb_sort_inverted
458458- lb_current_sort = weechat.config_get_plugin('sort_order')
459459- lb_sort_inverted = (True if weechat.config_get_plugin('sort_inverted') == 'on' else False)
460460-461461-if __name__ == "__main__" and import_ok:
462462- if weechat.register(SCRIPT_NAME, SCRIPT_AUTHOR, SCRIPT_VERSION,
463463- SCRIPT_LICENSE, SCRIPT_DESC, "lb_close_cb", ""):
464464- lb_set_default_settings()
465465- lb_reset_stored_sort_order()
466466- lb_buffer = weechat.buffer_search("python", "listbuffer")
467467-468468- weechat.hook_signal("*,irc_in_321", "lb_list_start", "")
469469- weechat.hook_signal("*,irc_in_322", "lb_list_chan", "")
470470- weechat.hook_signal("*,irc_in_323", "lb_list_end", "")
471471- weechat.hook_command(SCRIPT_COMMAND,
472472- "List Buffer",
473473- "", "", "",
474474- "lb_command_main", "")
···66#
77# Use commands like /set or /fset to change settings in WeeChat.
88#
99-# For more info, see: https://weechat.org/doc/quickstart/
99+# For more info, see: https://weechat.org/doc/weechat/quickstart/
1010#
11111212[look]
+17-17
weechat/.weechat/script.conf
···66#
77# Use commands like /set or /fset to change settings in WeeChat.
88#
99-# For more info, see: https://weechat.org/doc/quickstart/
99+# For more info, see: https://weechat.org/doc/weechat/quickstart/
1010#
11111212[look]
1313-columns = "%s %n %V %v %u │ %d │ %t"
1313+columns = "%s %n %V %v %u | %d | %t"
1414diff_color = on
1515diff_command = "auto"
1616display_source = on
···2020use_keys = on
21212222[color]
2323-status_autoloaded = cyan
2323+status_autoloaded = 39
2424status_held = white
2525status_installed = lightcyan
2626status_obsolete = lightmagenta
2727-status_popular = 130
2727+status_popular = yellow
2828status_running = lightgreen
2929status_unknown = lightred
3030text = default
3131text_bg = default
3232-text_bg_selected = 235
3333-text_date = default
3434-text_date_selected = white
3535-text_delimiters = 130
3636-text_description = default
3232+text_bg_selected = 24
3333+text_date = 65
3434+text_date_selected = 50
3535+text_delimiters = 240
3636+text_description = 249
3737text_description_selected = white
3838-text_extension = default
3939-text_extension_selected = white
4040-text_name = cyan
4141-text_name_selected = lightcyan
3838+text_extension = 242
3939+text_extension_selected = 248
4040+text_name = 73
4141+text_name_selected = 51
4242text_selected = white
4343text_tags = brown
4444-text_tags_selected = 130
4545-text_version = magenta
4646-text_version_loaded = default
4444+text_tags_selected = yellow
4545+text_version = 100
4646+text_version_loaded = 246
4747text_version_loaded_selected = white
4848-text_version_selected = lightmagenta
4848+text_version_selected = 228
49495050[scripts]
5151autoload = on
+1-1
weechat/.weechat/spell.conf
···66#
77# Use commands like /set or /fset to change settings in WeeChat.
88#
99-# For more info, see: https://weechat.org/doc/quickstart/
99+# For more info, see: https://weechat.org/doc/weechat/quickstart/
1010#
11111212[color]
···66#
77# Use commands like /set or /fset to change settings in WeeChat.
88#
99-# For more info, see: https://weechat.org/doc/quickstart/
99+# For more info, see: https://weechat.org/doc/weechat/quickstart/
1010#
11111212[look]