my shell and tool configurations

update scripts and autojoins

+602 -24
+48 -4
weechat/.weechat/irc.conf
··· 190 190 tilde.usermode 191 191 tilde.command = "/msg operserv login ${sec.data.pass}" 192 192 tilde.command_delay 193 - tilde.autojoin = "##ekbots,#.tilde,#ZfA,#anarchism,#anelki,#ascii.town,#aussie,#bots,#bungame,#club,#cosmic,#counting,#counting-meta,#covid19,#ctrl-c,#envs,#envs_german,#espanol,#factorio,#fr,#gopher,#helpdesk,#homegrown,#ilos,#institute,#irctokens,#linux,#meta,#minecraft,#mops,#music,#netnews,#ninja,#nsfw,#opers,#pink,#politics,#prepping,#projects,#red,#secret-sudoers,#southlondon,#sus,#team,#theasylum,#thunix,#tilde.zone-admin,#tildebot,#tilderadio,#tilderadio-djs,#tildetel,#tildeverse,#vim,#zine" 193 + tilde.autojoin = "##ekbots,#.tilde,#ZfA,#allhandsactive,#anarchism,#anelki,#ascii.town,#aussie,#bots,#bungame,#club,#cosmic,#counting,#counting-meta,#covid19,#ctrl-c,#deutsch,#envs,#envs_german,#espanol,#factorio,#fr,#gopher,#helpdesk,#homegrown,#ilos,#institute,#irctokens,#linux,#meta,#minecraft,#mops,#music,#netnews,#nsfw,#opers,#pink,#politics,#prepping,#programming,#projects,#red,#secret-sudoers,#southlondon,#sus,#team,#theasylum,#thunix,#tilde.zone-admin,#tildebot,#tilderadio,#tilderadio-djs,#tildetel,#tildeverse,#town,#vim,#zine" 194 194 tilde.autorejoin 195 195 tilde.autorejoin_delay 196 196 tilde.connection_timeout ··· 454 454 oftc.usermode 455 455 oftc.command 456 456 oftc.command_delay 457 - oftc.autojoin = "#bitlbee,#debian,#debian-devel,#debian-offtopic,#fish,#mobian,#moocows,#oftc,#tilde.team" 457 + oftc.autojoin = "#bitlbee,#debian-devel,#fish,#moocows,#oftc" 458 458 oftc.autorejoin 459 459 oftc.autorejoin_delay 460 460 oftc.connection_timeout ··· 630 630 bitlbee.usermode 631 631 bitlbee.command 632 632 bitlbee.command_delay 633 - bitlbee.autojoin = "#biboumi,#btlgeneral,#cifuzofu,#darwin,#ejabberd,#gritty,#gta5,#harris,#hmm,#joinjabber,#lobby,#meeting,#onlythereals,#soprani.ca,#texto-plano,#xsf,&SMS,&bitlbee,&hmm,&tilde" 633 + bitlbee.autojoin = "#biboumi,#btlgeneral,#cifuzofu,#conversations,#darwin,#dino,#ejabberd,#gajim,#gritty,#gta5,#harris,#hmm,#joinjabber,#lobby,#meeting,#movim,#onlythereals,#openhardware,#operators,#soprani.ca,#texto-plano,#tilde.team,#xsf,&SMS,&bitlbee,&hmm,&tilde" 634 634 bitlbee.autorejoin 635 635 bitlbee.autorejoin_delay 636 636 bitlbee.connection_timeout ··· 762 762 libera.usermode 763 763 libera.command 764 764 libera.command_delay 765 - libera.autojoin = "#,#!,##,##Ben,##crustaceans,##ircv3-chat,##oodnet,##proxmox,#among-sus,#bitbot,#fosshost,#fosshost-volunteers,#gitea,#gopher,#gophernicus,#libera-dev,#lobsters,#mastodon,#oragono,#ovh,#pleroma,#sr.ht,#sr.ht.watercooler,#tilde.team,#tildeverse,#weechat,#weechat-android" 765 + libera.autojoin = "#!,##Ben,##crustaceans,##ircv3-chat,##oodnet,##proxmox,#among-sus,#bitbot,#ergo.chat,#fosshost,#fosshost-volunteers,#gitea,#gopher,#gophernicus,#hetzner,#ircpuzzles,#irctokens,#libera-communities,#libera-dev,#lobsters,#mastodon,#ovh,#sr.ht,#sr.ht.watercooler,#tilde.team,#tildeverse,#weechat,#weechat-android" 766 766 libera.autorejoin 767 767 libera.autorejoin_delay 768 768 libera.connection_timeout ··· 777 777 libera.split_msg_max_length 778 778 libera.charset_message 779 779 libera.default_chantypes 780 + ergo.addresses = "irc.ergo.chat/6697" 781 + ergo.proxy 782 + ergo.ipv6 783 + ergo.ssl = on 784 + ergo.ssl_cert 785 + ergo.ssl_password 786 + ergo.ssl_priorities 787 + ergo.ssl_dhkey_size 788 + ergo.ssl_fingerprint 789 + ergo.ssl_verify 790 + ergo.password 791 + ergo.capabilities 792 + ergo.sasl_mechanism = external 793 + ergo.sasl_username 794 + ergo.sasl_password 795 + ergo.sasl_key 796 + ergo.sasl_timeout 797 + ergo.sasl_fail 798 + ergo.autoconnect 799 + ergo.autoreconnect 800 + ergo.autoreconnect_delay 801 + ergo.nicks = "ben" 802 + ergo.nicks_alternate 803 + ergo.username 804 + ergo.realname 805 + ergo.local_hostname 806 + ergo.usermode 807 + ergo.command 808 + ergo.command_delay 809 + ergo.autojoin = "#ergo" 810 + ergo.autorejoin 811 + ergo.autorejoin_delay 812 + ergo.connection_timeout 813 + ergo.anti_flood_prio_high 814 + ergo.anti_flood_prio_low 815 + ergo.away_check 816 + ergo.away_check_max_nicks 817 + ergo.msg_kick 818 + ergo.msg_part 819 + ergo.msg_quit 820 + ergo.notify 821 + ergo.split_msg_max_length 822 + ergo.charset_message 823 + ergo.default_chantypes
+1
weechat/.weechat/logger.conf
··· 32 32 time_format = "%Y-%m-%d %H:%M:%S" 33 33 34 34 [level] 35 + core.weechat = 0 35 36 irc = 3 36 37 37 38 [mask]
+5 -3
weechat/.weechat/perl/colorize_lines.pl
··· 19 19 # along with this program. If not, see <http://www.gnu.org/licenses/>. 20 20 21 21 # history: 22 + # 4.0: add compatibility with XDG directories (WeeChat >= 3.2) 22 23 # 3.9: add compatibility with new weechat_print modifier data (WeeChat >= 2.9) 23 24 # 3.8: new option custom_action_text (https://github.com/weechat/scripts/issues/313) (idea by 3v1n0) 24 25 # 3.7: new option "alternate_color" (https://github.com/weechat/scripts/issues/333) (idea by snuffkins) ··· 87 88 88 89 use strict; 89 90 my $PRGNAME = "colorize_lines"; 90 - my $VERSION = "3.9"; 91 + my $VERSION = "4.0"; 91 92 my $AUTHOR = "Nils Görs <weechatter\@arcor.de>"; 92 93 my $LICENCE = "GPL3"; 93 94 my $DESCR = "Colorize users' text in chat area with their nick color, including highlights"; ··· 111 112 "blacklist_buffers" => "Comma-separated list of channels to be ignored (e.g. freenode.#weechat,*.#python)", 112 113 "lines" => "Apply nickname color to the lines (off/on/nicks). The latter will limit highlighting to nicknames in option 'nicks'. You can use a localvar to color all lines with a given color (eg: /buffer set localvar_set_colorize_lines *yellow). You'll have enable this option to use alternate_color.", 113 114 "highlight" => "Apply highlight color to the highlighted lines (off/on/nicks). The latter will limit highlighting to nicknames in option 'nicks'. Options 'weechat.color.chat_highlight' and 'weechat.color.chat_highlight_bg' will be used as colors.", 114 - "nicks" => "Comma-separater list of nicks (e.g. freenode.cat,*.dog) OR file name starting with '/' (e.g. /file.txt). In the latter case, nicknames will get loaded from that file inside weechat folder (e.g. from ~/.weechat/file.txt). Nicknames in file are newline-separated (e.g. freenode.dog\\n*.cat)", 115 + "nicks" => "Comma-separater list of nicks (e.g. freenode.cat,*.dog) OR file name starting with '/' (e.g. /file.txt). In the latter case, nicknames will get loaded from that file inside weechat config folder. Nicknames in file are newline-separated (e.g. freenode.dog\\n*.cat)", 115 116 "own_lines" => "Apply nickname color to own lines (off/on/only). The latter turns off all other kinds of coloring altogether. This option has an higher priority than alternate_color option.", 116 117 "own_lines_color" => "this color will be used for own messages. Set an empty value to use weechat.color.chat_nick_self option", 117 118 "tags" => "Comma-separated list of tags to accept (see /debug tags)", ··· 324 325 sub nicklist_read 325 326 { 326 327 return if (substr($config{nicks}, 0, 1) ne "/"); 327 - my $file = weechat::info_get("weechat_dir", "") . $config{nicks}; 328 + my $options = { "directory" => "config" }; 329 + my $file = weechat::string_eval_path_home("%h" . $config{nicks}, {}, {}, $options); 328 330 return unless -e $file; 329 331 my $nili = ""; 330 332 open (WL, "<", $file) || DEBUG("$file: $!");
+14
weechat/.weechat/plugins.conf
··· 77 77 python.go.fuzzy_search = "on" 78 78 python.go.message = "Go to: " 79 79 python.go.short_name = "off" 80 + python.go.short_name_server = "off" 80 81 python.go.sort = "number,beginning" 81 82 python.go.use_core_instead_weechat = "off" 82 83 python.grep.clear_buffer = "off" ··· 87 88 python.grep.show_summary = "on" 88 89 python.grep.size_limit = "2048" 89 90 python.grep.timeout_secs = "300" 91 + python.listbuffer.autofocus = "on" 92 + python.listbuffer.channel_min_width = "25" 93 + python.listbuffer.modes_min_width = "8" 94 + python.listbuffer.sort_inverted = "on" 95 + python.listbuffer.sort_order = "users" 96 + python.listbuffer.users_min_width = "8" 90 97 python.screen_away.away_suffix = "" 91 98 python.screen_away.command_on_attach = "" 92 99 python.screen_away.command_on_detach = "" ··· 193 200 python.go.fuzzy_search = "search buffer matches using approximation (default: "off")" 194 201 python.go.message = "message to display before list of buffers (default: "Go to: ")" 195 202 python.go.short_name = "display and search in short names instead of buffer name (default: "off")" 203 + python.go.short_name_server = "prefix short names with server names for search and display (default: "off")" 196 204 python.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")" 197 205 python.go.use_core_instead_weechat = "use name "core" instead of "weechat" for core buffer (default: "off")" 206 + python.listbuffer.autofocus = "Focus the listbuffer in the current window if it isn't already displayed by a window." 207 + python.listbuffer.channel_min_width = "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." 208 + python.listbuffer.modes_min_width = "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." 209 + python.listbuffer.sort_inverted = "Invert the sort order for the channel list." 210 + python.listbuffer.sort_order = "Last used sort order for the channel list." 211 + python.listbuffer.users_min_width = "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." 198 212 python.screen_away.away_suffix = "What to append to your nick when you're away." 199 213 python.screen_away.command_on_attach = "Commands to execute on attach, separated by semicolon" 200 214 python.screen_away.command_on_detach = "Commands to execute on detach, separated by semicolon"
+1
weechat/.weechat/python/autoload/listbuffer.py
··· 1 + ../listbuffer.py
+12 -3
weechat/.weechat/python/go.py
··· 21 21 # 22 22 # History: 23 23 # 24 + # 2021-05-25, Tomáš Janoušek <tomi@nomi.cz>: 25 + # version 2.7: add new option to prefix short names with server names 24 26 # 2019-07-11, Simmo Saan <simmo.saan@gmail.com> 25 27 # version 2.6: fix detection of "/input search_text_here" 26 28 # 2017-04-01, Sébastien Helleu <flashcode@flashtux.org>: ··· 94 96 95 97 SCRIPT_NAME = 'go' 96 98 SCRIPT_AUTHOR = 'Sébastien Helleu <flashcode@flashtux.org>' 97 - SCRIPT_VERSION = '2.6' 99 + SCRIPT_VERSION = '2.7' 98 100 SCRIPT_LICENSE = 'GPL3' 99 101 SCRIPT_DESC = 'Quick jump to buffers' 100 102 ··· 137 139 'short_name': ( 138 140 'off', 139 141 'display and search in short names instead of buffer name'), 142 + 'short_name_server': ( 143 + 'off', 144 + 'prefix short names with server names for search and display'), 140 145 'sort': ( 141 146 'number,beginning', 142 147 'comma-separated list of keys to sort buffers ' ··· 317 322 strinput = strinput.lower() 318 323 infolist = weechat.infolist_get('buffer', '', '') 319 324 while weechat.infolist_next(infolist): 325 + pointer = weechat.infolist_pointer(infolist, 'pointer') 320 326 short_name = weechat.infolist_string(infolist, 'short_name') 327 + server = weechat.buffer_get_string(pointer, 'localvar_server') 321 328 if go_option_enabled('short_name'): 322 - name = weechat.infolist_string(infolist, 'short_name') 329 + if go_option_enabled('short_name_server') and server: 330 + name = server + '.' + short_name 331 + else: 332 + name = short_name 323 333 else: 324 334 name = weechat.infolist_string(infolist, 'name') 325 335 if name == 'weechat' \ ··· 332 342 full_name = '%s.%s' % ( 333 343 weechat.infolist_string(infolist, 'plugin_name'), 334 344 weechat.infolist_string(infolist, 'name')) 335 - pointer = weechat.infolist_pointer(infolist, 'pointer') 336 345 matching = name.lower().find(strinput) >= 0 337 346 if not matching and strinput[-1] == ' ': 338 347 matching = name.lower().endswith(strinput.strip())
+12 -4
weechat/.weechat/python/grep.py
··· 68 68 # 69 69 # 70 70 # History: 71 + # 72 + # 2021-05-02, Sébastien Helleu <flashcode@flashtux.org> 73 + # version 0.8.5: add compatibility with WeeChat >= 3.2 (XDG directories) 74 + # 71 75 # 2020-10-11, Thom Wiggers <thom@thomwiggers.nl> 72 76 # version 0.8.4: Python3 compatibility fix 73 77 # ··· 235 239 236 240 SCRIPT_NAME = "grep" 237 241 SCRIPT_AUTHOR = "Elián Hanisch <lambdae2@gmail.com>" 238 - SCRIPT_VERSION = "0.8.4" 242 + SCRIPT_VERSION = "0.8.5" 239 243 SCRIPT_LICENSE = "GPL3" 240 244 SCRIPT_DESC = "Search in buffers and logs" 241 245 SCRIPT_COMMAND = "grep" ··· 451 455 return [] 452 456 453 457 def get_home(): 454 - home = weechat.config_string(weechat.config_get('logger.file.path')) 455 - home = home.replace('%h', weechat.info_get('weechat_dir', '')) 456 - home = path.abspath(path.expanduser(home)) 458 + options = { 459 + 'directory': 'data', 460 + } 461 + home = weechat.string_eval_path_home( 462 + weechat.config_string(weechat.config_get('logger.file.path')), 463 + {}, {}, options, 464 + ) 457 465 return home 458 466 459 467 def strip_home(s, dir=''):
+474
weechat/.weechat/python/listbuffer.py
··· 1 + # -*- coding: utf-8 -*- 2 + # 3 + # ListBuffer, version 0.8.1 for WeeChat version 0.3 4 + # Latest development version: https://github.com/FiXato/listbuffer 5 + # 6 + # Show /list results in a common buffer and interact with them. 7 + # 8 + # This script allows you to easily join channels from the /list output. 9 + # It will open a common buffer for the /list result, through which you 10 + # browse with your cursor keys, and join with the meta-enter keys. 11 + # Adjust sorting with meta->, meta-< and meta-/ keybindings. 12 + # 13 + ## History: 14 + ### 2011-09-08: FiXato: 15 + # 16 + # * version 0.1: initial release. 17 + # * added a common buffer for /list results 18 + # * added highlighting for currently selected line 19 + # * added /join support via enter key 20 + # * added scroll_top and scroll_bottom support 21 + # 22 + # * version 0.2: /list format bugfix 23 + # * added support for /list results without modes 24 + # * some servers don't send 321 (/list start). Taken into account. 25 + # 26 + # * version 0.3: Sorting support 27 + # * Added some basic sorting support. Scroll through sort options 28 + # with meta-> and meta-< (users, channel, topic, modes) 29 + # 30 + ### 2011-09-19: FiXato 31 + # 32 + # * version 0.4: 33 + # * Case-insensitive buffer lookup fix. 34 + # * Removed default enter keybind 35 + # 36 + ### 2011-12-28: troydm: 37 + # 38 + # * version 0.5: It's an upside-down-world 39 + # * Added inverted sorting support provided by Dmitry "troydm" Geurkov 40 + # Use meta-/ to switch between inverted and regular sorting. 41 + # 42 + ### 2012-02-10: FiXato: 43 + # 44 + # * version 0.6: Stop shoving that buffer in my face! 45 + # * The listbuffer should no longer pop up by itself when you load the script. 46 + # It should only pop up now when you actually do a /list query. 47 + # 48 + # * version 0.7: .. but please pop it up in my current window when I ask for it 49 + # * Added setting plugins.var.python.listbuffer.autofocus 50 + # This will autofocus the listbuffer in the current window if another window isn't 51 + # already showing it, and of course only when the user issues /list 52 + # 53 + ### 2012-07-10: FiXato: 54 + # 55 + # * version 0.7.1: Forgetful bugfix 56 + # * Made sure lb_curline global variable is defined 57 + # 58 + ### 2013-03-19: FiXato: 59 + # 60 + # * version 0.8: Sorted out the sorting 61 + # * Added automatically updating options for sorting: 62 + # * plugins.var.python.listbuffer.sort_inverted 63 + # * plugins.var.python.listbuffer.sort_order 64 + # * version 0.8.1: Pad it baby! 65 + # * Channel modes are equally padded even when there are no channel modes. 66 + # * Added padding options: 67 + # * plugins.var.python.listbuffer.modes_min_width 68 + # * plugins.var.python.listbuffer.channel_min_width 69 + # * plugins.var.python.listbuffer.users_min_width 70 + # 71 + ### 2019-07-05: Sébastien Helleu: 72 + # 73 + # * version 0.8.2: Make script compatible with Python 3. 74 + # 75 + ## Acknowledgements: 76 + # * Dmitry "troydm" Geurkov, for providing the inverse-sorting patch to the project. 77 + # * Sebastien "Flashcode" Helleu, for developing the kick-ass IRC client WeeChat 78 + # and the iset.pl script which inspired me to this script. 79 + # * Nils "nils_2" Görs, for his contributions to iset.pl which served as 80 + # example code. 81 + # * David "drubin" Rubin, for his urlgrab.py script, which also served 82 + # as example code. 83 + # * ArZa, whose listsort.pl script helped me getting started with 84 + # grabbing the /list results. Parts of his code have been shamelessly 85 + # copied and ported to Python. 86 + # * Khaled Mardam-Bey, for making me yearn for similar /list support in 87 + # WeeChat as mIRC already offered. :P 88 + # * mave_, for pointing out that sort orders weren't remembered. 89 + # 90 + ## TODO: 91 + # - Auto-scroll selected line upon window scroll. 92 + # - Add option to hide already joined channels. 93 + # - Improve sorting methods 94 + # - Add auto-join support 95 + # - Detect if channel is already in auto-join 96 + # - Allow automatically switching to the listbuffer 97 + # - Add support for ALIS (/squery alis LIST * -mix 100 (IRCNet) 98 + # - Make colours configurable 99 + # - Limit number of channels to parse 100 + # - Add filter support a la iset 101 + # - Allow selecting multiple channels 102 + # - Add optional command redirection. 103 + # 104 + ## Copyright (c) 2011,2012,2013 Filip H.F. "FiXato" Slagter, 105 + # <FiXato [at] Gmail [dot] com> 106 + # http://profile.fixato.org 107 + # 108 + # Permission is hereby granted, free of charge, to any person obtaining 109 + # a copy of this software and associated documentation files (the 110 + # "Software"), to deal in the Software without restriction, including 111 + # without limitation the rights to use, copy, modify, merge, publish, 112 + # distribute, sublicense, and/or sell copies of the Software, and to 113 + # permit persons to whom the Software is furnished to do so, subject to 114 + # the following conditions: 115 + # 116 + # The above copyright notice and this permission notice shall be 117 + # included in all copies or substantial portions of the Software. 118 + # 119 + # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 120 + # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 121 + # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 122 + # NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 123 + # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 124 + # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 125 + # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 126 + # 127 + 128 + from __future__ import print_function 129 + 130 + SCRIPT_NAME = "listbuffer" 131 + SCRIPT_AUTHOR = "Filip H.F. 'FiXato' Slagter <fixato [at] gmail [dot] com>" 132 + SCRIPT_VERSION = "0.8.2" 133 + SCRIPT_LICENSE = "MIT" 134 + SCRIPT_DESC = "A common buffer for /list output." 135 + SCRIPT_COMMAND = "listbuffer" 136 + 137 + import_ok = True 138 + 139 + try: 140 + import weechat 141 + except ImportError: 142 + print("This script must be run under WeeChat.") 143 + import_ok = False 144 + 145 + import re 146 + 147 + lb_settings = ( 148 + ("autofocus", "on", "Focus the listbuffer in the current window if it isn't already displayed by a window."), 149 + ("sort_order", "users", "Last used sort order for the channel list."), 150 + ("sort_inverted", "on", "Invert the sort order for the channel list."), 151 + ("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."), 152 + ("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."), 153 + ("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."), 154 + ) 155 + lb_buffer = None 156 + lb_curline = 0 157 + lb_channels = [] 158 + lb_network = None 159 + lb_list_started = False 160 + lb_current_sort = None 161 + lb_sort_inverted = False 162 + lb_sort_options = ( 163 + 'channel', 164 + 'users', 165 + 'modes', 166 + 'topic', 167 + ) 168 + 169 + # server numeric Nick Chan Users Modes Topic 170 + lb_channel_list_expression = '(:\S+) (\d{3}) (\S+) (\S+) (\d+) :(\[(.*?)\] )?(.*)' 171 + 172 + # Create listbuffer. 173 + def lb_create_buffer(): 174 + global lb_buffer, lb_curline 175 + 176 + if not lb_buffer: 177 + lb_buffer = weechat.buffer_new("listbuffer", "lb_input_cb", \ 178 + "", "lb_close_cb", "") 179 + lb_set_buffer_title() 180 + # Sets notify to 0 as this buffer does not need to be in hotlist. 181 + weechat.buffer_set(lb_buffer, "notify", "0") 182 + weechat.buffer_set(lb_buffer, "nicklist", "0") 183 + weechat.buffer_set(lb_buffer, "type", "free") 184 + weechat.buffer_set(lb_buffer, "key_bind_ctrl-L", "/listbuffer **refresh") 185 + weechat.buffer_set(lb_buffer, "key_bind_meta2-A", "/listbuffer **up") 186 + weechat.buffer_set(lb_buffer, "key_bind_meta2-B", "/listbuffer **down") 187 + weechat.buffer_set(lb_buffer, "key_bind_meta2-1~", "/listbuffer **scroll_top") 188 + weechat.buffer_set(lb_buffer, "key_bind_meta2-4~", "/listbuffer **scroll_bottom") 189 + weechat.buffer_set(lb_buffer, "key_bind_meta-ctrl-J", "/listbuffer **enter") 190 + weechat.buffer_set(lb_buffer, "key_bind_meta-ctrl-M", "/listbuffer **enter") 191 + weechat.buffer_set(lb_buffer, "key_bind_meta->", "/listbuffer **sort_next") 192 + weechat.buffer_set(lb_buffer, "key_bind_meta-<", "/listbuffer **sort_previous") 193 + weechat.buffer_set(lb_buffer, "key_bind_meta-/", "/listbuffer **sort_invert") 194 + lb_curline = 0 195 + if weechat.config_get_plugin("autofocus") == "on": 196 + if not weechat.window_search_with_buffer(lb_buffer): 197 + weechat.command("", "/buffer " + weechat.buffer_get_string(lb_buffer,"name")) 198 + 199 + def lb_set_buffer_title(): 200 + global lb_buffer, lb_current_sort 201 + ascdesc = '(v)' if lb_sort_inverted else '(^)' 202 + weechat.buffer_set(lb_buffer, "title", lb_line_format({ 203 + 'channel': 'Channel name%s' % (ascdesc if lb_current_sort == 'channel' else ''), 204 + 'users': 'Users%s' % (ascdesc if lb_current_sort == 'users' else ''), 205 + 'modes': 'Modes%s' % (ascdesc if lb_current_sort == 'modes' else ''), 206 + 'topic': 'Topic%s' % (ascdesc if lb_current_sort == 'topic' else ''), 207 + 'nomodes': None, 208 + })) 209 + 210 + def lb_list_start(data, signal, message): 211 + lb_initialise_list 212 + 213 + return weechat.WEECHAT_RC_OK 214 + 215 + def lb_initialise_list(signal): 216 + global lb_channels, lb_network, lb_list_started 217 + 218 + lb_create_buffer() 219 + lb_channels = [] 220 + lb_network = signal.split(',')[0] 221 + lb_list_started = True 222 + return 223 + 224 + 225 + def lb_list_chan(data, signal, message): 226 + global lb_channels, lb_buffer, lb_list_started 227 + 228 + # Work-around for IRCds which don't send 321 Numeric (/List start) 229 + if not lb_list_started: 230 + lb_initialise_list(signal) 231 + 232 + for chan_data in re.findall(lb_channel_list_expression,message): 233 + lb_channels.append({ 234 + 'server': chan_data[0][1:-1], 235 + 'numeric': chan_data[1], 236 + 'nick': chan_data[2], 237 + 'channel': chan_data[3], 238 + 'users': chan_data[4], 239 + 'nomodes': chan_data[5] == '', 240 + 'modes': chan_data[6], 241 + 'topic': weechat.hook_modifier_exec("irc_color_decode", "1", chan_data[7]) 242 + }) 243 + return weechat.WEECHAT_RC_OK 244 + 245 + def lb_list_end(data, signal, message): 246 + global lb_list_started 247 + 248 + # Work-around for IRCds which don't send 321 Numeric (/List start) 249 + if not lb_list_started: 250 + lb_initialise_list(signal) 251 + 252 + lb_list_started = False 253 + if lb_current_sort: 254 + lb_sort() 255 + lb_refresh() 256 + return weechat.WEECHAT_RC_OK 257 + 258 + def keyEvent (data, buffer, args): 259 + global lb_options 260 + lb_options[args]() 261 + 262 + def lb_input_cb(data, buffer, input_data): 263 + global lb_options, lb_curline 264 + lb_options[input_data]() 265 + return weechat.WEECHAT_RC_OK 266 + 267 + def lb_refresh(): 268 + global lb_channels, lb_buffer 269 + weechat.buffer_clear(lb_buffer) 270 + 271 + y = 0 272 + for list_data in lb_channels: 273 + lb_refresh_line(y) 274 + y += 1 275 + return 276 + 277 + def lb_refresh_line(y): 278 + global lb_buffer, lb_curline, lb_channels 279 + if y >= 0 and y < len(lb_channels): 280 + formatted_line = lb_line_format(lb_channels[y], y == lb_curline) 281 + weechat.prnt_y(lb_buffer, y, formatted_line) 282 + 283 + def lb_refresh_curline(): 284 + global lb_curline 285 + lb_refresh_line(lb_curline-1) 286 + lb_refresh_line(lb_curline) 287 + lb_refresh_line(lb_curline+1) 288 + return 289 + 290 + def lb_line_format(list_data,curr=False): 291 + str = "" 292 + if (curr): 293 + str += weechat.color("yellow,red") 294 + channel_text = list_data['channel'].ljust(int(weechat.config_get_plugin('channel_min_width'))) 295 + users_text = "(%s)" % list_data['users'] 296 + padded_users_text = users_text.rjust(int(weechat.config_get_plugin('users_min_width')) + 2) 297 + str += "%s%s %s " % (weechat.color("bold"), channel_text, padded_users_text) 298 + if not list_data['nomodes']: 299 + modes = "[%s]" % list_data['modes'] 300 + else: 301 + modes = "[]" 302 + str += "%s: " % modes.rjust(int(weechat.config_get_plugin('modes_min_width')) + 2) 303 + str += "%s" % list_data['topic'] 304 + return str 305 + 306 + def lb_line_up(): 307 + global lb_curline 308 + if lb_curline <= 0: 309 + return 310 + lb_curline -= 1 311 + lb_refresh_curline() 312 + lb_check_outside_window() 313 + return 314 + 315 + def lb_line_down(): 316 + global lb_curline, lb_channels 317 + if lb_curline+1 >= len(lb_channels): 318 + return 319 + lb_curline += 1 320 + lb_refresh_curline() 321 + lb_check_outside_window() 322 + return 323 + 324 + def lb_line_run(): 325 + global lb_channels, lb_curline, lb_network 326 + buff = weechat.info_get("irc_buffer", lb_network) 327 + channel = lb_channels[lb_curline]['channel'] 328 + command = "/join %s" % channel 329 + weechat.command(buff, command) 330 + return 331 + 332 + def lb_line_select(): 333 + return 334 + 335 + def lb_scroll_top(): 336 + global lb_curline 337 + old_y = lb_curline 338 + lb_curline = 0 339 + lb_refresh_curline() 340 + lb_refresh_line(old_y) 341 + weechat.command(lb_buffer, "/window scroll_top") 342 + return 343 + 344 + def lb_scroll_bottom(): 345 + global lb_curline, lb_channels 346 + old_y = lb_curline 347 + lb_curline = len(lb_channels)-1 348 + lb_refresh_curline() 349 + lb_refresh_line(old_y) 350 + weechat.command(lb_buffer, "/window scroll_bottom") 351 + return 352 + 353 + def lb_check_outside_window(): 354 + global lb_buffer, lb_curline 355 + if (lb_buffer): 356 + infolist = weechat.infolist_get("window", "", "current") 357 + if (weechat.infolist_next(infolist)): 358 + start_line_y = weechat.infolist_integer(infolist, "start_line_y") 359 + chat_height = weechat.infolist_integer(infolist, "chat_height") 360 + if(start_line_y > lb_curline): 361 + weechat.command(lb_buffer, "/window scroll -%i" %(start_line_y - lb_curline)) 362 + elif(start_line_y <= lb_curline - chat_height): 363 + weechat.command(lb_buffer, "/window scroll +%i"%(lb_curline - start_line_y - chat_height + 1)) 364 + weechat.infolist_free(infolist) 365 + 366 + def lb_sort_next(): 367 + global lb_current_sort, lb_sort_options 368 + if lb_current_sort: 369 + new_index = lb_sort_options.index(lb_current_sort) + 1 370 + else: 371 + new_index = 0 372 + 373 + if len(lb_sort_options) <= new_index: 374 + new_index = 0 375 + 376 + lb_set_current_sort_order(lb_sort_options[new_index]) 377 + lb_sort() 378 + 379 + def lb_set_current_sort_order(value): 380 + global lb_current_sort 381 + lb_current_sort = value 382 + weechat.config_set_plugin('sort_order', lb_current_sort) 383 + 384 + def lb_set_invert_sort_order(value): 385 + global lb_sort_inverted 386 + lb_sort_inverted = value 387 + weechat.config_set_plugin('sort_inverted', ('on' if lb_sort_inverted else 'off')) 388 + 389 + def lb_sort_previous(): 390 + global lb_current_sort, lb_sort_options 391 + if lb_current_sort: 392 + new_index = lb_sort_options.index(lb_current_sort) - 1 393 + else: 394 + new_index = 0 395 + 396 + if new_index < 0: 397 + new_index = len(lb_sort_options) - 1 398 + 399 + lb_set_current_sort_order(lb_sort_options[new_index]) 400 + lb_sort() 401 + 402 + def lb_sort(sort_key=None): 403 + global lb_channels, lb_current_sort, lb_sort_inverted 404 + if sort_key: 405 + lb_set_current_sort_order(sort_key) 406 + if lb_current_sort == 'users': 407 + lb_channels = sorted(lb_channels, key=lambda chan_data: int(chan_data[lb_current_sort])) 408 + else: 409 + lb_channels = sorted(lb_channels, key=lambda chan_data: chan_data[lb_current_sort]) 410 + if lb_sort_inverted: 411 + lb_channels.reverse() 412 + lb_set_buffer_title() 413 + lb_refresh() 414 + 415 + def lb_sort_invert(): 416 + global lb_current_sort, lb_sort_inverted 417 + if lb_current_sort: 418 + lb_set_invert_sort_order(not lb_sort_inverted) 419 + lb_sort() 420 + 421 + def lb_close_cb(*kwargs): 422 + """ A callback for buffer closing. """ 423 + global lb_buffer 424 + 425 + lb_buffer = None 426 + return weechat.WEECHAT_RC_OK 427 + 428 + lb_options = { 429 + 'refresh' : lb_refresh, 430 + 'up' : lb_line_up, 431 + 'down' : lb_line_down, 432 + 'enter' : lb_line_run, 433 + 'space' : lb_line_select, 434 + 'scroll_top' : lb_scroll_top, 435 + 'scroll_bottom': lb_scroll_bottom, 436 + 'sort_next' : lb_sort_next, 437 + 'sort_previous': lb_sort_previous, 438 + 'sort_invert': lb_sort_invert 439 + } 440 + 441 + def lb_command_main(data, buffer, args): 442 + if args[0:2] == "**": 443 + keyEvent(data, buffer, args[2:]) 444 + return weechat.WEECHAT_RC_OK 445 + 446 + def lb_set_default_settings(): 447 + global lb_settings 448 + # Set default settings 449 + for option, default_value, description in lb_settings: 450 + if not weechat.config_is_set_plugin(option): 451 + weechat.config_set_plugin(option, default_value) 452 + version = weechat.info_get("version_number", "") or 0 453 + if int(version) >= 0x00030500: 454 + weechat.config_set_desc_plugin(option, description) 455 + 456 + def lb_reset_stored_sort_order(): 457 + global lb_current_sort, lb_sort_inverted 458 + lb_current_sort = weechat.config_get_plugin('sort_order') 459 + lb_sort_inverted = (True if weechat.config_get_plugin('sort_inverted') == 'on' else False) 460 + 461 + if __name__ == "__main__" and import_ok: 462 + if weechat.register(SCRIPT_NAME, SCRIPT_AUTHOR, SCRIPT_VERSION, 463 + SCRIPT_LICENSE, SCRIPT_DESC, "lb_close_cb", ""): 464 + lb_set_default_settings() 465 + lb_reset_stored_sort_order() 466 + lb_buffer = weechat.buffer_search("python", "listbuffer") 467 + 468 + weechat.hook_signal("*,irc_in_321", "lb_list_start", "") 469 + weechat.hook_signal("*,irc_in_322", "lb_list_chan", "") 470 + weechat.hook_signal("*,irc_in_323", "lb_list_end", "") 471 + weechat.hook_command(SCRIPT_COMMAND, 472 + "List Buffer", 473 + "", "", "", 474 + "lb_command_main", "")
+1 -1
weechat/.weechat/spell.conf
··· 19 19 commands = "ame,amsg,away,command,cycle,kick,kickban,me,msg,notice,part,query,quit,topic" 20 20 default_dict = "en" 21 21 during_search = off 22 - enabled = on 22 + enabled = off 23 23 real_time = off 24 24 suggestions = 2 25 25 word_min_length = 2
+32 -8
weechat/.weechat/trigger.conf
··· 33 33 autojoin.post_action = none 34 34 autojoin.regex = "" 35 35 autojoin.return_code = ok 36 - autojoinem_on_quit.arguments = "quit" 37 - autojoinem_on_quit.command = "/allchan /autojoinem add" 38 - autojoinem_on_quit.conditions = "" 39 - autojoinem_on_quit.enabled = on 40 - autojoinem_on_quit.hook = signal 41 - autojoinem_on_quit.post_action = none 42 - autojoinem_on_quit.regex = "" 43 - autojoinem_on_quit.return_code = ok 44 36 autopart.arguments = "*,irc_in_part" 45 37 autopart.command = "/autojoinem del ${server} ${channel};/mute save" 46 38 autopart.conditions = "" ··· 73 65 greentext.post_action = none 74 66 greentext.regex = "/(.*)/${tg_prefix}\t${color:34}${tg_message}" 75 67 greentext.return_code = ok 68 + input_backtick.arguments = "500|input_text_display" 69 + input_backtick.command = "" 70 + input_backtick.conditions = "" 71 + input_backtick.enabled = on 72 + input_backtick.hook = modifier 73 + input_backtick.post_action = none 74 + input_backtick.regex = "/(^| )(`[^`]+)($|(`)($|[,.?!:; ]))/${re:1}${color:,darkgray}${re:2}${re:4}${color:,default}${re:5}/" 75 + input_backtick.return_code = ok 76 + input_command_color.arguments = "500|input_text_display" 77 + input_command_color.command = "" 78 + input_command_color.conditions = "${tg_string} =~ ^/($|[^/])" 79 + input_command_color.enabled = on 80 + input_command_color.hook = modifier 81 + input_command_color.post_action = none 82 + input_command_color.regex = "#/(.+)#${color:39}/${color:74}${re:1}#" 83 + input_command_color.return_code = ok 76 84 ircd_notice_con.arguments = "weechat_print" 77 85 ircd_notice_con.command = "" 78 86 ircd_notice_con.conditions = "${tg_tags} =~ irc_notice" ··· 113 121 msg_auth.post_action = none 114 122 msg_auth.regex = "==^(.*(id|identify|register|ghost +[^ ]+|release +[^ ]+) +)(.*)==${re:1}${hide:*,${re:+}}" 115 123 msg_auth.return_code = ok 124 + preview_nick_colors.arguments = "2000|input_text_display" 125 + preview_nick_colors.command = "" 126 + preview_nick_colors.conditions = "${tg_string} =~ ^/set\s+weechat\.color\.chat_nick_colors\s+" 127 + preview_nick_colors.enabled = on 128 + preview_nick_colors.hook = modifier 129 + preview_nick_colors.post_action = none 130 + preview_nick_colors.regex = "/^\S+\s+\S+(.+)$/${re:1}/tg_string_nocolor /([^",]+)/${color:${re:1}}${re:1}${color:default}/tg_string_nocolor /^(\S+\s+\S+).*$/${re:1}${tg_string_nocolor}/tg_string" 131 + preview_nick_colors.return_code = ok 132 + print_backtick.arguments = "weechat_print" 133 + print_backtick.command = "" 134 + print_backtick.conditions = "" 135 + print_backtick.enabled = on 136 + print_backtick.hook = modifier 137 + print_backtick.post_action = none 138 + print_backtick.regex = "/(^|\t|\d| )(`[^`]+`)([,.?!:; ]|$)/${re:1}${color:,darkgray}${re:2}${color:,default}${re:3}/" 139 + print_backtick.return_code = ok 116 140 resize_big.arguments = "signal_sigwinch" 117 141 resize_big.command = "/bar show nicklist" 118 142 resize_big.conditions = "${info:term_width} >= 100"
+2 -1
weechat/.weechat/weechat.conf
··· 157 157 chat_inactive_buffer = default 158 158 chat_inactive_window = default 159 159 chat_nick = lightcyan 160 - chat_nick_colors = "cyan,magenta,green,brown,lightblue,default,lightcyan,lightgreen,blue,22,31,35,38,40,49,63,70,80,87,92,99,112,119,126,130,138,142,146,148,160,162,167,169,174,176,178,184,186,191,200,202,206,210,212,215,225,226,247" 160 + chat_nick_colors = "cyan,magenta,green,brown,lightblue,lightcyan,lightgreen,blue,22,31,35,38,40,49,63,67,70,87,99,112,119,130,136,138,142,146,148,160,162,167,169,174,176,178,184,186,191,202,206,210,212,215,225,226,247" 161 161 chat_nick_offline = blue 162 162 chat_nick_offline_highlight = default 163 163 chat_nick_offline_highlight_bg = blue ··· 365 365 [notify] 366 366 irc.server.tilde = highlight 367 367 perl.highmon = none 368 + python.listbuffer = none 368 369 python.slack.haulerads.#device-dev = highlight 369 370 370 371 [filter]