my shell and tool configurations

latest weechat

+185 -47
+1 -1
weechat/.weechat/buflist.conf
··· 36 36 lag = " ${color:green}[${color:brown}${lag}${color:green}]" 37 37 name = "${name}" 38 38 nick_prefix = "${color_nick_prefix}${nick_prefix}" 39 - number = "${color:green}${number}${if:${number_displayed}?:}" 39 + number = "${color:green}${number}"
+45 -45
weechat/.weechat/irc.conf
··· 112 112 addresses = "" 113 113 anti_flood_prio_high = 2 114 114 anti_flood_prio_low = 2 115 - autoconnect = off 115 + autoconnect = on 116 116 autojoin = "" 117 117 autoreconnect = on 118 118 autoreconnect_delay = 10 ··· 156 156 tilde.proxy 157 157 tilde.ipv6 158 158 tilde.ssl = off 159 - tilde.ssl_cert 159 + tilde.ssl_cert = "%h/ssl/benharri.pem" 160 160 tilde.ssl_priorities 161 161 tilde.ssl_dhkey_size 162 162 tilde.ssl_fingerprint ··· 180 180 tilde.usermode 181 181 tilde.command = "/oper root ${sec.data.tildenetoper}; /msg operserv login ${sec.data.pass}" 182 182 tilde.command_delay 183 - tilde.autojoin = "#opers,#secret-sudoers,#meta,#team,#sudoers,#YourTilde,#chaos,#bots,#music,#share,#stevenuniverse,#suwp,#projects,#politics,#dnd,#journal,#shitposting,#quotes,#gopher,#tildeverse,#venting,#idlerpg,#tilderadio,#zaphod,#thunix,#yee,#modded,#minecraft,#minetest,#bbj,#tildelinux,#tildetheater,#slbr youneedtoknowthepassword,secretsudoteam" 183 + tilde.autojoin = "#chaos,#secret-sudoers,#opers,#meta,#team,#sudoers,#YourTilde,#bots,#music,#share,#stevenuniverse,#suwp,#projects,#politics,#dnd,#journal,#shitposting,#quotes,#gopher,#tildeverse,#venting,#idlerpg,#tilderadio,#zaphod,#thunix,#yee,#modded,#minecraft,#minetest,#bbj,#tildelinux,#tildetheater,#slbr fosslinux,secretsudoteam,youneedtoknowthepassword" 184 184 tilde.autorejoin 185 185 tilde.autorejoin_delay 186 186 tilde.connection_timeout ··· 344 344 sdf.usermode 345 345 sdf.command 346 346 sdf.command_delay 347 - sdf.autojoin = "#helpdesk,#anonradio,#gopher,#sdf" 347 + sdf.autojoin = "#sdf,#gopher,#anonradio,#helpdesk" 348 348 sdf.autorejoin 349 349 sdf.autorejoin_delay 350 350 sdf.connection_timeout ··· 521 521 blinkenshell.msg_quit 522 522 blinkenshell.notify 523 523 blinkenshell.split_msg_max_length 524 - dgrove.addresses = "irc.dannygrove.com/6697" 525 - dgrove.proxy 526 - dgrove.ipv6 527 - dgrove.ssl = on 528 - dgrove.ssl_cert 529 - dgrove.ssl_priorities 530 - dgrove.ssl_dhkey_size 531 - dgrove.ssl_fingerprint 532 - dgrove.ssl_verify 533 - dgrove.password 534 - dgrove.capabilities 535 - dgrove.sasl_mechanism 536 - dgrove.sasl_username 537 - dgrove.sasl_password 538 - dgrove.sasl_key 539 - dgrove.sasl_timeout 540 - dgrove.sasl_fail 541 - dgrove.autoconnect 542 - dgrove.autoreconnect 543 - dgrove.autoreconnect_delay 544 - dgrove.nicks 545 - dgrove.nicks_alternate 546 - dgrove.username 547 - dgrove.realname 548 - dgrove.local_hostname 549 - dgrove.usermode 550 - dgrove.command 551 - dgrove.command_delay 552 - dgrove.autojoin 553 - dgrove.autorejoin 554 - dgrove.autorejoin_delay 555 - dgrove.connection_timeout 556 - dgrove.anti_flood_prio_high 557 - dgrove.anti_flood_prio_low 558 - dgrove.away_check 559 - dgrove.away_check_max_nicks 560 - dgrove.msg_kick 561 - dgrove.msg_part 562 - dgrove.msg_quit 563 - dgrove.notify 564 - dgrove.split_msg_max_length 565 524 cat.addresses = "tilde.cat" 566 525 cat.proxy 567 526 cat.ipv6 ··· 644 603 bitlbee.msg_quit 645 604 bitlbee.notify 646 605 bitlbee.split_msg_max_length 606 + inspircd.addresses = "irc.inspircd.org" 607 + inspircd.proxy 608 + inspircd.ipv6 609 + inspircd.ssl 610 + inspircd.ssl_cert 611 + inspircd.ssl_priorities 612 + inspircd.ssl_dhkey_size 613 + inspircd.ssl_fingerprint 614 + inspircd.ssl_verify 615 + inspircd.password 616 + inspircd.capabilities 617 + inspircd.sasl_mechanism 618 + inspircd.sasl_username = "benharri" 619 + inspircd.sasl_password = "${sec.data.pass}" 620 + inspircd.sasl_key 621 + inspircd.sasl_timeout 622 + inspircd.sasl_fail 623 + inspircd.autoconnect = on 624 + inspircd.autoreconnect 625 + inspircd.autoreconnect_delay 626 + inspircd.nicks = "benharri" 627 + inspircd.nicks_alternate 628 + inspircd.username 629 + inspircd.realname 630 + inspircd.local_hostname 631 + inspircd.usermode 632 + inspircd.command 633 + inspircd.command_delay 634 + inspircd.autojoin = "#inspircd" 635 + inspircd.autorejoin 636 + inspircd.autorejoin_delay 637 + inspircd.connection_timeout 638 + inspircd.anti_flood_prio_high 639 + inspircd.anti_flood_prio_low 640 + inspircd.away_check 641 + inspircd.away_check_max_nicks 642 + inspircd.msg_kick 643 + inspircd.msg_part 644 + inspircd.msg_quit 645 + inspircd.notify 646 + inspircd.split_msg_max_length
+1
weechat/.weechat/python/autoload/buffer_autoclose.py
··· 1 + ../buffer_autoclose.py
+137
weechat/.weechat/python/buffer_autoclose.py
··· 1 + # -*- coding: utf-8 -*- 2 + # 3 + # Copyright (c) 2009 by xt <xt@bash.no> 4 + # 5 + # This program is free software; you can redistribute it and/or modify 6 + # it under the terms of the GNU General Public License as published by 7 + # the Free Software Foundation; either version 3 of the License, or 8 + # (at your option) any later version. 9 + # 10 + # This program is distributed in the hope that it will be useful, 11 + # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 + # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 + # GNU General Public License for more details. 14 + # 15 + # You should have received a copy of the GNU General Public License 16 + # along with this program. If not, see <http://www.gnu.org/licenses/>. 17 + # 18 + 19 + # 20 + # (this script requires WeeChat 0.3.0 or newer) 21 + # 22 + # History: 23 + # 2018-04-10, Sébastien Helleu <flashcode@flashtux.org> 24 + # version 0.5: fix infolist_time for WeeChat >= 2.2 (WeeChat returns a long 25 + # integer instead of a string) 26 + # 2016-02-05, ixti 27 + # version 0.4: Add Python3 support 28 + # 2009-12-15, xt 29 + # version 0.3: moved around some control structures to not be as noisy 30 + # 2009-12-02, xt 31 + # version 0.2: bugfix, more printing 32 + # 2009-12-01, xt <xt@bash.no> 33 + # version 0.1: initial release 34 + 35 + import weechat as w 36 + import time 37 + 38 + SCRIPT_NAME = "buffer_autoclose" 39 + SCRIPT_AUTHOR = "xt <xt@bash.no>" 40 + SCRIPT_VERSION = "0.5" 41 + SCRIPT_LICENSE = "GPL3" 42 + SCRIPT_DESC = "Automatically close inactive private message buffers" 43 + 44 + settings = { 45 + 'interval': '1', # How often in minutes to check 46 + 'age_limit': '30', # How old in minutes before auto close 47 + 'ignore': '', # Buffers to ignore (use full name: server.buffer_name) 48 + } 49 + 50 + if w.register(SCRIPT_NAME, SCRIPT_AUTHOR, SCRIPT_VERSION, SCRIPT_LICENSE, 51 + SCRIPT_DESC, "", ""): 52 + for option, default_value in settings.items(): 53 + if not w.config_is_set_plugin(option): 54 + w.config_set_plugin(option, default_value) 55 + w.hook_timer(\ 56 + int(w.config_get_plugin('interval')) * 1000 * 60, 57 + 0, 58 + 0, 59 + "close_time_cb", 60 + '') 61 + 62 + 63 + def get_all_buffers(): 64 + '''Returns list with pointers of all open buffers.''' 65 + buffers = [] 66 + infolist = w.infolist_get('buffer', '', '') 67 + while w.infolist_next(infolist): 68 + buffer_type = w.buffer_get_string(w.infolist_pointer(infolist, 'pointer'), 'localvar_type') 69 + if buffer_type == 'private': # we only close private message buffers for now 70 + buffers.append(w.infolist_pointer(infolist, 'pointer')) 71 + w.infolist_free(infolist) 72 + return buffers 73 + 74 + def get_last_line_date(buffer): 75 + date = '1970-01-01 01:00:00' 76 + infolist = w.infolist_get('buffer_lines', buffer, '') 77 + while w.infolist_prev(infolist): 78 + date = w.infolist_time(infolist, 'date') 79 + # since WeeChat 2.2, infolist_time returns a long integer instead of 80 + # a string 81 + if not isinstance(date, str): 82 + date = time.strftime('%F %T', time.localtime(int(date))) 83 + if date != '1970-01-01 01:00:00': 84 + # Some lines like "Day changed to" message doesn't have date 85 + # set so loop until we find a message that does 86 + break 87 + w.infolist_free(infolist) 88 + return date 89 + 90 + def is_in_hotlist(buffer): 91 + ''' Returns true if buffer is in hotlist, false if not''' 92 + 93 + hotlist = w.infolist_get('hotlist', '', '') 94 + found = False 95 + while w.infolist_next(hotlist): 96 + thebuffer = w.infolist_pointer(hotlist, 'buffer_pointer') 97 + if thebuffer == buffer: 98 + found = True 99 + name = w.buffer_get_string(thebuffer, 'short_name') 100 + break 101 + 102 + w.infolist_free(hotlist) 103 + return found 104 + 105 + def close_time_cb(buffer, args): 106 + ''' Callback for check for inactivity and close ''' 107 + 108 + for buffer in get_all_buffers(): 109 + name = w.buffer_get_string(buffer, 'name') 110 + 111 + 112 + date = get_last_line_date(buffer) 113 + date = time.mktime(time.strptime(date, '%Y-%m-%d %H:%M:%S')) 114 + now = time.time() 115 + seconds_old = now - date 116 + if seconds_old > int(w.config_get_plugin('age_limit'))*60: 117 + if is_in_hotlist(buffer): 118 + #w.prnt('', '%s: Not closing buffer: %s: it is in hotlist' %(SCRIPT_NAME, name)) 119 + continue 120 + if name in w.config_get_plugin('ignore').split(','): 121 + #w.prnt('', '%s: Not closing buffer: %s: it is in ignore list' %(SCRIPT_NAME, name)) 122 + continue 123 + if buffer == w.current_buffer(): 124 + # Never close current buffer 125 + #w.prnt('', '%s: Not closing buffer: %s: it is in currently active' %(SCRIPT_NAME, name)) 126 + continue 127 + if len(w.buffer_get_string(buffer, 'input')): 128 + # Don't close buffers with text on input line 129 + #w.prnt('', '%s: Not closing buffer: %s: it has input' %(SCRIPT_NAME, name)) 130 + continue 131 + 132 + w.prnt('', '%s: Closing buffer: %s' %(SCRIPT_NAME, name)) 133 + w.command(buffer, '/buffer close') 134 + #else: 135 + # w.prnt('', '%s: Not closing buffer: %s: it is too new: %s' %(SCRIPT_NAME, name, seconds_old)) 136 + 137 + return w.WEECHAT_RC_OK
+1 -1
weechat/.weechat/weechat.conf
··· 110 110 prefix_join = "-->" 111 111 prefix_network = "--" 112 112 prefix_quit = "<--" 113 - prefix_same_nick = "-" 113 + prefix_same_nick = "⤷" 114 114 prefix_suffix = "│" 115 115 quote_nick_prefix = "<" 116 116 quote_nick_suffix = ">"