my shell and tool configurations

a bunch of random stuff

+191 -474
+1
fish/.config/fish/fish_variables
··· 34 34 SETUVAR fish_pager_color_description:B3A06D\x1eyellow 35 35 SETUVAR fish_pager_color_prefix:white\x1e\x2d\x2dbold\x1e\x2d\x2dunderline 36 36 SETUVAR fish_pager_color_progress:brwhite\x1e\x2d\x2dbackground\x3dcyan 37 + SETUVAR fish_pager_color_selected_background:\x2dr 37 38 SETUVAR fisher_dependency_count:bass\x1edone\x1egetopts\x1egitignore\x1ehumanize_duration\x1envm\x1espin
+2
git/.gitconfig
··· 52 52 conflictstyle = diff3 53 53 [mergetool] 54 54 prompt = false 55 + [core] 56 + excludesfile = /home/ben/.gitignore
+1
git/.gitignore
··· 1 + .pc/
+18 -50
weechat/.weechat/irc.conf
··· 127 127 anti_flood_prio_low = 2 128 128 autoconnect = on 129 129 autojoin = "" 130 + autojoin_dynamic = on 130 131 autoreconnect = on 131 132 autoreconnect_delay = 10 132 133 autorejoin = off ··· 149 150 notify = "" 150 151 password = "" 151 152 proxy = "" 152 - realname = "Ben Harris" 153 + realname = "ben" 153 154 sasl_fail = continue 154 155 sasl_key = "" 155 156 sasl_mechanism = plain ··· 197 198 tilde.usermode 198 199 tilde.command = "/msg operserv login ${sec.data.pass};/msg idlerpg_bot login wowbagger ${sec.data.idlerpgpass}" 199 200 tilde.command_delay = 25 200 - tilde.autojoin = "#.tilde,#ZfA,#allhandsactive,#anelki,#ascii.town,#aussie,#bots,#bungame,#cactus,#club,#cosmic,#counting-meta,#ctrl-c,#deutsch,#downgrade,#envs_german,#espanol,#factorio,#fr,#gemini,#gopher,#helpdesk,#idlerpg,#institute,#linux,#meta,#minecraft,#music,#netnews,#nsfw,#opers,#politics,#programming,#projects,#remotes.club,#secret-sudoers,#sus,#team,#texto-plano,#theasylum,#thunix,#tilde.zone-admin,#tildebot,#tilderadio,#tilderadio-djs,#tildetel,#tildeverse,#town,#vim,#wiki,#zfa" 201 + tilde.autojoin = "#.tilde,#ZfA,#adventofcode,#allhandsactive,#anelki,#ascii.town,#aussie,#binary-counting,#bots,#club,#cosmic,#counting,#covid19,#ctrl-c,#dotnet,#earthward,#espanol,#fr,#gemini,#gopher,#helpdesk,#linux,#math,#meta,#minecraft,#netnews,#nsfw,#opers,#rw.rs,#secret-sudoers,#southlondon,#team,#thunix,#tilde.zone-admin,#tildebot,#tildenet,#tilderadio,#tilderadio-djs,#tildetel,#topm,#town,#vim,#wiki,#xinu,#zfa" 202 + tilde.autojoin_dynamic 201 203 tilde.autorejoin 202 204 tilde.autorejoin_delay 203 205 tilde.connection_timeout ··· 241 243 hashbang.usermode 242 244 hashbang.command 243 245 hashbang.command_delay 244 - hashbang.autojoin = "#!opers,#!social" 246 + hashbang.autojoin = "#!,#!opers,#!social" 247 + hashbang.autojoin_dynamic 245 248 hashbang.autorejoin 246 249 hashbang.autorejoin_delay 247 250 hashbang.connection_timeout ··· 285 288 town.usermode 286 289 town.command 287 290 town.command_delay 288 - town.autojoin = "#admins,#announcements,#bots,#counting,#counting-meta,#tildetown" 291 + town.autojoin = "#admins,#adventofcode,#announcements,#bots,#counting,#tildetown" 292 + town.autojoin_dynamic 289 293 town.autorejoin 290 294 town.autorejoin_delay 291 295 town.connection_timeout ··· 374 378 sdf.command 375 379 sdf.command_delay 376 380 sdf.autojoin = "#sdf,#spanish" 381 + sdf.autojoin_dynamic 377 382 sdf.autorejoin 378 383 sdf.autorejoin_delay 379 384 sdf.connection_timeout ··· 418 423 darwin.command 419 424 darwin.command_delay 420 425 darwin.autojoin = "#darwin" 426 + darwin.autojoin_dynamic 421 427 darwin.autorejoin = on 422 428 darwin.autorejoin_delay 423 429 darwin.connection_timeout ··· 461 467 oftc.usermode 462 468 oftc.command 463 469 oftc.command_delay 464 - oftc.autojoin = "#bitlbee,#debian-devel,#fish" 470 + oftc.autojoin = "#bitlbee,#debian-devel,#fish,#salsa" 471 + oftc.autojoin_dynamic 465 472 oftc.autorejoin 466 473 oftc.autorejoin_delay 467 474 oftc.connection_timeout ··· 506 513 blinkenshell.command 507 514 blinkenshell.command_delay 508 515 blinkenshell.autojoin = "#blinkenshell" 516 + blinkenshell.autojoin_dynamic 509 517 blinkenshell.autorejoin 510 518 blinkenshell.autorejoin_delay 511 519 blinkenshell.connection_timeout ··· 550 558 inspircd.command 551 559 inspircd.command_delay 552 560 inspircd.autojoin = "#inspircd" 561 + inspircd.autojoin_dynamic 553 562 inspircd.autorejoin 554 563 inspircd.autorejoin_delay 555 564 inspircd.connection_timeout ··· 594 603 slashnet.command = "/ns identify ${sec.data.slashnetpass}" 595 604 slashnet.command_delay 596 605 slashnet.autojoin = "#gtlug" 606 + slashnet.autojoin_dynamic 597 607 slashnet.autorejoin 598 608 slashnet.autorejoin_delay 599 609 slashnet.connection_timeout ··· 652 662 bitlbee.split_msg_max_length 653 663 bitlbee.charset_message 654 664 bitlbee.default_chantypes 655 - pine.addresses = "irc.pine64.org" 656 - pine.proxy 657 - pine.ipv6 658 - pine.ssl 659 - pine.ssl_cert 660 - pine.ssl_password 661 - pine.ssl_priorities 662 - pine.ssl_dhkey_size 663 - pine.ssl_fingerprint 664 - pine.ssl_verify 665 - pine.password 666 - pine.capabilities 667 - pine.sasl_mechanism 668 - pine.sasl_username = "ben" 669 - pine.sasl_password = "${sec.data.pinepass}" 670 - pine.sasl_key 671 - pine.sasl_timeout 672 - pine.sasl_fail 673 - pine.autoconnect 674 - pine.autoreconnect 675 - pine.autoreconnect_delay 676 - pine.nicks 677 - pine.nicks_alternate 678 - pine.username 679 - pine.realname 680 - pine.local_hostname 681 - pine.usermode 682 - pine.command 683 - pine.command_delay 684 - pine.autojoin = "#Pine64" 685 - pine.autorejoin 686 - pine.autorejoin_delay 687 - pine.connection_timeout 688 - pine.anti_flood_prio_high 689 - pine.anti_flood_prio_low 690 - pine.away_check 691 - pine.away_check_max_nicks 692 - pine.msg_kick 693 - pine.msg_part 694 - pine.msg_quit 695 - pine.notify 696 - pine.split_msg_max_length 697 - pine.charset_message 698 - pine.default_chantypes 699 665 libera.addresses = "irc.us.libera.chat/6697" 700 666 libera.proxy 701 667 libera.ipv6 ··· 769 735 ergo.usermode 770 736 ergo.command 771 737 ergo.command_delay 772 - ergo.autojoin = "#chat,#ergo" 738 + ergo.autojoin = "#ergo" 739 + ergo.autojoin_dynamic 773 740 ergo.autorejoin 774 741 ergo.autorejoin_delay 775 742 ergo.connection_timeout ··· 814 781 pisslocal.command = "/oper ben ${sec.data.pissnetoper}" 815 782 pisslocal.command_delay 816 783 pisslocal.autojoin = "#opers,#pissnet,#services" 784 + pisslocal.autojoin_dynamic 817 785 pisslocal.autorejoin 818 786 pisslocal.autorejoin_delay 819 787 pisslocal.connection_timeout
+1 -2
weechat/.weechat/plugins.conf
··· 57 57 python.apply_corrections.print_format = "[nick]: [corrected]" 58 58 python.apply_corrections.print_limit = "1" 59 59 python.autojoin.autosave = "off" 60 - python.autojoinem.sorted = "on" 61 60 python.autosavekey.add = "on" 62 61 python.autosavekey.mute = "off" 63 62 python.autosavekey.secure = "on" ··· 65 64 python.buffer_autoclose.ignore = "bitlbee.maddie" 66 65 python.buffer_autoclose.interval = "1" 67 66 python.check_license = "off" 68 - python.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" 67 + python.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" 69 68 python.go.auto_jump = "off" 70 69 python.go.buffer_number = "on" 71 70 python.go.color_name = "black,cyan"
-401
weechat/.weechat/python/autojoinem.py
··· 1 - # -*- coding: utf-8 -*- 2 - # 3 - # Copyright (c) 2013-2020 by nils_2 <weechatter@arcor.de> 4 - # 5 - # add/del channel(s) to/from autojoin option 6 - # 7 - # This program is free software; you can redistribute it and/or modify 8 - # it under the terms of the GNU General Public License as published by 9 - # the Free Software Foundation; either version 3 of the License, or 10 - # (at your option) any later version. 11 - # 12 - # This program is distributed in the hope that it will be useful, 13 - # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 - # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 - # GNU General Public License for more details. 16 - # 17 - # You should have received a copy of the GNU General Public License 18 - # along with this program. If not, see <http://www.gnu.org/licenses/>. 19 - # 20 - # idea by azizLIGHTS 21 - # 22 - # 2020-10-20: nils_2, (freenode.#weechat) 23 - # 0.7 : fix problem with empty fields (reported by MutantMummy: https://github.com/weechat/scripts/issues/438) 24 - # 2017-01-06: nils_2, (freenode.#weechat) 25 - # 0.6 : fix problem with non existing server (reported by Niols) 26 - # 2016-12-19: nils_2, (freenode.#weechat) 27 - # 0.5 : fix problem with empty autojoin (reported by Caelum) 28 - # 2016-06-05: nils_2, (freenode.#weechat) 29 - # 0.4 : make script python3 compatible 30 - # 2015-11-14: nils_2, (freenode.#weechat) 31 - # 0.3 : fix: problem with (undef) option 32 - # 2014-01-19: nils_2, (freenode.#weechat) 33 - # 0.2 : fix: adding keys to already existing keys failed 34 - # 2013-12-22: nils_2, (freenode.#weechat) 35 - # 0.1 : initial release 36 - # 37 - # requires: WeeChat version 0.3.x 38 - # 39 - # Development is currently hosted at 40 - # https://github.com/weechatter/weechat-scripts 41 - 42 - try: 43 - import weechat,re 44 - 45 - except Exception: 46 - print("This script must be run under WeeChat.") 47 - print("Get WeeChat now at: http://www.weechat.org/") 48 - quit() 49 - 50 - SCRIPT_NAME = "autojoinem" 51 - SCRIPT_AUTHOR = "nils_2 <weechatter@arcor.de>" 52 - SCRIPT_VERSION = "0.7" 53 - SCRIPT_LICENSE = "GPL" 54 - SCRIPT_DESC = "add/del channel(s) to/from autojoin option" 55 - 56 - OPTIONS = { 'sorted' : ('off','channels will be sorted in autojoin-option. if autojoin-option contains channel-keys, this option will be ignored.'), 57 - } 58 - 59 - def add_autojoin_cmd_cb(data, buffer, args): 60 - if args == "": # no args given. quit 61 - return weechat.WEECHAT_RC_OK 62 - 63 - argv = args.strip().split(' ') 64 - 65 - # remove empty fields 66 - argv2 = [feld for feld in argv if feld != ''] 67 - argv = argv2 68 - 69 - # if (len(argv) <= 1): 70 - # weechat.prnt(buffer,"%s%s: too few arguments." % (weechat.prefix('error'),SCRIPT_NAME)) 71 - # return weechat.WEECHAT_RC_OK 72 - 73 - server = weechat.buffer_get_string(buffer, 'localvar_server') # current server 74 - channel = weechat.buffer_get_string(buffer, 'localvar_channel') # current channel 75 - buf_type = weechat.buffer_get_string(buffer, 'localvar_type') 76 - 77 - # only "add <servername>" given by user 78 - if (len(argv) == 2): 79 - weechat.prnt(buffer,"%s%s: invalid number of arguments." % (weechat.prefix('error'),SCRIPT_NAME)) 80 - return weechat.WEECHAT_RC_OK 81 - 82 - # '-key' keyword in command line? 83 - if '-key' in argv: 84 - found_key_word = argv.index('-key') 85 - key_words = argv[int(found_key_word)+1:] 86 - # don't use "-key" in argv 87 - argv = argv[:int(found_key_word)] 88 - 89 - # ADD argument 90 - if (argv[0].lower() == 'add'): 91 - # add current channel to autojoin. Only option "add" was given.. 92 - if (len(argv) == 1): 93 - if server == "" or channel == "" or server == channel or buf_type == "" or buf_type != 'channel': 94 - weechat.prnt(buffer,"%s%s: current buffer is not a channel buffer." % (weechat.prefix('error'),SCRIPT_NAME)) 95 - return weechat.WEECHAT_RC_OK 96 - list_of_channels, list_of_current_keys = get_autojoin_list(buffer,server) 97 - # no channels in option! 98 - if list_of_channels == 1 and list_of_current_keys == 1: 99 - ptr_config_autojoin = weechat.config_get('irc.server.%s.autojoin' % server) 100 - rc = weechat.config_option_set(ptr_config_autojoin,channel,1) 101 - return weechat.WEECHAT_RC_OK 102 - if channel in list_of_channels: 103 - weechat.prnt(buffer,"%s%s: channel '%s' already in autojoin for server '%s'" % (weechat.prefix("error"),SCRIPT_NAME,channel,server)) 104 - else: 105 - # first char of channel '#' ? 106 - if channel[0] == '#': 107 - if '-key' in args and len(key_words) > 1: 108 - weechat.prnt(buffer,"%s%s: too many key(s) for given channel(s) " % (weechat.prefix('error'),SCRIPT_NAME)) 109 - return weechat.WEECHAT_RC_OK 110 - elif '-key' in args and len(key_words) == 1: 111 - list_of_channels.insert(0,channel) 112 - list_of_current_keys = ','.join(key_words) 113 - # strip leading ',' 114 - if list_of_current_keys[0] == ',': 115 - list_of_current_keys = list_of_current_keys.lstrip(',') 116 - else: 117 - list_of_channels.append(channel) 118 - 119 - if not set_autojoin_list(server,list_of_channels, list_of_current_keys): 120 - weechat.prnt(buffer,"%s%s: set new value for option failed..." % (weechat.prefix('error'),SCRIPT_NAME)) 121 - # server and channels given by user 122 - elif (len(argv) >= 3): 123 - server = argv[1] 124 - list_of_channels = argv[2:] 125 - if '-key' in args and len(list_of_channels) < len(key_words): 126 - weechat.prnt(buffer,"%s%s: too many key(s) for given channel(s) " % (weechat.prefix('error'),SCRIPT_NAME)) 127 - return weechat.WEECHAT_RC_OK 128 - 129 - list_of_current_channels,list_of_current_keys = get_autojoin_list(buffer,server) 130 - # autojoin option is empty 131 - if list_of_current_channels == 1: 132 - # no channel -> no key! 133 - list_of_current_keys = "" 134 - if '-key' in args: 135 - list_of_current_keys = ','.join(key_words) 136 - # strip leading ',' 137 - if list_of_current_keys[0] == ',': 138 - list_of_current_keys = list_of_current_keys.lstrip(',') 139 - if not set_autojoin_list(server,list_of_channels, list_of_current_keys): 140 - weechat.prnt(buffer,"%s%s: set new value for option failed..." % (weechat.prefix('error'),SCRIPT_NAME)) 141 - else: 142 - if '-key' in args: 143 - j = 0 144 - new_keys = [] 145 - list_of_new_keys = [] 146 - for i in list_of_channels: 147 - if i not in list_of_current_channels and j <= len(key_words): 148 - # weechat.prnt(buffer,"channel: %s, channel key is: '%s'" % (i,key_words[j])) 149 - list_of_current_channels.insert(j,i) 150 - new_keys.insert(j,key_words[j]) 151 - j += 1 152 - missing_channels = list_of_current_channels 153 - list_of_new_keys = ','.join(new_keys) 154 - if list_of_current_keys: 155 - list_of_current_keys = list_of_new_keys + ',' + list_of_current_keys 156 - else: 157 - list_of_current_keys = list_of_new_keys 158 - # strip leading ',' 159 - if list_of_current_keys[0] == ',': 160 - list_of_current_keys = list_of_current_keys.lstrip(',') 161 - else: 162 - # check given channels with channels already set in option 163 - missing_channels = get_difference(list_of_channels,list_of_current_channels) 164 - missing_channels = list_of_current_channels + missing_channels 165 - 166 - if not set_autojoin_list(server,missing_channels, list_of_current_keys): 167 - weechat.prnt(buffer,"%s%s: set new value for option failed..." % (weechat.prefix('error'),SCRIPT_NAME)) 168 - return weechat.WEECHAT_RC_OK 169 - 170 - # DEL argument 171 - if (argv[0].lower() == 'del'): 172 - # del current channel from autojoin. Only option "del" was given.. 173 - if (len(argv) == 1): 174 - if server == "" or channel == "" or server == channel or buf_type == "" or buf_type != 'channel': 175 - weechat.prnt(buffer,"%s%s: current buffer is not a channel buffer." % (weechat.prefix('error'),SCRIPT_NAME)) 176 - return weechat.WEECHAT_RC_OK 177 - list_of_channels, list_of_keys = get_autojoin_list(buffer,server) 178 - # no channels in option, nothing to delete 179 - if list_of_channels == 1 and list_of_current_keys == 1: 180 - return weechat.WEECHAT_RC_OK 181 - if channel not in list_of_channels: 182 - weechat.prnt(buffer,"%s%s: channel '%s' not found in autojoin for server '%s'" % (weechat.prefix("error"),SCRIPT_NAME,channel,server)) 183 - return weechat.WEECHAT_RC_OK 184 - else: 185 - # first char of channel '#' ? 186 - if channel[0] == '#': 187 - channel_key_index = list_of_channels.index(channel) 188 - if not list_of_keys: 189 - list_of_channels.remove(list_of_channels[channel_key_index]) 190 - list_of_current_keys = '' 191 - else: 192 - list_of_keys_tup = list_of_keys.split(",") 193 - list_of_current_keys = list_of_keys 194 - # channel does not have a key (position of channel > number of keys!) 195 - if channel_key_index + 1 > len(list_of_keys_tup): 196 - list_of_channels.remove(list_of_channels[channel_key_index]) 197 - # remove channel and key from autjoin option 198 - else: 199 - list_of_channels.remove(list_of_channels[channel_key_index]) 200 - list_of_keys_tup.remove(list_of_keys_tup[channel_key_index]) 201 - # does a key exists, after removing? 202 - if len(list_of_keys_tup) > 0: 203 - list_of_current_keys = ','.join(list_of_keys_tup) 204 - # strip leading ',' 205 - if list_of_current_keys[0] == ',': 206 - list_of_current_keys = list_of_current_keys.lstrip(',') 207 - else: # all keys deleted 208 - list_of_current_keys = '' 209 - 210 - # unset option if everything is gone. 211 - if not list_of_channels and not list_of_current_keys: 212 - ptr_config_autojoin = weechat.config_get('irc.server.%s.autojoin' % server) 213 - if ptr_config_autojoin: 214 - rc = weechat.config_option_unset(ptr_config_autojoin) 215 - return weechat.WEECHAT_RC_OK 216 - 217 - if not set_autojoin_list(server,list_of_channels, list_of_current_keys): 218 - weechat.prnt(buffer,"%s%s: set new value for option failed..." % (weechat.prefix('error'),SCRIPT_NAME)) 219 - 220 - # server and channels given by user 221 - elif (len(argv) >= 3): 222 - server = argv[1] 223 - list_of_current_channels,list_of_current_keys = get_autojoin_list(buffer,server) 224 - 225 - # autojoin option is empty 226 - if list_of_current_channels == 1: 227 - weechat.prnt(buffer,"%s%s: nothing to delete..." % (weechat.prefix('error'),SCRIPT_NAME)) 228 - return weechat.WEECHAT_RC_OK 229 - else: 230 - list_of_channels = args.split(" ")[2:] 231 - if list_of_current_keys: 232 - list_of_current_keys_tup = list_of_current_keys.split(",") 233 - else: 234 - list_of_current_keys_tup = '' 235 - 236 - for i in list_of_channels: 237 - # check if given channel is in list of options 238 - if not i in list_of_current_channels: 239 - continue 240 - channel_key_index = list_of_current_channels.index(i) 241 - # channel does not have a key (position of channel > number of keys!) 242 - if channel_key_index + 1 > len(list_of_current_keys_tup): 243 - list_of_current_channels.remove(i) 244 - # if len(list_of_current_channels) <= 0: 245 - # list_of_current_channels = '' 246 - else: # remove channel and key from autjoin option 247 - list_of_current_channels.remove(i) 248 - list_of_current_keys_tup.remove(list_of_current_keys_tup[channel_key_index]) 249 - # does an key exists, after removing? 250 - if len(list_of_current_keys_tup) > 0: 251 - list_of_current_keys = ','.join(list_of_current_keys_tup) 252 - # strip leading ',' 253 - if list_of_current_keys[0] == ',': 254 - list_of_current_keys = list_of_current_keys.lstrip(',') 255 - else: # all keys deleted 256 - list_of_current_keys = '' 257 - 258 - # for j in list_of_current_channels: 259 - # weechat.prnt(buffer,"chan:%s" % j) 260 - # for j in list_of_current_keys_tup: 261 - # weechat.prnt(buffer,"key :%s" % j) 262 - 263 - # unset option if everything is gone. 264 - if not list_of_current_channels and not list_of_current_keys: 265 - ptr_config_autojoin = weechat.config_get('irc.server.%s.autojoin' % server) 266 - if ptr_config_autojoin: 267 - rc = weechat.config_option_unset(ptr_config_autojoin) 268 - return weechat.WEECHAT_RC_OK 269 - 270 - if not set_autojoin_list(server,list_of_current_channels, list_of_current_keys): 271 - weechat.prnt(buffer,"%s%s: set new value for option failed..." % (weechat.prefix('error'),SCRIPT_NAME)) 272 - 273 - return weechat.WEECHAT_RC_OK 274 - 275 - def get_difference(list1, list2): 276 - return list(set(list1).difference(set(list2))) 277 - 278 - # returns a list of channels and a list of keys 279 - # 1 = something failed, 0 = channel found 280 - def get_autojoin_list(buffer,server): 281 - ptr_config_autojoin = weechat.config_get('irc.server.%s.autojoin' % server) 282 - # option not found! server does not exist 283 - if not ptr_config_autojoin: 284 - weechat.prnt("","%s%s: server '%s' does not exist." % (weechat.prefix('error'),SCRIPT_NAME,server)) 285 - return 1,1 286 - 287 - # get value from autojoin option 288 - channels = weechat.config_string(ptr_config_autojoin) 289 - if not channels: 290 - return 1,1 291 - 292 - # check for keys 293 - if len(re.findall(r" ", channels)) == 0: 294 - list_of_channels = channels.split(",") 295 - list_of_keys = [] 296 - elif len(re.findall(r" ", channels)) == 1: 297 - list_of_channels2,list_of_keys = channels.split(" ") 298 - list_of_channels = list_of_channels2.split(",") 299 - else: 300 - weechat.prnt("","%s%s: irc.server.%s.autojoin not valid..." % (weechat.prefix('error'),SCRIPT_NAME,server)) 301 - return 1,1 302 - 303 - return list_of_channels, list_of_keys 304 - 305 - def set_autojoin_list(server,list_of_channels, list_of_keys): 306 - ptr_config_autojoin = weechat.config_get('irc.server.%s.autojoin' % server) 307 - if not ptr_config_autojoin: 308 - return 0 309 - 310 - if OPTIONS['sorted'].lower() == 'on' and not list_of_keys: 311 - # no keys, sort the channel-list 312 - channels = '%s' % ','.join(sorted(list_of_channels)) 313 - else: 314 - # don't sort channel-list with given key 315 - channels = '%s' % ','.join(list_of_channels) 316 - 317 - # strip leading ',' 318 - if channels[0] == ',': 319 - channels = channels.lstrip(',') 320 - 321 - # add keys to list of channels 322 - if list_of_keys: 323 - channels = '%s %s' % (channels,list_of_keys) 324 - 325 - rc = weechat.config_option_set(ptr_config_autojoin,channels,1) 326 - if not rc: 327 - return 0 328 - return 1 329 - 330 - def autojoinem_completion_cb(data, completion_item, buffer, completion): 331 - # server = weechat.buffer_get_string(buffer, 'localvar_server') # current buffer 332 - input_line = weechat.buffer_get_string(buffer, 'input') 333 - 334 - # get information out of the input_line 335 - argv = input_line.strip().split(" ",3) 336 - if (len(argv) >= 3 and argv[1] == 'del'): 337 - server = argv[2] 338 - 339 - list_of_channels,list_of_keys = get_autojoin_list(buffer,server) 340 - if list_of_channels == 1: 341 - return weechat.WEECHAT_RC_OK 342 - 343 - if (len(argv) >= 4 and argv[1] == 'del'): 344 - list_of_current_channels = argv[3].split(' ') 345 - missing_channels = get_difference(list_of_channels,list_of_current_channels) 346 - if not missing_channels: 347 - return weechat.WEECHAT_RC_OK 348 - list_of_channels = missing_channels 349 - 350 - for i, elem in enumerate(list_of_channels): 351 - weechat.hook_completion_list_add(completion, list_of_channels[i], 0, weechat.WEECHAT_LIST_POS_END) 352 - return weechat.WEECHAT_RC_OK 353 - # ================================[ weechat options & description ]=============================== 354 - def init_options(): 355 - for option,value in OPTIONS.items(): 356 - weechat.config_set_desc_plugin(option, '%s (default: "%s")' % (value[1], value[0])) 357 - if not weechat.config_is_set_plugin(option): 358 - weechat.config_set_plugin(option, value[0]) 359 - OPTIONS[option] = value[0] 360 - else: 361 - OPTIONS[option] = weechat.config_get_plugin(option) 362 - 363 - def toggle_refresh(pointer, name, value): 364 - global OPTIONS 365 - option = name[len('plugins.var.python.' + SCRIPT_NAME + '.'):] # get optionname 366 - OPTIONS[option] = value # save new value 367 - return weechat.WEECHAT_RC_OK 368 - # ================================[ main ]=============================== 369 - if __name__ == "__main__": 370 - if weechat.register(SCRIPT_NAME, SCRIPT_AUTHOR, SCRIPT_VERSION, SCRIPT_LICENSE, SCRIPT_DESC, '', ''): 371 - version = weechat.info_get("version_number", "") or 0 372 - weechat.hook_command(SCRIPT_NAME,SCRIPT_DESC, 373 - 'add <server> [<channel1>[ <channel2>...]] | [-key <channelkey> [<channelkey>...]] ||' 374 - 'del <server> [<channel1>[ <channel2>...]]', 375 - 'add <server> <channel>: add channel to irc.server.<servername>.autojoin\n' 376 - ' -key <channelkey>: name of channelkey\n' 377 - 'del <server> <channel>: del channel from irc.server.<servername>.autojoin\n' 378 - '\n' 379 - 'Examples:\n' 380 - ' add current channel to corresponding server option:\n' 381 - ' /' + SCRIPT_NAME + ' add\n' 382 - ' add all channels from all server to corresponding server option:\n' 383 - ' /allchan /' + SCRIPT_NAME + ' add\n' 384 - ' add channel #weechat to autojoin option on server freenode:\n' 385 - ' /' + SCRIPT_NAME + ' add freenode #weechat\n' 386 - ' add channel #weechat and #weechat-de to autojoin option on server freenode, with channel key for channel #weechat:\n' 387 - ' /' + SCRIPT_NAME + ' add freenode #weechat #weechat-de -key my_channel_key\n' 388 - ' del channels #weechat and #weechat-de from autojoin option on server freenode:\n' 389 - ' /' + SCRIPT_NAME + ' del freenode #weechat #weechat-de', 390 - 'add %(irc_servers) %(irc_server_channels)|%*||' 391 - 'del %(irc_servers) %(plugin_autojoinem)|%*', 392 - 'add_autojoin_cmd_cb', '') 393 - 394 - init_options() 395 - weechat.hook_completion('plugin_autojoinem', 'autojoin_completion', 'autojoinem_completion_cb', '') 396 - weechat.hook_config('plugins.var.python.' + SCRIPT_NAME + '.*', 'toggle_refresh', '') 397 - 398 - # if int(version) >= 0x00030600: 399 - # else: 400 - # weechat.prnt("","%s%s %s" % (weechat.prefix("error"),SCRIPT_NAME,": needs version 0.3.6 or higher")) 401 - # weechat.command("","/wait 1ms /python unload %s" % SCRIPT_NAME)
-1
weechat/.weechat/python/autoload/autojoinem.py
··· 1 - ../autojoinem.py
+1
weechat/.weechat/python/autoload/weestats.py
··· 1 + ../weestats.py
+156
weechat/.weechat/python/weestats.py
··· 1 + # -*- coding: utf-8 -*- 2 + # 3 + # weestats.py, version 0.2 for WeeChat version 0.3 4 + # Latest development version: https://github.com/FiXato/weechat_scripts 5 + # 6 + # Inserts some statistics into your input field about the buffers/windows 7 + # you have open. 8 + # Example: 151 buffers (46 merged): 135 channels, 9 servers, 3 queries, 9 + # 1 script, 1 python, 1 perl, 1 core; 3 windows 10 + # 11 + ## History: 12 + # 13 + ### 2012-03-29: FiXato: 14 + # * version 0.1: initial release. 15 + # * Display a count of all the different buffers you have open. 16 + # * Display a count of all the open windows. 17 + # * version 0.2: Getting the splits. 18 + # * Displays the how many vertical and horizontal windows. 19 + # (not quite sure if my approximation is correct though..) 20 + # * Fixed possible memleak (forgot to free an infolist) 21 + ### 2015-05-02: arza: 22 + # * version 0.3: 23 + # * handle non-#-channels 24 + # * numerical sort for buffer info 25 + # * moved window split info to option -split 26 + # * simplified the output 27 + ### 2019-07-05: Sébastien Helleu: 28 + # * version 0.4: 29 + # * make script compatible with Python 3 30 + # 31 + ## Acknowledgements: 32 + # * Sebastien "Flashcode" Helleu, for developing the kick-ass chat/IRC 33 + # client WeeChat 34 + # 35 + ## TODO: 36 + # - Add more statistics, such as: 37 + # - average and total history lines. 38 + # - average and total topic/title lengths 39 + # - how many are displayed in a window 40 + # 41 + ## Copyright (c) 2012 Filip H.F. "FiXato" Slagter, 42 + # <FiXato+WeeChat [at] Gmail [dot] com> 43 + # https://google.com/profiles/FiXato 44 + # 45 + # Permission is hereby granted, free of charge, to any person obtaining 46 + # a copy of this software and associated documentation files (the 47 + # "Software"), to deal in the Software without restriction, including 48 + # without limitation the rights to use, copy, modify, merge, publish, 49 + # distribute, sublicense, and/or sell copies of the Software, and to 50 + # permit persons to whom the Software is furnished to do so, subject to 51 + # the following conditions: 52 + # 53 + # The above copyright notice and this permission notice shall be 54 + # included in all copies or substantial portions of the Software. 55 + # 56 + # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 57 + # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 58 + # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 59 + # NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 60 + # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 61 + # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 62 + # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 63 + # 64 + 65 + from __future__ import print_function 66 + 67 + SCRIPT_NAME = "weestats" 68 + SCRIPT_AUTHOR = "Filip H.F. 'FiXato' Slagter <fixato [at] gmail [dot] com>" 69 + SCRIPT_VERSION = "0.4" 70 + SCRIPT_LICENSE = "MIT" 71 + SCRIPT_DESC = "Useless statistics about your open buffers and windows" 72 + SCRIPT_COMMAND = "weestats" 73 + SCRIPT_CLOSE_CB = "close_cb" 74 + 75 + import_ok = True 76 + 77 + try: 78 + import weechat as w 79 + except ImportError: 80 + print("This script must be run under WeeChat.") 81 + import_ok = False 82 + 83 + def close_cb(*kwargs): 84 + return w.WEECHAT_RC_OK 85 + 86 + def command_main(data, buffer, args): 87 + infolist = w.infolist_get("buffer", "", "") 88 + buffer_groups = {} 89 + results = [] 90 + buffer_count = 0 91 + merge_count = 0 92 + numbers = set() 93 + while w.infolist_next(infolist): 94 + bplugin = w.infolist_string(infolist, "plugin_name") 95 + bname = w.infolist_string(infolist, "name") 96 + bpointer = w.infolist_pointer(infolist, "pointer") 97 + bnumber = w.infolist_integer(infolist, "number") 98 + btype = w.buffer_get_string(bpointer, 'localvar_type') 99 + if not bnumber in numbers: 100 + numbers.add(bnumber) 101 + else: 102 + merge_count += 1 103 + 104 + if btype == 'server': 105 + bdesc = 'servers' 106 + elif btype == 'channel': 107 + bdesc = 'channels' 108 + elif btype == 'private': 109 + bdesc = 'queries' 110 + else: 111 + bdesc = bplugin 112 + 113 + buffer_groups.setdefault(bdesc,[]).append({'name': bname, 'pointer': bpointer}) 114 + 115 + w.infolist_free(infolist) 116 + 117 + infolist = w.infolist_get("window", "", "") 118 + windows_v = set() 119 + windows_h = set() 120 + windows = set() 121 + while w.infolist_next(infolist): 122 + window = w.infolist_pointer(infolist, "pointer") 123 + window_w = w.infolist_integer(infolist, "width_pct") 124 + window_h = w.infolist_integer(infolist, "height_pct") 125 + windows.add(window) 126 + if window_h == 100 and window_w != 100: 127 + windows_v.add(window) 128 + elif window_w == 100 and window_h != 100: 129 + windows_h.add(window) 130 + #else: #both 100%, thus no splits 131 + w.infolist_free(infolist) 132 + 133 + window_count = len(windows) 134 + 135 + for desc, buffers in buffer_groups.items(): 136 + buffer_count += len(buffers) 137 + results.append('%i %s' % (len(buffers), desc)) 138 + 139 + buffer_stats = ', '.join(sorted(results, key = lambda item: (int(item.partition(' ')[0]) if item[0].isdigit() else float('inf'), item),reverse=True)) # descending numerical sort of strings 140 + stats_string = '%i buffers (%i merged): %s; %i windows' % (buffer_count, merge_count, buffer_stats, window_count) 141 + if '-split' in args: 142 + stats_string += ": %i vertically / %i horizontally split" % (len(windows_v), len(windows_h)) 143 + w.command("", "/input insert %s" % stats_string) 144 + return w.WEECHAT_RC_OK 145 + 146 + if __name__ == "__main__" and import_ok: 147 + if w.register(SCRIPT_NAME, SCRIPT_AUTHOR, SCRIPT_VERSION, 148 + SCRIPT_LICENSE, SCRIPT_DESC, SCRIPT_CLOSE_CB, ""): 149 + 150 + w.hook_command(SCRIPT_COMMAND, 151 + SCRIPT_DESC, 152 + "-split", 153 + "Inserts useless statistics about your open buffers and windows into your input line.\n" 154 + "-split: Include information about window splits.", 155 + "-split", 156 + "command_main", "")
+1 -2
weechat/.weechat/relay.conf
··· 30 30 auth_timeout = 60 31 31 bind_address = "" 32 32 clients_purge_delay = 0 33 - compression_level = 6 33 + compression = 20 34 34 ipv6 = on 35 35 max_clients = 5 36 36 nonce_size = 16 ··· 55 55 commands = "" 56 56 57 57 [port] 58 - ipv4.irc = 6666 59 58 60 59 [path] 61 60 unix.weechat = "%h/relay_socket"
+9 -17
weechat/.weechat/trigger.conf
··· 25 25 trigger_disabled = red 26 26 27 27 [trigger] 28 - autojoin.arguments = "*,irc_in_join" 29 - autojoin.command = "/autojoinem add ${server} ${channel};/mute save" 30 - autojoin.conditions = "" 31 - autojoin.enabled = on 32 - autojoin.hook = signal 33 - autojoin.post_action = none 34 - autojoin.regex = "" 35 - autojoin.return_code = ok 36 - autopart.arguments = "*,irc_in_part" 37 - autopart.command = "/autojoinem del ${server} ${channel};/mute save" 38 - autopart.conditions = "" 39 - autopart.enabled = on 40 - autopart.hook = signal 41 - autopart.post_action = none 42 - autopart.regex = "" 43 - autopart.return_code = ok 44 28 beep.arguments = "" 45 29 beep.command = "/print -beep" 46 30 beep.conditions = "${tg_highlight} || ${tg_msg_pv}" ··· 55 39 cmd_pass.enabled = on 56 40 cmd_pass.hook = modifier 57 41 cmd_pass.post_action = none 58 - 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:+}}" 42 + cmd_pass.regex = "==^((/(msg|m|quote) +(-server +[^ ]+ +)?nickserv +(id|identify|set +password|ghost +[^ ]+|release +[^ ]+|regain +[^ ]+|recover +[^ ]+|setpass +[^ ]+) +)|/oper +[^ ]+ +|/quote +pass +|/secure +(passphrase|decrypt|set +[^ ]+) +)(.*)==${re:1}${hide:*,${re:+}}" 59 43 cmd_pass.return_code = ok 44 + cmd_pass_register.arguments = "5000|input_text_display;5000|history_add;5000|irc_command_auth" 45 + cmd_pass_register.command = "" 46 + cmd_pass_register.conditions = "" 47 + cmd_pass_register.enabled = on 48 + cmd_pass_register.hook = modifier 49 + cmd_pass_register.post_action = none 50 + cmd_pass_register.regex = "==^(/(msg|m|quote) +(-server +[^ ]+ +)?nickserv +register +)([^ ]+)(.*)==${re:1}${hide:*,${re:4}}${re:5}" 51 + cmd_pass_register.return_code = ok 60 52 greentext.arguments = "weechat_print" 61 53 greentext.command = "" 62 54 greentext.conditions = "${tg_message_nocolor} =~ ^>[^:._]"
+1 -1
weechat/.weechat/weechat.conf
··· 243 243 244 244 [plugin] 245 245 autoload = "*" 246 - debug = off 247 246 extension = ".so,.dll" 248 247 path = "%h/plugins" 249 248 save_config_on_unload = on ··· 371 370 default.current = on 372 371 373 372 [notify] 373 + irc.server.liberta.casa = highlight 374 374 irc.server.pisslocal = none 375 375 irc.server.tilde = highlight 376 376 perl.highmon = none