From fb68e3b2d8c5caf93362f949d85c56a8922232cf Mon Sep 17 00:00:00 2001 From: Johannes Löthberg Date: Thu, 14 May 2015 13:43:05 +0200 Subject: weechat: aspell while searching --- weechat/aspell.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'weechat') diff --git a/weechat/aspell.conf b/weechat/aspell.conf index 3f5c675..a408f98 100644 --- a/weechat/aspell.conf +++ b/weechat/aspell.conf @@ -9,7 +9,7 @@ suggestions = default [check] commands = "ame,amsg,away,command,cycle,kick,kickban,me,msg,notice,part,query,quit,topic" default_dict = "en" -during_search = off +during_search = on enabled = on real_time = on suggestions = 0 -- cgit v1.2.3-54-g00ecf From d614c64a6cdeccbd2ee3cdf0cd68b43b9ee8e81a Mon Sep 17 00:00:00 2001 From: Johannes Löthberg Date: Thu, 14 May 2015 13:43:20 +0200 Subject: weechat: Use new znc certificate --- weechat/irc.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'weechat') diff --git a/weechat/irc.conf b/weechat/irc.conf index eae28de..1e22905 100644 --- a/weechat/irc.conf +++ b/weechat/irc.conf @@ -136,7 +136,7 @@ sasl_password = "" sasl_timeout = 15 sasl_username = "" ssl = on -ssl_cert = "%h/keys/demize.pem" +ssl_cert = "%h/keys/znc-cert.pem" ssl_dhkey_size = 512 ssl_fingerprint = "" ssl_priorities = "NORMAL" -- cgit v1.2.3-54-g00ecf From 58f0b94de809de236895e7755c6eda4286715cf5 Mon Sep 17 00:00:00 2001 From: Johannes Löthberg Date: Thu, 14 May 2015 13:43:46 +0200 Subject: weechat: iset: 3.6 → 3.7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- weechat/perl/iset.pl | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'weechat') diff --git a/weechat/perl/iset.pl b/weechat/perl/iset.pl index f179022..0a4f8b5 100644 --- a/weechat/perl/iset.pl +++ b/weechat/perl/iset.pl @@ -1,6 +1,6 @@ # # Copyright (C) 2008-2014 Sebastien Helleu -# Copyright (C) 2010-2014 Nils Görs +# Copyright (C) 2010-2015 Nils Görs # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -19,6 +19,8 @@ # # History: # +# 2015-05-01, nils_2 : +# version 3.7: fix two perl warnings (reported by t3chguy) # 2014-09-30, arza : # version 3.6: fix current line counter when options aren't found # 2014-06-03, nils_2 : @@ -117,7 +119,7 @@ use strict; my $PRGNAME = "iset"; -my $VERSION = "3.6"; +my $VERSION = "3.7"; my $DESCR = "Interactive Set for configuration options"; my $AUTHOR = "Sebastien Helleu "; my $LICENSE = "GPL3"; @@ -237,6 +239,10 @@ sub iset_create_filter sub iset_buffer_input { my ($data, $buffer, $string) = ($_[0], $_[1], $_[2]); + + # string begins with space? + return weechat::WEECHAT_RC_OK if (substr($string, 0, 1 ) eq " "); + if ($string eq "q") { weechat::buffer_close($buffer); @@ -1162,6 +1168,8 @@ sub iset_hsignal_mouse_cb { my ($data, $signal, %hash) = ($_[0], $_[1], %{$_[2]}); + return weechat::WEECHAT_RC_OK unless (@options_types); + if ($hash{"_buffer_name"} eq $PRGNAME && ($hash{"_buffer_plugin"} eq $LANG)) { if ($hash{"_key"} eq "button1") -- cgit v1.2.3-54-g00ecf From 44984c0b410fc171fab50fefc6b6671c605036e7 Mon Sep 17 00:00:00 2001 From: Johannes Löthberg Date: Thu, 14 May 2015 13:45:02 +0200 Subject: weechat: colorize_nicks: 17 → 20 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- weechat/python/colorize_nicks.py | 51 +++++++++++++++++++++++----------------- 1 file changed, 30 insertions(+), 21 deletions(-) (limited to 'weechat') diff --git a/weechat/python/colorize_nicks.py b/weechat/python/colorize_nicks.py index d7b3b70..5978253 100644 --- a/weechat/python/colorize_nicks.py +++ b/weechat/python/colorize_nicks.py @@ -21,6 +21,12 @@ # # # History: +# 2015-04-19, xt +# version 20: fix ignore of nicks in URLs +# 2015-04-18, xt +# version 19: new option ignore nicks in URLs +# 2015-03-03, xt +# version 18: iterate buffers looking for nicklists instead of servers # 2015-02-23, holomorph # version 17: fix coloring in non-channel buffers (#58) # 2014-09-17, holomorph @@ -67,7 +73,7 @@ w = weechat SCRIPT_NAME = "colorize_nicks" SCRIPT_AUTHOR = "xt " -SCRIPT_VERSION = "17" +SCRIPT_VERSION = "20" SCRIPT_LICENSE = "GPL" SCRIPT_DESC = "Use the weechat nick colors in the chat area" @@ -126,6 +132,10 @@ def colorize_config_init(): colorize_config_file, section_look, "greedy_matching", "boolean", "If off, then use lazy matching instead", "", 0, 0, "on", "on", 0, "", "", "", "", "", "") + colorize_config_option["ignore_nicks_in_urls"] = weechat.config_new_option( + colorize_config_file, section_look, "ignore_nicks_in_urls", + "boolean", "If on, don't colorize nicks inside URLs", "", 0, + 0, "off", "off", 0, "", "", "", "", "", "") def colorize_config_read(): ''' Read configuration file. ''' @@ -144,6 +154,7 @@ def colorize_cb(data, modifier, modifier_data, line): global ignore_nicks, ignore_channels, colored_nicks + full_name = modifier_data.split(';')[1] channel = '.'.join(full_name.split('.')[1:]) @@ -171,6 +182,7 @@ def colorize_cb(data, modifier, modifier_data, line): # Check that nick is not ignored and longer than minimum length if len(nick) < min_length or nick in ignore_nicks: continue + # Check that nick is in the dictionary colored_nicks if nick in colored_nicks[buffer]: nick_color = colored_nicks[buffer][nick] @@ -178,6 +190,10 @@ def colorize_cb(data, modifier, modifier_data, line): # Let's use greedy matching. Will check against every word in a line. if w.config_boolean(colorize_config_option['greedy_matching']): for word in line.split(): + if w.config_boolean(colorize_config_option['ignore_nicks_in_urls']) and \ + word.startswith(('http://', 'https://')): + continue + if nick in word: # Is there a nick that contains nick and has a greater lenght? # If so let's save that nick into var biggest_nick @@ -247,30 +263,23 @@ def populate_nicks(*args): colored_nicks = {} - servers = w.infolist_get('irc_server', '', '') - while w.infolist_next(servers): - servername = w.infolist_string(servers, 'name') - colored_nicks[servername] = {} - my_nick = w.info_get('irc_nick', servername) - channels = w.infolist_get('irc_channel', '', servername) - while w.infolist_next(channels): - pointer = w.infolist_pointer(channels, 'buffer') - nicklist = w.infolist_get('nicklist', pointer, '') - - if pointer not in colored_nicks: - colored_nicks[pointer] = {} - - while w.infolist_next(nicklist): - nick = w.infolist_string(nicklist, 'name') - nick_color = colorize_nick_color(nick, my_nick) + buffers = w.infolist_get('buffer', '', '') + while w.infolist_next(buffers): + buffer_ptr = w.infolist_pointer(buffers, 'pointer') + my_nick = w.buffer_get_string(buffer_ptr, 'localvar_nick') + nicklist = w.infolist_get('nicklist', buffer_ptr, '') + while w.infolist_next(nicklist): + if buffer_ptr not in colored_nicks: + colored_nicks[buffer_ptr] = {} - colored_nicks[pointer][nick] = nick_color + nick = w.infolist_string(nicklist, 'name') + nick_color = colorize_nick_color(nick, my_nick) - w.infolist_free(nicklist) + colored_nicks[buffer_ptr][nick] = nick_color - w.infolist_free(channels) + w.infolist_free(nicklist) - w.infolist_free(servers) + w.infolist_free(buffers) return w.WEECHAT_RC_OK -- cgit v1.2.3-54-g00ecf From c4f53a7fca0eb5b3aa113cf57494e1e8aa6620cf Mon Sep 17 00:00:00 2001 From: Johannes Löthberg Date: Fri, 29 May 2015 13:10:31 +0200 Subject: weechat/irc: set highlights --- weechat/irc.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'weechat') diff --git a/weechat/irc.conf b/weechat/irc.conf index 1e22905..71aa71c 100644 --- a/weechat/irc.conf +++ b/weechat/irc.conf @@ -23,8 +23,8 @@ display_join_message = "329,332,333" display_old_topic = on display_pv_away_once = on display_pv_back = on -highlight_channel = "$nick" -highlight_pv = "$nick" +highlight_channel = "$nick,demize,demi,remi,remize,kyrias,kyriasis" +highlight_pv = "" highlight_server = "$nick" highlight_tags_restrict = "irc_privmsg,irc_notice" item_away_message = on -- cgit v1.2.3-54-g00ecf From b6730aa967191eebbf4af397efbabe0b0fd68420 Mon Sep 17 00:00:00 2001 From: Johannes Löthberg Date: Fri, 10 Jul 2015 17:59:13 +0200 Subject: weechat: Remove kyriasis from highlights MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Too damned annoying.. Signed-off-by: Johannes Löthberg --- weechat/irc.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'weechat') diff --git a/weechat/irc.conf b/weechat/irc.conf index 71aa71c..f29c0ed 100644 --- a/weechat/irc.conf +++ b/weechat/irc.conf @@ -23,7 +23,7 @@ display_join_message = "329,332,333" display_old_topic = on display_pv_away_once = on display_pv_back = on -highlight_channel = "$nick,demize,demi,remi,remize,kyrias,kyriasis" +highlight_channel = "$nick,demize,demi,remi,remize,kyrias" highlight_pv = "" highlight_server = "$nick" highlight_tags_restrict = "irc_privmsg,irc_notice" -- cgit v1.2.3-54-g00ecf From 9df87332e3b49d2949ecd4cbad8e526ff50e4248 Mon Sep 17 00:00:00 2001 From: Johannes Löthberg Date: Fri, 10 Jul 2015 17:59:54 +0200 Subject: weechat: Add HypeIRC MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Johannes Löthberg --- weechat/irc.conf | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'weechat') diff --git a/weechat/irc.conf b/weechat/irc.conf index f29c0ed..811b43b 100644 --- a/weechat/irc.conf +++ b/weechat/irc.conf @@ -296,3 +296,41 @@ Therian.default_msg_kick Therian.default_msg_part Therian.default_msg_quit Therian.notify +HypeIRC.addresses = "theos.kyriasis.com/6697" +HypeIRC.proxy +HypeIRC.ipv6 +HypeIRC.ssl +HypeIRC.ssl_cert +HypeIRC.ssl_priorities +HypeIRC.ssl_dhkey_size +HypeIRC.ssl_fingerprint +HypeIRC.ssl_verify +HypeIRC.password = "kyrias/HypeIRC:" +HypeIRC.capabilities +HypeIRC.sasl_mechanism +HypeIRC.sasl_username +HypeIRC.sasl_password +HypeIRC.sasl_key +HypeIRC.sasl_timeout +HypeIRC.sasl_fail +HypeIRC.autoconnect = on +HypeIRC.autoreconnect +HypeIRC.autoreconnect_delay +HypeIRC.nicks +HypeIRC.username +HypeIRC.realname +HypeIRC.local_hostname +HypeIRC.command +HypeIRC.command_delay +HypeIRC.autojoin +HypeIRC.autorejoin +HypeIRC.autorejoin_delay +HypeIRC.connection_timeout +HypeIRC.anti_flood_prio_high +HypeIRC.anti_flood_prio_low +HypeIRC.away_check +HypeIRC.away_check_max_nicks +HypeIRC.default_msg_kick +HypeIRC.default_msg_part +HypeIRC.default_msg_quit +HypeIRC.notify -- cgit v1.2.3-54-g00ecf From 9a1647f65836f4a0b42e5f7935b921eda70bd403 Mon Sep 17 00:00:00 2001 From: Johannes Löthberg Date: Fri, 10 Jul 2015 18:00:06 +0200 Subject: weechat: update announce_title's ignore_buffers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Johannes Löthberg --- weechat/plugins.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'weechat') diff --git a/weechat/plugins.conf b/weechat/plugins.conf index 0722f63..7829610 100644 --- a/weechat/plugins.conf +++ b/weechat/plugins.conf @@ -129,7 +129,7 @@ python.announce_url_title.buffers = "freenode.#testing," python.announce_url_title.buffers_notice = "freenode.#testing," python.announce_url_title.global = "on" python.announce_url_title.global_prefix = "url" -python.announce_url_title.ignore_buffers = "freenode.#archlinux,freenode.#archlinux-offtopic,freenode.#archers,freenode.#archlinux-mordor,freenode.#archlinux-bugs,freenode.#archlinux-women,freenode.#archlinux-women-dev,freenode.#kyriasis,freenode.#archlinux-tu" +python.announce_url_title.ignore_buffers = "freenode.#archlinux,freenode.#archlinux-offtopic,freenode.#archers,freenode.#archlinux-mordor,freenode.#archlinux-bugs,freenode.#archlinux-women,freenode.#archlinux-women-dev,freenode.#kyriasis,freenode.#archlinux-tu,freenode.#archlinux-pacman,freenode.#lojban,freenode.#systemd" python.announce_url_title.prefix = "" python.announce_url_title.reannounce_wait = "5" python.announce_url_title.suffix = "" @@ -147,7 +147,7 @@ python.chanop.enable_multi_kick = "off" python.chanop.enable_remove = "off" python.chanop.kick_reason = "" python.chanop.op_command = "/msg chanserv op $channel $nick" -python.chanop.watchlist.freenode = "#kyriasis,#archlinux-botabuse,#archlinux-unregistered,#archlinux-offtopic" +python.chanop.watchlist.freenode = "#archlinux-classroom,#archlinux-botabuse,#archlinux,#archlinux-unregistered,#archlinux-offtopic,#kyriasis" python.check_license = "on" python.clone_scanner.autofocus = "on" python.clone_scanner.clone_onjoin_alert_key = "mask" -- cgit v1.2.3-54-g00ecf From 37ff6b04b521b95be33222c179f3f65bab7b4f28 Mon Sep 17 00:00:00 2001 From: Johannes Löthberg Date: Fri, 10 Jul 2015 18:01:13 +0200 Subject: weechat: remove old plugin settings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Johannes Löthberg --- weechat/plugins.conf | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'weechat') diff --git a/weechat/plugins.conf b/weechat/plugins.conf index 7829610..7bad995 100644 --- a/weechat/plugins.conf +++ b/weechat/plugins.conf @@ -216,22 +216,13 @@ python.notify.nick_separator = ": " python.notify.notify_when_away = "on" python.notify.show_hilights = "on" python.notify.show_priv_msg = "on" -python.notify.smart_notification = "off" +python.notify.smart_notification = "on" python.notify.urgency = "normal" -python.shortenurl.color = "red" -python.shortenurl.ignore_list = "http://is.gd,http://tinyurl.com" -python.shortenurl.short_own = "off" -python.shortenurl.shortener = "isgd" -python.shortenurl.urllength = "30" python.slack_extension.channels_not_on_current_server_color = "0" python.slack_extension.colorize_nicks = "1" python.slack_extension.debug_mode = "" python.slack_extension.distracting_channels = "" python.slack_extension.trigger_value = "0" -python.tinyurl.debug = "off" -python.tinyurl.printall = "on" -python.tinyurl.service = "tinyurl" -python.tinyurl.urllength = "30" python.title.short_name = "on" python.title.title_priority = "2" python.whois_on_query.command = "/whois $nick $nick" -- cgit v1.2.3-54-g00ecf From a92099ecde96541a0189e804b0babc46e7e38d6c Mon Sep 17 00:00:00 2001 From: Johannes Löthberg Date: Fri, 10 Jul 2015 18:01:31 +0200 Subject: weechat: script: dir -> path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Johannes Löthberg --- weechat/script.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'weechat') diff --git a/weechat/script.conf b/weechat/script.conf index 0c2b224..95c8c57 100644 --- a/weechat/script.conf +++ b/weechat/script.conf @@ -43,7 +43,7 @@ text_version_selected = lightmagenta [scripts] autoload = on cache_expire = 60 -dir = "%h/script" hold = "" +path = "%h/script" url = "http://www.weechat.org/files/plugins.xml.gz" url_force_https = on -- cgit v1.2.3-54-g00ecf From bd770d022cf0693357c266c33bc0d47412dd6424 Mon Sep 17 00:00:00 2001 From: Johannes Löthberg Date: Sat, 11 Jul 2015 16:59:04 +0200 Subject: Add weechat.conf MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit But without the layout section Signed-off-by: Johannes Löthberg --- weechat/colorize_nicks.conf | 12 + weechat/weechat.conf | 651 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 663 insertions(+) create mode 100644 weechat/colorize_nicks.conf create mode 100644 weechat/weechat.conf (limited to 'weechat') diff --git a/weechat/colorize_nicks.conf b/weechat/colorize_nicks.conf new file mode 100644 index 0000000..1b6e461 --- /dev/null +++ b/weechat/colorize_nicks.conf @@ -0,0 +1,12 @@ +# +# weechat -- colorize_nicks.conf +# + +[look] +blacklist_channels = "" +blacklist_nicks = "so,root" +colorize_input = on +greedy_matching = on +ignore_nicks_in_urls = off +ignore_tags = "" +min_nick_length = 2 diff --git a/weechat/weechat.conf b/weechat/weechat.conf new file mode 100644 index 0000000..8c01b0a --- /dev/null +++ b/weechat/weechat.conf @@ -0,0 +1,651 @@ +# +# weechat -- weechat.conf +# + +[debug] + +[startup] +command_after_plugins = "" +command_before_plugins = "" +display_logo = on +display_version = on +sys_rlimit = "" + +[look] +align_end_of_lines = message +bar_more_down = "++" +bar_more_left = "<<" +bar_more_right = ">>" +bar_more_up = "--" +bare_display_exit_on_input = on +bare_display_time_format = "%H:%M" +buffer_auto_renumber = on +buffer_notify_default = all +buffer_position = end +buffer_search_case_sensitive = off +buffer_search_force_default = off +buffer_search_regex = off +buffer_search_where = prefix_message +buffer_time_format = "" +color_basic_force_bold = off +color_inactive_buffer = on +color_inactive_message = on +color_inactive_prefix = on +color_inactive_prefix_buffer = on +color_inactive_time = off +color_inactive_window = on +color_nick_offline = off +color_pairs_auto_reset = 5 +color_real_white = off +command_chars = "" +command_incomplete = off +confirm_quit = on +day_change = on +day_change_message_1date = "-- %a, %d %b %Y --" +day_change_message_2dates = "-- %%a, %%d %%b %%Y (%a, %d %b %Y) --" +eat_newline_glitch = off +emphasized_attributes = "" +highlight = "" +highlight_regex = "" +highlight_tags = "" +hotlist_add_conditions = "${away} || ${buffer.num_displayed} == 0" +hotlist_buffer_separator = ", " +hotlist_count_max = 2 +hotlist_count_min_msg = 2 +hotlist_names_count = 3 +hotlist_names_length = 0 +hotlist_names_level = 12 +hotlist_names_merged_buffers = off +hotlist_prefix = "H: " +hotlist_remove = merged +hotlist_short_names = on +hotlist_sort = group_time_asc +hotlist_suffix = "" +hotlist_unique_numbers = on +input_cursor_scroll = 20 +input_share = none +input_share_overwrite = off +input_undo_max = 32 +item_buffer_filter = "*" +item_buffer_zoom = "!" +item_mouse_status = "M" +item_time_format = "%H:%M" +jump_current_to_previous_buffer = on +jump_previous_buffer_when_closing = on +jump_smart_back_to_buffer = on +key_bind_safe = on +mouse = on +mouse_timer_delay = 100 +nick_prefix = "" +nick_suffix = "" +paste_bracketed = on +paste_bracketed_timer_delay = 10 +paste_max_lines = 1 +prefix_action = " •" +prefix_align = none +prefix_align_max = 0 +prefix_align_min = 0 +prefix_align_more = "+" +prefix_align_more_after = on +prefix_buffer_align = right +prefix_buffer_align_max = 0 +prefix_buffer_align_more = "+" +prefix_buffer_align_more_after = on +prefix_error = "=!=" +prefix_join = "-->" +prefix_network = "--" +prefix_quit = "<--" +prefix_same_nick = "╰" +prefix_suffix = "|" +quote_nick_prefix = "<" +quote_nick_suffix = ">" +quote_time_format = "%H:%M:%S" +read_marker = line +read_marker_always_show = off +read_marker_string = "─" +save_config_on_exit = on +save_layout_on_exit = none +scroll_amount = 3 +scroll_bottom_after_switch = off +scroll_page_percent = 100 +search_text_not_found_alert = on +separator_horizontal = "━" +separator_vertical = "" +tab_width = 1 +time_format = "%a, %d %b %Y %T" +window_auto_zoom = off +window_separator_horizontal = on +window_separator_vertical = on +window_title = "WeeChat ${info:version}" +word_chars_highlight = "!\u00A0,-,_,|,alnum" +word_chars_input = "!\u00A0,-,_,|,alnum" + +[palette] + +[color] +bar_more = lightmagenta +chat = default +chat_bg = default +chat_buffer = white +chat_channel = white +chat_day_change = cyan +chat_delimiters = green +chat_highlight = yellow +chat_highlight_bg = magenta +chat_host = cyan +chat_inactive_buffer = default +chat_inactive_window = default +chat_nick = lightcyan +chat_nick_colors = "cyan,magenta,green,brown,lightblue,default,lightcyan,lightmagenta,lightgreen,blue" +chat_nick_offline = default +chat_nick_offline_highlight = default +chat_nick_offline_highlight_bg = blue +chat_nick_other = cyan +chat_nick_prefix = green +chat_nick_self = white +chat_nick_suffix = green +chat_prefix_action = white +chat_prefix_buffer = brown +chat_prefix_buffer_inactive_buffer = default +chat_prefix_error = yellow +chat_prefix_join = lightgreen +chat_prefix_more = lightmagenta +chat_prefix_network = magenta +chat_prefix_quit = lightred +chat_prefix_suffix = green +chat_read_marker = magenta +chat_read_marker_bg = default +chat_server = brown +chat_tags = red +chat_text_found = yellow +chat_text_found_bg = lightmagenta +chat_time = default +chat_time_delimiters = brown +chat_value = cyan +emphasized = yellow +emphasized_bg = magenta +input_actions = lightgreen +input_text_not_found = red +nicklist_away = cyan +nicklist_group = green +nicklist_offline = blue +separator = blue +status_count_highlight = magenta +status_count_msg = brown +status_count_other = default +status_count_private = green +status_data_highlight = lightmagenta +status_data_msg = yellow +status_data_other = default +status_data_private = lightgreen +status_filter = green +status_more = yellow +status_mouse = green +status_name = white +status_name_ssl = lightgreen +status_nicklist_count = default +status_number = yellow +status_time = default + +[completion] +base_word_until_cursor = on +command_inline = on +default_template = "%(nicks)|%(irc_channels)" +nick_add_space = on +nick_completer = ":" +nick_first_only = off +nick_ignore_chars = "[]`_-^" +partial_completion_alert = on +partial_completion_command = off +partial_completion_command_arg = off +partial_completion_count = on +partial_completion_other = off + +[history] +display_default = 5 +max_buffer_lines_minutes = 0 +max_buffer_lines_number = 4096 +max_commands = 100 +max_visited_buffers = 50 + +[proxy] + +[network] +connection_timeout = 60 +gnutls_ca_file = "/etc/ssl/certs/ca-certificates.crt" +gnutls_handshake_timeout = 30 +proxy_curl = "" + +[plugin] +autoload = "*" +debug = off +extension = ".so,.dll" +path = "%h/plugins" +save_config_on_unload = on + +[bar] +buffers.color_bg = default +buffers.color_delim = default +buffers.color_fg = default +buffers.conditions = "" +buffers.filling_left_right = vertical +buffers.filling_top_bottom = horizontal +buffers.hidden = on +buffers.items = "buffers" +buffers.position = bottom +buffers.priority = 0 +buffers.separator = on +buffers.size = 0 +buffers.size_max = 0 +buffers.type = root +chanop_bar.color_bg = blue +chanop_bar.color_delim = cyan +chanop_bar.color_fg = default +chanop_bar.conditions = "active" +chanop_bar.filling_left_right = vertical +chanop_bar.filling_top_bottom = horizontal +chanop_bar.hidden = on +chanop_bar.items = "chanop_status,chanop_ban_matches" +chanop_bar.position = bottom +chanop_bar.priority = 0 +chanop_bar.separator = off +chanop_bar.size = 0 +chanop_bar.size_max = 1 +chanop_bar.type = window +highmon.color_bg = default +highmon.color_delim = cyan +highmon.color_fg = default +highmon.conditions = "" +highmon.filling_left_right = vertical +highmon.filling_top_bottom = vertical +highmon.hidden = off +highmon.items = "highmon" +highmon.position = top +highmon.priority = 100 +highmon.separator = off +highmon.size = 0 +highmon.size_max = 0 +highmon.type = root +input.color_bg = default +input.color_delim = cyan +input.color_fg = default +input.conditions = "" +input.filling_left_right = vertical +input.filling_top_bottom = horizontal +input.hidden = off +input.items = "[input_prompt]+(away),[input_search],[input_paste],input_text" +input.position = bottom +input.priority = 1000 +input.separator = off +input.size = 0 +input.size_max = 0 +input.type = window +isetbar.color_bg = default +isetbar.color_delim = cyan +isetbar.color_fg = default +isetbar.conditions = "" +isetbar.filling_left_right = vertical +isetbar.filling_top_bottom = horizontal +isetbar.hidden = on +isetbar.items = "isetbar_help" +isetbar.position = top +isetbar.priority = 0 +isetbar.separator = on +isetbar.size = 3 +isetbar.size_max = 3 +isetbar.type = window +nicklist.color_bg = default +nicklist.color_delim = cyan +nicklist.color_fg = default +nicklist.conditions = "${nicklist}" +nicklist.filling_left_right = vertical +nicklist.filling_top_bottom = columns_vertical +nicklist.hidden = on +nicklist.items = "buffer_nicklist" +nicklist.position = right +nicklist.priority = 200 +nicklist.separator = on +nicklist.size = 0 +nicklist.size_max = 0 +nicklist.type = window +status.color_bg = blue +status.color_delim = cyan +status.color_fg = default +status.conditions = "" +status.filling_left_right = vertical +status.filling_top_bottom = horizontal +status.hidden = off +status.items = "[buffer_last_number],[buffer_plugin],buffer_number+:+buffer_name+(buffer_modes)+{buffer_nicklist_count}+buffer_zoom+buffer_filter,scroll,[lag],[hotlist],completion,aspell_suggest" +status.position = bottom +status.priority = 500 +status.separator = off +status.size = 1 +status.size_max = 0 +status.type = window +title.color_bg = blue +title.color_delim = cyan +title.color_fg = default +title.conditions = "" +title.filling_left_right = vertical +title.filling_top_bottom = horizontal +title.hidden = off +title.items = "buffer_title" +title.position = top +title.priority = 500 +title.separator = off +title.size = 0 +title.size_max = 0 +title.type = window + +[notify] + +[filter] +irc_smart = on;*;irc_smart_filter;* +ignore_xender_#git = on;*.Freenode.#git;nick_xender;* + +[key] +ctrl-? = "/input delete_previous_char" +ctrl-A = "/input move_beginning_of_line" +ctrl-B = "/input move_previous_char" +ctrl-C_ = "/input insert \x1F" +ctrl-Cb = "/input insert \x02" +ctrl-Cc = "/input insert \x03" +ctrl-Ci = "/input insert \x1D" +ctrl-Co = "/input insert \x0F" +ctrl-Cv = "/input insert \x16" +ctrl-D = "/input delete_next_char" +ctrl-E = "/input move_end_of_line" +ctrl-F = "/input move_next_char" +ctrl-H = "/input delete_previous_char" +ctrl-I = "/input complete_next" +ctrl-J = "/input return" +ctrl-K = "/input delete_end_of_line" +ctrl-L = "/window refresh" +ctrl-M = "/input return" +ctrl-N = "/buffer +1" +ctrl-P = "/buffer -1" +ctrl-R = "/input search_text" +ctrl-Sctrl-U = "/input set_unread" +ctrl-T = "/input transpose_chars" +ctrl-U = "/input delete_beginning_of_line" +ctrl-W = "/input delete_previous_word" +ctrl-X = "/input switch_active_buffer" +ctrl-Y = "/input clipboard_paste" +meta-meta2-1~ = "/window scroll_top" +meta-meta2-23~ = "/bar scroll nicklist * b" +meta-meta2-24~ = "/bar scroll nicklist * e" +meta-meta2-4~ = "/window scroll_bottom" +meta-meta2-5~ = "/window scroll_up" +meta-meta2-6~ = "/window scroll_down" +meta-meta2-7~ = "/window scroll_top" +meta-meta2-8~ = "/window scroll_bottom" +meta-meta2-A = "/buffer -1" +meta-meta2-B = "/buffer +1" +meta-meta2-C = "/buffer +1" +meta-meta2-D = "/buffer -1" +meta-- = "/filter toggle @" +meta-/ = "/input jump_last_buffer_displayed" +meta-0 = "/buffer *10" +meta-1 = "/buffer *1" +meta-2 = "/buffer *2" +meta-3 = "/buffer *3" +meta-4 = "/buffer *4" +meta-5 = "/buffer *5" +meta-6 = "/buffer *6" +meta-7 = "/buffer *7" +meta-8 = "/buffer *8" +meta-9 = "/buffer *9" +meta-< = "/input jump_previously_visited_buffer" +meta-= = "/filter toggle" +meta-> = "/input jump_next_visited_buffer" +meta-OA = "/input history_global_previous" +meta-OB = "/input history_global_next" +meta-OC = "/input move_next_word" +meta-OD = "/input move_previous_word" +meta-OF = "/input move_end_of_line" +meta-OH = "/input move_beginning_of_line" +meta-Oa = "/input history_global_previous" +meta-Ob = "/input history_global_next" +meta-Oc = "/input move_next_word" +meta-Od = "/input move_previous_word" +meta2-15~ = "/buffer -1" +meta2-17~ = "/buffer +1" +meta2-18~ = "/window -1" +meta2-19~ = "/window +1" +meta2-1;3A = "/buffer -1" +meta2-1;3B = "/buffer +1" +meta2-1;3C = "/buffer +1" +meta2-1;3D = "/buffer -1" +meta2-1;3F = "/window scroll_bottom" +meta2-1;3H = "/window scroll_top" +meta2-1;5A = "/input history_global_previous" +meta2-1;5B = "/input history_global_next" +meta2-1;5C = "/input move_next_word" +meta2-1;5D = "/input move_previous_word" +meta2-1~ = "/input move_beginning_of_line" +meta2-200~ = "/input paste_start" +meta2-201~ = "/input paste_stop" +meta2-20~ = "/bar scroll title * -30%" +meta2-21~ = "/bar scroll title * +30%" +meta2-23;3~ = "/bar scroll nicklist * b" +meta2-23~ = "/bar scroll nicklist * -100%" +meta2-24;3~ = "/bar scroll nicklist * e" +meta2-24~ = "/bar scroll nicklist * +100%" +meta2-3~ = "/input delete_next_char" +meta2-4~ = "/input move_end_of_line" +meta2-5;3~ = "/window scroll_up" +meta2-5~ = "/window page_up" +meta2-6;3~ = "/window scroll_down" +meta2-6~ = "/window page_down" +meta2-7~ = "/input move_beginning_of_line" +meta2-8~ = "/input move_end_of_line" +meta2-A = "/input history_previous" +meta2-B = "/input history_next" +meta2-C = "/input move_next_char" +meta2-D = "/input move_previous_char" +meta2-F = "/input move_end_of_line" +meta2-G = "/window page_down" +meta2-H = "/input move_beginning_of_line" +meta2-I = "/window page_up" +meta2-Z = "/input complete_previous" +meta2-[E = "/buffer -1" +meta-_ = "/input redo" +meta-a = "/input jump_smart" +meta-b = "/input move_previous_word" +meta-d = "/input delete_next_word" +meta-f = "/input move_next_word" +meta-g = "/go" +meta-h = "/input hotlist_clear" +meta-jmeta-f = "/buffer -" +meta-jmeta-l = "/buffer +" +meta-jmeta-r = "/server raw" +meta-jmeta-s = "/server jump" +meta-j01 = "/buffer 1" +meta-j02 = "/buffer 2" +meta-j03 = "/buffer 3" +meta-j04 = "/buffer 4" +meta-j05 = "/buffer 5" +meta-j06 = "/buffer 6" +meta-j07 = "/buffer 7" +meta-j08 = "/buffer 8" +meta-j09 = "/buffer 9" +meta-j10 = "/buffer 10" +meta-j11 = "/buffer 11" +meta-j12 = "/buffer 12" +meta-j13 = "/buffer 13" +meta-j14 = "/buffer 14" +meta-j15 = "/buffer 15" +meta-j16 = "/buffer 16" +meta-j17 = "/buffer 17" +meta-j18 = "/buffer 18" +meta-j19 = "/buffer 19" +meta-j20 = "/buffer 20" +meta-j21 = "/buffer 21" +meta-j22 = "/buffer 22" +meta-j23 = "/buffer 23" +meta-j24 = "/buffer 24" +meta-j25 = "/buffer 25" +meta-j26 = "/buffer 26" +meta-j27 = "/buffer 27" +meta-j28 = "/buffer 28" +meta-j29 = "/buffer 29" +meta-j30 = "/buffer 30" +meta-j31 = "/buffer 31" +meta-j32 = "/buffer 32" +meta-j33 = "/buffer 33" +meta-j34 = "/buffer 34" +meta-j35 = "/buffer 35" +meta-j36 = "/buffer 36" +meta-j37 = "/buffer 37" +meta-j38 = "/buffer 38" +meta-j39 = "/buffer 39" +meta-j40 = "/buffer 40" +meta-j41 = "/buffer 41" +meta-j42 = "/buffer 42" +meta-j43 = "/buffer 43" +meta-j44 = "/buffer 44" +meta-j45 = "/buffer 45" +meta-j46 = "/buffer 46" +meta-j47 = "/buffer 47" +meta-j48 = "/buffer 48" +meta-j49 = "/buffer 49" +meta-j50 = "/buffer 50" +meta-j51 = "/buffer 51" +meta-j52 = "/buffer 52" +meta-j53 = "/buffer 53" +meta-j54 = "/buffer 54" +meta-j55 = "/buffer 55" +meta-j56 = "/buffer 56" +meta-j57 = "/buffer 57" +meta-j58 = "/buffer 58" +meta-j59 = "/buffer 59" +meta-j60 = "/buffer 60" +meta-j61 = "/buffer 61" +meta-j62 = "/buffer 62" +meta-j63 = "/buffer 63" +meta-j64 = "/buffer 64" +meta-j65 = "/buffer 65" +meta-j66 = "/buffer 66" +meta-j67 = "/buffer 67" +meta-j68 = "/buffer 68" +meta-j69 = "/buffer 69" +meta-j70 = "/buffer 70" +meta-j71 = "/buffer 71" +meta-j72 = "/buffer 72" +meta-j73 = "/buffer 73" +meta-j74 = "/buffer 74" +meta-j75 = "/buffer 75" +meta-j76 = "/buffer 76" +meta-j77 = "/buffer 77" +meta-j78 = "/buffer 78" +meta-j79 = "/buffer 79" +meta-j80 = "/buffer 80" +meta-j81 = "/buffer 81" +meta-j82 = "/buffer 82" +meta-j83 = "/buffer 83" +meta-j84 = "/buffer 84" +meta-j85 = "/buffer 85" +meta-j86 = "/buffer 86" +meta-j87 = "/buffer 87" +meta-j88 = "/buffer 88" +meta-j89 = "/buffer 89" +meta-j90 = "/buffer 90" +meta-j91 = "/buffer 91" +meta-j92 = "/buffer 92" +meta-j93 = "/buffer 93" +meta-j94 = "/buffer 94" +meta-j95 = "/buffer 95" +meta-j96 = "/buffer 96" +meta-j97 = "/buffer 97" +meta-j98 = "/buffer 98" +meta-j99 = "/buffer 99" +meta-k = "/input grab_key_command" +meta-l = "/window bare" +meta-m = "/mute mouse toggle" +meta-n = "/window scroll_next_highlight" +meta-p = "/window scroll_previous_highlight" +meta-r = "/input delete_line" +meta-s = "/mute aspell toggle" +meta-u = "/window scroll_unread" +meta-wmeta-meta2-A = "/window up" +meta-wmeta-meta2-B = "/window down" +meta-wmeta-meta2-C = "/window right" +meta-wmeta-meta2-D = "/window left" +meta-wmeta2-1;3A = "/window up" +meta-wmeta2-1;3B = "/window down" +meta-wmeta2-1;3C = "/window right" +meta-wmeta2-1;3D = "/window left" +meta-wmeta-b = "/window balance" +meta-wmeta-s = "/window swap" +meta-x = "/input zoom_merged_buffer" +meta-z = "/window zoom" +ctrl-_ = "/input undo" + +[key_search] +ctrl-I = "/input search_switch_where" +ctrl-J = "/input search_stop" +ctrl-M = "/input search_stop" +ctrl-R = "/input search_switch_regex" +meta2-A = "/input search_previous" +meta2-B = "/input search_next" +meta-c = "/input search_switch_case" + +[key_cursor] +ctrl-J = "/cursor stop" +ctrl-M = "/cursor stop" +meta-meta2-A = "/cursor move area_up" +meta-meta2-B = "/cursor move area_down" +meta-meta2-C = "/cursor move area_right" +meta-meta2-D = "/cursor move area_left" +meta2-1;3A = "/cursor move area_up" +meta2-1;3B = "/cursor move area_down" +meta2-1;3C = "/cursor move area_right" +meta2-1;3D = "/cursor move area_left" +meta2-A = "/cursor move up" +meta2-B = "/cursor move down" +meta2-C = "/cursor move right" +meta2-D = "/cursor move left" +@item(buffer_nicklist):K = "/window ${_window_number};/kickban ${nick}" +@item(buffer_nicklist):b = "/window ${_window_number};/ban ${nick}" +@item(buffer_nicklist):k = "/window ${_window_number};/kick ${nick}" +@item(buffer_nicklist):q = "/window ${_window_number};/query ${nick};/cursor stop" +@item(buffer_nicklist):w = "/window ${_window_number};/whois ${nick}" +@chat:Q = "hsignal:chat_quote_time_prefix_message;/cursor stop" +@chat:m = "hsignal:chat_quote_message;/cursor stop" +@chat:q = "hsignal:chat_quote_prefix_message;/cursor stop" + +[key_mouse] +@bar(buffers):ctrl-wheeldown = "hsignal:buffers_mouse" +@bar(buffers):ctrl-wheelup = "hsignal:buffers_mouse" +@bar(input):button2 = "/input grab_mouse_area" +@bar(nicklist):button1-gesture-down = "/bar scroll nicklist ${_window_number} +100%" +@bar(nicklist):button1-gesture-down-long = "/bar scroll nicklist ${_window_number} e" +@bar(nicklist):button1-gesture-up = "/bar scroll nicklist ${_window_number} -100%" +@bar(nicklist):button1-gesture-up-long = "/bar scroll nicklist ${_window_number} b" +@chat(perl.iset):button1 = "hsignal:iset_mouse" +@chat(perl.iset):button2* = "hsignal:iset_mouse" +@chat(perl.iset):wheeldown = "/repeat 5 /iset **down" +@chat(perl.iset):wheelup = "/repeat 5 /iset **up" +@chat(script.scripts):button1 = "/window ${_window_number};/script go ${_chat_line_y}" +@chat(script.scripts):button2 = "/window ${_window_number};/script go ${_chat_line_y};/script installremove -q ${script_name_with_extension}" +@chat(script.scripts):wheeldown = "/script down 5" +@chat(script.scripts):wheelup = "/script up 5" +@item(buffer_nicklist):button1 = "/window ${_window_number};/query ${nick}" +@item(buffer_nicklist):button1-gesture-left = "/window ${_window_number};/kick ${nick}" +@item(buffer_nicklist):button1-gesture-left-long = "/window ${_window_number};/kickban ${nick}" +@item(buffer_nicklist):button2 = "/window ${_window_number};/whois ${nick}" +@item(buffer_nicklist):button2-gesture-left = "/window ${_window_number};/ban ${nick}" +@item(buffers):button1* = "hsignal:buffers_mouse" +@item(buffers):button2* = "hsignal:buffers_mouse" +@bar:wheeldown = "/bar scroll ${_bar_name} ${_window_number} +20%" +@bar:wheelup = "/bar scroll ${_bar_name} ${_window_number} -20%" +@chat:button1 = "/window ${_window_number}" +@chat:button1-gesture-left = "/window ${_window_number};/buffer -1" +@chat:button1-gesture-left-long = "/window ${_window_number};/buffer 1" +@chat:button1-gesture-right = "/window ${_window_number};/buffer +1" +@chat:button1-gesture-right-long = "/window ${_window_number};/input jump_last_buffer" +@chat:ctrl-wheeldown = "/window scroll_horiz -window ${_window_number} +10%" +@chat:ctrl-wheelup = "/window scroll_horiz -window ${_window_number} -10%" +@chat:wheeldown = "/window scroll_down -window ${_window_number}" +@chat:wheelup = "/window scroll_up -window ${_window_number}" +@*:button3 = "/cursor go ${_x},${_y}" -- cgit v1.2.3-54-g00ecf From 5943930073264523e95de5f90b4bc81831fc4893 Mon Sep 17 00:00:00 2001 From: Johannes Löthberg Date: Sat, 11 Jul 2015 17:03:50 +0200 Subject: weechat: python: Add go.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Johannes Löthberg --- weechat/python/go.py | 490 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 490 insertions(+) create mode 100644 weechat/python/go.py (limited to 'weechat') diff --git a/weechat/python/go.py b/weechat/python/go.py new file mode 100644 index 0000000..0e5b6bd --- /dev/null +++ b/weechat/python/go.py @@ -0,0 +1,490 @@ +# -*- coding: utf-8 -*- +# +# Copyright (C) 2009-2014 Sébastien Helleu +# Copyright (C) 2010 m4v +# Copyright (C) 2011 stfn +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +# +# History: +# +# 2014-05-12, Sébastien Helleu : +# version 2.0: add help on options, replace option "sort_by_activity" by +# "sort" (add sort by name and first match at beginning of +# name and by number), PEP8 compliance +# 2012-11-26, Nei +# version 1.9: add auto_jump option to automatically go to buffer when it +# is uniquely selected +# 2012-09-17, Sébastien Helleu : +# version 1.8: fix jump to non-active merged buffers (jump with buffer name +# instead of number) +# 2012-01-03 nils_2 +# version 1.7: add option use_core_instead_weechat +# 2012-01-03, Sébastien Helleu : +# version 1.6: make script compatible with Python 3.x +# 2011-08-24, stfn : +# version 1.5: /go with name argument jumps directly to buffer +# Remember cursor position in buffer input +# 2011-05-31, Elián Hanisch : +# version 1.4: Sort list of buffers by activity. +# 2011-04-25, Sébastien Helleu : +# version 1.3: add info "go_running" (used by script input_lock.rb) +# 2010-11-01, Sébastien Helleu : +# version 1.2: use high priority for hooks to prevent conflict with other +# plugins/scripts (WeeChat >= 0.3.4 only) +# 2010-03-25, Elián Hanisch : +# version 1.1: use a space for match the end of a string +# 2009-11-16, Sébastien Helleu : +# version 1.0: add new option for displaying short names +# 2009-06-15, Sébastien Helleu : +# version 0.9: fix typo in /help go with command /key +# 2009-05-16, Sébastien Helleu : +# version 0.8: search buffer by number, fix bug when window is split +# 2009-05-03, Sébastien Helleu : +# version 0.7: eat tab key (do not complete input, just move buffer +# pointer) +# 2009-05-02, Sébastien Helleu : +# version 0.6: sync with last API changes +# 2009-03-22, Sébastien Helleu : +# version 0.5: update modifier signal name for input text display, +# fix arguments for function string_remove_color +# 2009-02-18, Sébastien Helleu : +# version 0.4: do not hook command and init options if register failed +# 2009-02-08, Sébastien Helleu : +# version 0.3: case insensitive search for buffers names +# 2009-02-08, Sébastien Helleu : +# version 0.2: add help about Tab key +# 2009-02-08, Sébastien Helleu : +# version 0.1: initial release +# + +""" +Quick jump to buffers. +(this script requires WeeChat 0.3.0 or newer) +""" + +from __future__ import print_function + +SCRIPT_NAME = 'go' +SCRIPT_AUTHOR = 'Sébastien Helleu ' +SCRIPT_VERSION = '2.0' +SCRIPT_LICENSE = 'GPL3' +SCRIPT_DESC = 'Quick jump to buffers' + +SCRIPT_COMMAND = 'go' + +IMPORT_OK = True + +try: + import weechat +except ImportError: + print('This script must be run under WeeChat.') + print('Get WeeChat now at: http://www.weechat.org/') + IMPORT_OK = False + +import re + +# script options +SETTINGS = { + 'color_number': ( + 'yellow,magenta', + 'color for buffer number (not selected)'), + 'color_number_selected': ( + 'yellow,red', + 'color for selected buffer number'), + 'color_name': ( + 'black,cyan', + 'color for buffer name (not selected)'), + 'color_name_selected': ( + 'black,brown', + 'color for a selected buffer name'), + 'color_name_highlight': ( + 'red,cyan', + 'color for highlight in buffer name (not selected)'), + 'color_name_highlight_selected': ( + 'red,brown', + 'color for highlight in a selected buffer name'), + 'message': ( + 'Go to: ', + 'message to display before list of buffers'), + 'short_name': ( + 'off', + 'display and search in short names instead of buffer name'), + 'sort': ( + 'number,beginning', + '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), ', + 'hotlist = sort by hotlist order, ' + 'number = first match a buffer number before digits in name, ' + 'beginning = first match at beginning of names (or short names); ' + 'the default sort of buffers is by numbers'), + 'use_core_instead_weechat': ( + 'off', + 'use name "core" instead of "weechat" for core buffer'), + 'auto_jump': ( + 'off', + 'automatically jump to buffer when it is uniquely selected'), +} + +# hooks management +HOOK_COMMAND_RUN = { + 'input': ('/input *', 'go_command_run_input'), + 'buffer': ('/buffer *', 'go_command_run_buffer'), + 'window': ('/window *', 'go_command_run_window'), +} +hooks = {} + +# input before command /go (we'll restore it later) +saved_input = '' +saved_input_pos = 0 + +# last user input (if changed, we'll update list of matching buffers) +old_input = None + +# matching buffers +buffers = [] +buffers_pos = 0 + + +def go_option_enabled(option): + """Checks if a boolean script option is enabled or not.""" + return weechat.config_string_to_boolean(weechat.config_get_plugin(option)) + + +def go_info_running(data, info_name, arguments): + """Returns "1" if go is running, otherwise "0".""" + return '1' if 'modifier' in hooks else '0' + + +def go_unhook_one(hook): + """Unhook something hooked by this script.""" + global hooks + if hook in hooks: + weechat.unhook(hooks[hook]) + del hooks[hook] + + +def go_unhook_all(): + """Unhook all.""" + go_unhook_one('modifier') + for hook in HOOK_COMMAND_RUN: + go_unhook_one(hook) + + +def go_hook_all(): + """Hook command_run and modifier.""" + global hooks + priority = '' + version = weechat.info_get('version_number', '') or 0 + # use high priority for hook to prevent conflict with other plugins/scripts + # (WeeChat >= 0.3.4 only) + if int(version) >= 0x00030400: + priority = '2000|' + for hook, value in HOOK_COMMAND_RUN.items(): + if hook not in hooks: + hooks[hook] = weechat.hook_command_run( + '%s%s' % (priority, value[0]), + value[1], '') + if 'modifier' not in hooks: + hooks['modifier'] = weechat.hook_modifier( + 'input_text_display_with_cursor', 'go_input_modifier', '') + + +def go_start(buf): + """Start go on buffer.""" + global saved_input, saved_input_pos, old_input, buffers_pos + go_hook_all() + saved_input = weechat.buffer_get_string(buf, 'input') + saved_input_pos = weechat.buffer_get_integer(buf, 'input_pos') + weechat.buffer_set(buf, 'input', '') + old_input = None + buffers_pos = 0 + + +def go_end(buf): + """End go on buffer.""" + global saved_input, saved_input_pos, old_input + go_unhook_all() + weechat.buffer_set(buf, 'input', saved_input) + weechat.buffer_set(buf, 'input_pos', str(saved_input_pos)) + old_input = None + + +def go_match_beginning(buf, string): + """Check if a string matches the beginning of buffer name/short name.""" + if not string: + return False + esc_str = re.escape(string) + if re.search(r'^#?' + esc_str, buf['name']) \ + or re.search(r'^#?' + esc_str, buf['short_name']): + return True + return False + + +def go_now(buf, args): + """Go to buffer specified by args.""" + listbuf = go_matching_buffers(args) + if not listbuf: + return + + # prefer buffer that matches at beginning (if option is enabled) + if 'beginning' in weechat.config_get_plugin('sort').split(','): + for index in range(len(listbuf)): + if go_match_beginning(listbuf[index], args): + weechat.command(buf, + '/buffer ' + str(listbuf[index]['full_name'])) + return + + # jump to first buffer in matching buffers by default + weechat.command(buf, '/buffer ' + str(listbuf[0]['full_name'])) + + +def go_cmd(data, buf, args): + """Command "/go": just hook what we need.""" + global hooks + if args: + go_now(buf, args) + elif 'modifier' in hooks: + go_end(buf) + else: + go_start(buf) + return weechat.WEECHAT_RC_OK + + +def go_matching_buffers(strinput): + """Return a list with buffers matching user input.""" + global buffers_pos + listbuf = [] + if len(strinput) == 0: + buffers_pos = 0 + strinput = strinput.lower() + infolist = weechat.infolist_get('buffer', '', '') + while weechat.infolist_next(infolist): + short_name = weechat.infolist_string(infolist, 'short_name') + if go_option_enabled('short_name'): + name = weechat.infolist_string(infolist, 'short_name') + else: + name = weechat.infolist_string(infolist, 'name') + if name == 'weechat' and go_option_enabled('use_core_instead_weechat'): + name = 'core' + number = weechat.infolist_integer(infolist, 'number') + full_name = weechat.infolist_string(infolist, 'full_name') + if not full_name: + full_name = '%s.%s' % ( + weechat.infolist_string(infolist, 'plugin_name'), + weechat.infolist_string(infolist, 'name')) + pointer = weechat.infolist_pointer(infolist, 'pointer') + matching = name.lower().find(strinput) >= 0 + if not matching and strinput[-1] == ' ': + matching = name.lower().endswith(strinput.strip()) + if not matching and strinput.isdigit(): + matching = str(number).startswith(strinput) + if len(strinput) == 0 or matching: + listbuf.append({ + 'number': number, + 'short_name': short_name, + 'name': name, + 'full_name': full_name, + 'pointer': pointer, + }) + weechat.infolist_free(infolist) + + # sort buffers + hotlist = [] + infolist = weechat.infolist_get('hotlist', '', '') + while weechat.infolist_next(infolist): + hotlist.append( + weechat.infolist_pointer(infolist, 'buffer_pointer')) + weechat.infolist_free(infolist) + last_index_hotlist = len(hotlist) + + def _sort_name(buf): + """Sort buffers by name (or short name).""" + return buf['name'] + + def _sort_hotlist(buf): + """Sort buffers by hotlist order.""" + try: + return hotlist.index(buf['pointer']) + except ValueError: + # not in hotlist, always last. + return last_index_hotlist + + def _sort_match_number(buf): + """Sort buffers by match on number.""" + return 0 if str(buf['number']) == strinput else 1 + + def _sort_match_beginning(buf): + """Sort buffers by match at beginning.""" + return 0 if go_match_beginning(buf, strinput) else 1 + + funcs = { + 'name': _sort_name, + 'hotlist': _sort_hotlist, + 'number': _sort_match_number, + 'beginning': _sort_match_beginning, + } + + for key in weechat.config_get_plugin('sort').split(','): + if key in funcs: + listbuf = sorted(listbuf, key=funcs[key]) + + if not strinput: + index = [i for i, buf in enumerate(listbuf) + if buf['pointer'] == weechat.current_buffer()] + if index: + buffers_pos = index[0] + + return listbuf + + +def go_buffers_to_string(listbuf, pos, strinput): + """Return string built with list of buffers found (matching user input).""" + string = '' + strinput = strinput.lower() + for i in range(len(listbuf)): + selected = '_selected' if i == pos else '' + index = listbuf[i]['name'].lower().find(strinput) + if index >= 0: + index2 = index + len(strinput) + name = '%s%s%s%s%s' % ( + listbuf[i]['name'][:index], + weechat.color(weechat.config_get_plugin( + 'color_name_highlight' + selected)), + listbuf[i]['name'][index:index2], + weechat.color(weechat.config_get_plugin( + 'color_name' + selected)), + listbuf[i]['name'][index2:]) + else: + name = listbuf[i]['name'] + string += ' %s%s%s%s%s' % ( + weechat.color(weechat.config_get_plugin( + 'color_number' + selected)), + str(listbuf[i]['number']), + weechat.color(weechat.config_get_plugin( + 'color_name' + selected)), + name, + weechat.color('reset')) + return ' ' + string if string else '' + + +def go_input_modifier(data, modifier, modifier_data, string): + """This modifier is called when input text item is built by WeeChat. + + This is commonly called after changes in input or cursor move: it builds + a new input with prefix ("Go to:"), and suffix (list of buffers found). + """ + global old_input, buffers, buffers_pos + if modifier_data != weechat.current_buffer(): + return '' + names = '' + new_input = weechat.string_remove_color(string, '') + new_input = new_input.lstrip() + if old_input is None or new_input != old_input: + old_buffers = buffers + buffers = go_matching_buffers(new_input) + if buffers != old_buffers and len(new_input) > 0: + if len(buffers) == 1 and go_option_enabled('auto_jump'): + weechat.command(modifier_data, '/wait 1ms /input return') + buffers_pos = 0 + old_input = new_input + names = go_buffers_to_string(buffers, buffers_pos, new_input.strip()) + return weechat.config_get_plugin('message') + string + names + + +def go_command_run_input(data, buf, command): + """Function called when a command "/input xxx" is run.""" + global buffers, buffers_pos + if command == '/input search_text' or command.find('/input jump') == 0: + # search text or jump to another buffer is forbidden now + return weechat.WEECHAT_RC_OK_EAT + elif command == '/input complete_next': + # choose next buffer in list + buffers_pos += 1 + if buffers_pos >= len(buffers): + buffers_pos = 0 + weechat.hook_signal_send('input_text_changed', + weechat.WEECHAT_HOOK_SIGNAL_STRING, '') + return weechat.WEECHAT_RC_OK_EAT + elif command == '/input complete_previous': + # choose previous buffer in list + buffers_pos -= 1 + if buffers_pos < 0: + buffers_pos = len(buffers) - 1 + weechat.hook_signal_send('input_text_changed', + weechat.WEECHAT_HOOK_SIGNAL_STRING, '') + return weechat.WEECHAT_RC_OK_EAT + elif command == '/input return': + # switch to selected buffer (if any) + go_end(buf) + if len(buffers) > 0: + weechat.command( + buf, '/buffer ' + str(buffers[buffers_pos]['full_name'])) + return weechat.WEECHAT_RC_OK_EAT + return weechat.WEECHAT_RC_OK + + +def go_command_run_buffer(data, buf, command): + """Function called when a command "/buffer xxx" is run.""" + return weechat.WEECHAT_RC_OK_EAT + + +def go_command_run_window(data, buf, command): + """Function called when a command "/window xxx" is run.""" + return weechat.WEECHAT_RC_OK_EAT + + +def go_unload_script(): + """Function called when script is unloaded.""" + go_unhook_all() + return weechat.WEECHAT_RC_OK + + +def go_main(): + """Entry point.""" + if not weechat.register(SCRIPT_NAME, SCRIPT_AUTHOR, SCRIPT_VERSION, + SCRIPT_LICENSE, SCRIPT_DESC, + 'go_unload_script', ''): + return + weechat.hook_command( + SCRIPT_COMMAND, + 'Quick jump to buffers', '[name]', + 'name: directly jump to buffer by name (without argument, list is ' + 'displayed)\n\n' + 'You can bind command to a key, for example:\n' + ' /key bind meta-g /go\n\n' + 'You can use completion key (commonly Tab and shift-Tab) to select ' + 'next/previous buffer in list.', + '%(buffers_names)', + 'go_cmd', '') + + # set default settings + version = weechat.info_get('version_number', '') or 0 + for option, value in SETTINGS.items(): + if not weechat.config_is_set_plugin(option): + weechat.config_set_plugin(option, value[0]) + if int(version) >= 0x00030500: + weechat.config_set_desc_plugin( + option, '%s (default: "%s")' % (value[1], value[0])) + weechat.hook_info('go_running', + 'Return "1" if go is running, otherwise "0"', + '', + 'go_info_running', '') + + +if __name__ == "__main__" and IMPORT_OK: + go_main() -- cgit v1.2.3-54-g00ecf From 6dc558ed2071176bd8d099ba8e3eae37adcf266d Mon Sep 17 00:00:00 2001 From: Johannes Löthberg Date: Thu, 16 Jul 2015 22:20:20 +0200 Subject: weechat: buffers.pl: 5.0 -> 5.1 --- weechat/perl/buffers.pl | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'weechat') diff --git a/weechat/perl/buffers.pl b/weechat/perl/buffers.pl index 472f6e9..c31d8fc 100644 --- a/weechat/perl/buffers.pl +++ b/weechat/perl/buffers.pl @@ -20,6 +20,8 @@ # # History: # +# 2015-03-29, Ed Santiago +# v5.1: merged buffers: always indent, except when filling is horizontal # 2014-12-12 # v5.0: fix cropping non-latin buffer names # 2014-08-29, Patrick Steinhardt : @@ -164,7 +166,7 @@ use strict; use Encode qw( decode encode ); # -----------------------------[ internal ]------------------------------------- my $SCRIPT_NAME = "buffers"; -my $SCRIPT_VERSION = "5.0"; +my $SCRIPT_VERSION = "5.1"; my $BUFFERS_CONFIG_FILE_NAME = "buffers"; my $buffers_config_file; @@ -1298,8 +1300,17 @@ sub build_buffers } else { - my $indent = ""; - $indent = ((" " x length($buffer->{"number"}))." ") if (($position eq "left") || ($position eq "right")); + # Indentation aligns channels in a visually appealing way + # when viewing list top-to-bottom... + my $indent = (" " x length($buffer->{"number"}))." "; + # ...except when list is top/bottom and channels left-to-right. + my $option_pos = weechat::config_string( weechat::config_get( "weechat.bar.buffers.position" ) ); + if (($option_pos eq 'top') || ($option_pos eq 'bottom')) { + my $option_filling = weechat::config_string( weechat::config_get( "weechat.bar.buffers.filling_top_bottom" ) ); + if ($option_filling =~ /horizontal/) { + $indent = ''; + } + } $str .= weechat::color("default") .$color_bg .$indent; -- cgit v1.2.3-54-g00ecf From 3612dd366635d607d74ee449201dfd5874b80dbf Mon Sep 17 00:00:00 2001 From: Johannes Löthberg Date: Thu, 16 Jul 2015 22:20:43 +0200 Subject: weechat: iset.pl: 3.7 -> 3.9 --- weechat/perl/iset.pl | 38 +++++++++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 11 deletions(-) (limited to 'weechat') diff --git a/weechat/perl/iset.pl b/weechat/perl/iset.pl index 0a4f8b5..af74767 100644 --- a/weechat/perl/iset.pl +++ b/weechat/perl/iset.pl @@ -19,6 +19,10 @@ # # History: # +# 2015-05-16, Sebastien Helleu : +# version 3.9: fix cursor position when editing an option with WeeChat >= 1.2 +# 2015-05-02, arza : +# version 3.8: don't append "null" to /set when setting an undefined setting # 2015-05-01, nils_2 : # version 3.7: fix two perl warnings (reported by t3chguy) # 2014-09-30, arza : @@ -119,7 +123,7 @@ use strict; my $PRGNAME = "iset"; -my $VERSION = "3.7"; +my $VERSION = "3.9"; my $DESCR = "Interactive Set for configuration options"; my $AUTHOR = "Sebastien Helleu "; my $LICENSE = "GPL3"; @@ -982,22 +986,34 @@ sub iset_cmd_cb my $value = $options_values[$current_line]; if ($options_is_null[$current_line]) { - $value = "null"; + $value = ""; } else { $quote = "\"" if ($options_types[$current_line] eq "string"); } + $value = " ".$quote.$value.$quote if ($value ne "" or $quote ne ""); + my $set_command = "/set"; - $set_command = "/mute " . $set_command if (weechat::config_boolean($options_iset{"use_mute"}) == 1); - - weechat::buffer_set($iset_buffer, "input", $set_command." ".$options_names[$current_line]." ".$quote.$value.$quote); - weechat::command($iset_buffer, "/input move_beginning_of_line"); - weechat::command($iset_buffer, "/input move_next_word"); - weechat::command($iset_buffer, "/input move_next_word"); - weechat::command($iset_buffer, "/input move_next_word") if (weechat::config_boolean($options_iset{"use_mute"}) == 1); - weechat::command($iset_buffer, "/input move_next_char"); - weechat::command($iset_buffer, "/input move_next_char") if ($quote ne ""); + my $start_index = 5; + if (weechat::config_boolean($options_iset{"use_mute"}) == 1) + { + $set_command = "/mute ".$set_command; + $start_index += 11; + } + $set_command = $set_command." ".$options_names[$current_line].$value; + my $pos_space = index($set_command, " ", $start_index); + if ($pos_space < 0) + { + $pos_space = 9999; + } + else + { + $pos_space = $pos_space + 1; + $pos_space = $pos_space + 1 if ($quote ne ""); + } + weechat::buffer_set($iset_buffer, "input", $set_command); + weechat::buffer_set($iset_buffer, "input_pos", "".$pos_space); } } weechat::bar_item_update("isetbar_help") if (weechat::config_boolean($options_iset{"show_help_bar"}) == 1); -- cgit v1.2.3-54-g00ecf From f54ae765b0a71b9d169dc48099b19dc29cbb0cd0 Mon Sep 17 00:00:00 2001 From: Johannes Löthberg Date: Thu, 16 Jul 2015 22:21:13 +0200 Subject: weechat: stalker.pl: 1.4 -> 1.5 --- weechat/perl/stalker.pl | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'weechat') diff --git a/weechat/perl/stalker.pl b/weechat/perl/stalker.pl index b418fad..ce2bb65 100644 --- a/weechat/perl/stalker.pl +++ b/weechat/perl/stalker.pl @@ -20,6 +20,9 @@ # along with this program. If not, see . # # History: +# version 1.5:nils_2@freenode.#weechat +# 2015-06-15: add: new option del_date +# # version 1.4:nils_2@freenode.#weechat # 2014-05-14: fix: perl error under some circumstances (thanks Piotrek) # @@ -98,7 +101,7 @@ use File::Spec; use DBI; my $SCRIPT_NAME = "stalker"; -my $SCRIPT_VERSION = "1.4"; +my $SCRIPT_VERSION = "1.5"; my $SCRIPT_AUTHOR = "Nils Görs "; my $SCRIPT_LICENCE = "GPL3"; my $SCRIPT_DESC = "Records and correlates nick!user\@host information"; @@ -777,6 +780,15 @@ sub _deassociate_nick_from_host return $sth->rows; } +sub delete_older_entries +{ + # $day = yyyy-mm-dd + my ( $day1, $day2 ) = @_; + # from date ? to date ? + $sth = $DBH->prepare( "DELETE FROM records WHERE added >= '" . $day1 . "' AND added < '" . $day2 . "'" ); + $sth->execute(); +} + # ------------------------[ OUTPUT with tags ]------------------------------ sub OUTPUT { @@ -934,6 +946,10 @@ sub stalker_command_cb my $DEBUG_prefix = weechat::config_string(weechat::config_get('weechat.look.prefix_error')); weechat::print($buffer, _color_str($color, $DEBUG_prefix) . "\t$SCRIPT_NAME: $affected_rows deleted"); } + elsif (lc($args_array[0]) eq 'del_date') + { + delete_older_entries($args_array[1],$args_array[2]) if ($args_array[1] and $args_array[2]); + } return weechat::WEECHAT_RC_OK; } @@ -1370,6 +1386,7 @@ weechat::register($SCRIPT_NAME, $SCRIPT_AUTHOR, $SCRIPT_VERSION, " scan : scan a channel (be careful; scanning large channels takes a while!)\n". " you should manually /WHO #channel first or use /quote PROTOCTL UHNAMES\n". " count: display the number of rows in database\n". + " del_date: delete all entries from date1 to date2\n". "remove_nick_from_host: remove a nick from a given host\n". "\n\n". "Stalker will add nick!user\@host to database monitoring JOIN/WHOIS/NICK messages.\n\n". @@ -1411,8 +1428,11 @@ weechat::register($SCRIPT_NAME, $SCRIPT_AUTHOR, $SCRIPT_VERSION, " /".$SCRIPT_NAME." host .*\\.de -regex\n". " remove nick from an association host'\n". " /".$SCRIPT_NAME." remove_nick_from_host TheNick ~the\@bad.users.host\n". + " remove entries from database in range of given date:'\n". + " /".$SCRIPT_NAME." del_date 2014-01-01 2014-12-31\n". "", "count %-||". + "del_date %-||". "host %% %(irc_servers)|-regex %-||". "nick %(nick) %(irc_servers)|-regex -regex %-||". "remove_nick_from_host %(nick) |-regex -regex %-||". -- cgit v1.2.3-54-g00ecf From f4ce05157252a3052d3d8983d65433ac1e48e31a Mon Sep 17 00:00:00 2001 From: Johannes Löthberg Date: Mon, 20 Jul 2015 19:20:22 +0200 Subject: weechat: Add new setting --- weechat/weechat.conf | 1 + 1 file changed, 1 insertion(+) (limited to 'weechat') diff --git a/weechat/weechat.conf b/weechat/weechat.conf index 8c01b0a..ea3e779 100644 --- a/weechat/weechat.conf +++ b/weechat/weechat.conf @@ -40,6 +40,7 @@ color_real_white = off command_chars = "" command_incomplete = off confirm_quit = on +confirm_upgrade = off day_change = on day_change_message_1date = "-- %a, %d %b %Y --" day_change_message_2dates = "-- %%a, %%d %%b %%Y (%a, %d %b %Y) --" -- cgit v1.2.3-54-g00ecf