aboutsummaryrefslogtreecommitdiffstats
path: root/weechat
diff options
context:
space:
mode:
authorJohannes Löthberg <johannes@kyriasis.com>2014-02-18 16:56:41 +0100
committerJohannes Löthberg <johannes@kyriasis.com>2014-02-18 16:56:41 +0100
commit9c9e27b7bfc9c00acc02b91fdb8cb29c60fe546e (patch)
tree6e0486088938bbb8a88efe5c2639b807b0ddd23a /weechat
parent7e7aa928072775240ff70ca61f2dd0e8a09242d8 (diff)
downloaddotfiles-9c9e27b7bfc9c00acc02b91fdb8cb29c60fe546e.tar.xz
Diffstat (limited to 'weechat')
-rw-r--r--weechat/alias.conf3
-rw-r--r--weechat/aspell.conf2
-rw-r--r--weechat/buffers.conf12
-rw-r--r--weechat/charset.conf2
-rw-r--r--weechat/irc.conf6
-rw-r--r--weechat/iset.conf4
-rw-r--r--weechat/logger.conf2
-rw-r--r--weechat/perl/buffers.pl349
-rw-r--r--weechat/perl/highmon.pl32
-rw-r--r--weechat/perl/iset.pl108
-rw-r--r--weechat/perl/yaurls.pl301
-rw-r--r--weechat/plugins.conf319
-rw-r--r--weechat/python/announce_url_title.py14
-rw-r--r--weechat/python/listbuffer.py467
-rw-r--r--weechat/relay.conf2
-rw-r--r--weechat/rmodifier.conf2
-rw-r--r--weechat/script.conf2
-rw-r--r--weechat/sec.conf2
-rw-r--r--weechat/xfer.conf3
-rw-r--r--weechat/yaurls.conf2
20 files changed, 721 insertions, 913 deletions
diff --git a/weechat/alias.conf b/weechat/alias.conf
index f0673be..7c22685 100644
--- a/weechat/alias.conf
+++ b/weechat/alias.conf
@@ -1,5 +1,5 @@
#
-# alias.conf -- weechat v0.4.3-dev
+# alias.conf -- weechat v0.4.4-dev
#
[cmd]
@@ -41,5 +41,6 @@ WC = "window merge"
WI = "whois"
WII = "whois $1 $1"
WW = "whowas"
+znc = "/quote znc"
[completion]
diff --git a/weechat/aspell.conf b/weechat/aspell.conf
index a07a4bc..d46dc2d 100644
--- a/weechat/aspell.conf
+++ b/weechat/aspell.conf
@@ -1,5 +1,5 @@
#
-# aspell.conf -- weechat v0.4.3-dev
+# aspell.conf -- weechat v0.4.4-dev
#
[color]
diff --git a/weechat/buffers.conf b/weechat/buffers.conf
index 0aa864d..d0caf51 100644
--- a/weechat/buffers.conf
+++ b/weechat/buffers.conf
@@ -1,5 +1,5 @@
#
-# buffers.conf -- weechat v0.4.3-dev
+# buffers.conf -- weechat v0.4.4-dev
#
[color]
@@ -19,12 +19,14 @@ none_channel_bg = default
none_channel_fg = default
number = lightgreen
number_char = lightgreen
+prefix_bufname = default
queries_default_bg = default
queries_default_fg = default
queries_highlight_bg = red
queries_highlight_fg = magenta
queries_message_bg = red
queries_message_fg = magenta
+suffix_bufname = default
whitelist_default_bg = default
whitelist_default_fg = default
whitelist_highlight_bg = red
@@ -39,6 +41,9 @@ whitelist_private_fg = magenta
[look]
core_to_front = on
detach = 0
+detach_buffer_immediately = ""
+detach_display_window_number = off
+detach_displayed_buffers = on
detach_free_content = off
detach_query = off
hide_merged_buffers = server
@@ -48,13 +53,18 @@ indenting = on
indenting_number = on
jump_prev_next_visited_buffer = off
mark_inactive = on
+mouse_move_buffer = on
name_crop_suffix = "×"
name_size_max = 0
number_char = "."
prefix = off
+prefix_bufname = ""
prefix_empty = on
+prefix_for_query = ""
short_names = on
show_lag = off
show_number = on
sort = number
+suffix_bufname = ""
+toogle_bar = on
whitelist_buffers = ""
diff --git a/weechat/charset.conf b/weechat/charset.conf
index bf46f99..33e4914 100644
--- a/weechat/charset.conf
+++ b/weechat/charset.conf
@@ -1,5 +1,5 @@
#
-# charset.conf -- weechat v0.4.3-dev
+# charset.conf -- weechat v0.4.4-dev
#
[default]
diff --git a/weechat/irc.conf b/weechat/irc.conf
index 25f2807..a254002 100644
--- a/weechat/irc.conf
+++ b/weechat/irc.conf
@@ -1,5 +1,5 @@
#
-# irc.conf -- weechat v0.4.3-dev
+# irc.conf -- weechat v0.4.4-dev
#
[look]
@@ -130,6 +130,7 @@ sasl_username = ""
ssl = on
ssl_cert = "%h/keys/demize.pem"
ssl_dhkey_size = 2048
+ssl_fingerprint = ""
ssl_priorities = "NORMAL"
ssl_verify = on
username = "dem"
@@ -142,6 +143,7 @@ Freenode.ssl
Freenode.ssl_cert
Freenode.ssl_priorities
Freenode.ssl_dhkey_size
+Freenode.ssl_fingerprint
Freenode.ssl_verify
Freenode.password = "kyrias/freenode:"
Freenode.capabilities
@@ -177,6 +179,7 @@ Furnet.ssl
Furnet.ssl_cert
Furnet.ssl_priorities
Furnet.ssl_dhkey_size
+Furnet.ssl_fingerprint
Furnet.ssl_verify
Furnet.password = "kyrias/furnet:"
Furnet.capabilities
@@ -212,6 +215,7 @@ Foonetic.ssl
Foonetic.ssl_cert
Foonetic.ssl_priorities
Foonetic.ssl_dhkey_size
+Foonetic.ssl_fingerprint
Foonetic.ssl_verify
Foonetic.password = "kyrias/foonetic:"
Foonetic.capabilities
diff --git a/weechat/iset.conf b/weechat/iset.conf
index cf43d55..fb0b750 100644
--- a/weechat/iset.conf
+++ b/weechat/iset.conf
@@ -1,5 +1,5 @@
#
-# iset.conf -- weechat v0.4.3-dev
+# iset.conf -- weechat v0.4.4-dev
#
[color]
@@ -12,6 +12,8 @@ option_selected = white
type = brown
type_selected = yellow
value = cyan
+value_diff = magenta
+value_diff_selected = lightmagenta
value_selected = lightcyan
value_undef = green
value_undef_selected = lightgreen
diff --git a/weechat/logger.conf b/weechat/logger.conf
index 02a4a92..8fdc4ef 100644
--- a/weechat/logger.conf
+++ b/weechat/logger.conf
@@ -1,5 +1,5 @@
#
-# logger.conf -- weechat v0.4.3-dev
+# logger.conf -- weechat v0.4.4-dev
#
[look]
diff --git a/weechat/perl/buffers.pl b/weechat/perl/buffers.pl
index e315f80..d4d17c2 100644
--- a/weechat/perl/buffers.pl
+++ b/weechat/perl/buffers.pl
@@ -1,6 +1,6 @@
#
-# Copyright (C) 2008-2012 Sebastien Helleu <flashcode@flashtux.org>
-# Copyright (C) 2011-2012 Nils G <weechatter@arcor.de>
+# Copyright (C) 2008-2014 Sebastien Helleu <flashcode@flashtux.org>
+# Copyright (C) 2011-2013 Nils G <weechatter@arcor.de>
#
# 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
@@ -20,6 +20,24 @@
#
# History:
#
+# 2014-01-01, Sebastien Helleu <flashcode@flashtux.org>:
+# v4.5: add option "mouse_move_buffer"
+# 2013-12-11, Sebastien Helleu <flashcode@flashtux.org>:
+# v4.4: fix buffer number on drag to the end of list when option
+# weechat.look.buffer_auto_renumber is off
+# 2013-12-10, nils_2@freenode.#weechat:
+# v4.3: add options "prefix_bufname" and "suffix_bufname (idea by silverd)
+# : fix hook_timer() for show_lag wasn't disabled
+# : improved signal handling (less updating of buffers list)
+# 2013-11-07, Sebastien Helleu <flashcode@flashtux.org>:
+# v4.2: use default filling "columns_vertical" when bar position is top/bottom
+# 2013-10-31, nils_2@freenode.#weechat:
+# v4.1: add option "detach_buffer_immediately" (idea by farn)
+# 2013-10-20, nils_2@freenode.#weechat:
+# v4.0: add options "detach_displayed_buffers", "detach_display_window_number"
+# 2013-09-27, nils_2@freenode.#weechat:
+# v3.9: add option "toggle_bar" and option "show_prefix_query" (idea by IvarB)
+# : fix problem with linefeed at end of list of buffers (reported by grawity)
# 2012-10-18, nils_2@freenode.#weechat:
# v3.8: add option "mark_inactive", to mark buffers you are not in (idea by xrdodrx)
# : add wildcard "*" for immune_detach_buffers (idea by StarWeaver)
@@ -134,7 +152,8 @@
use strict;
use Encode qw( decode encode );
# -------------------------------[ internal ]-------------------------------------
-my $version = "3.8";
+my $SCRIPT_NAME = "buffers";
+my $SCRIPT_VERSION = "4.5";
my $BUFFERS_CONFIG_FILE_NAME = "buffers";
my $buffers_config_file;
@@ -147,31 +166,46 @@ my %options;
my %hotlist_level = (0 => "low", 1 => "message", 2 => "private", 3 => "highlight");
my @whitelist_buffers = ();
my @immune_detach_buffers= ();
+my @detach_buffer_immediately= ();
my @buffers_focus = ();
my %buffers_timer = ();
my %Hooks = ();
# --------------------------------[ init ]--------------------------------------
-weechat::register("buffers", "Sebastien Helleu <flashcode\@flashtux.org>", $version,
- "GPL3", "Sidebar with list of buffers", "", "");
+weechat::register($SCRIPT_NAME, "Sebastien Helleu <flashcode\@flashtux.org>", $SCRIPT_VERSION,
+ "GPL3", "Sidebar with list of buffers", "shutdown_cb", "");
my $weechat_version = weechat::info_get("version_number", "") || 0;
buffers_config_init();
buffers_config_read();
-weechat::bar_item_new("buffers", "build_buffers", "");
-weechat::bar_new("buffers", "0", "0", "root", "", "left", "horizontal",
+weechat::bar_item_new($SCRIPT_NAME, "build_buffers", "");
+weechat::bar_new($SCRIPT_NAME, "0", "0", "root", "", "left", "columns_vertical",
"vertical", "0", "0", "default", "default", "default", "1",
- "buffers");
-weechat::hook_signal("buffer_*", "buffers_signal_buffer", "");
-weechat::hook_signal("window_switch", "buffers_signal_buffer", "");
-weechat::hook_signal("hotlist_*", "buffers_signal_hotlist", "");
+ $SCRIPT_NAME);
+
+if ( check_bar_item() == 0 )
+{
+ weechat::command("","/bar show " . $SCRIPT_NAME) if ( weechat::config_boolean($options{"toggle_bar"}) eq 1 );
+}
+
+weechat::hook_signal("buffer_opened", "buffers_signal_buffer", "");
+weechat::hook_signal("buffer_closed", "buffers_signal_buffer", "");
+weechat::hook_signal("buffer_merged", "buffers_signal_buffer", "");
+weechat::hook_signal("buffer_unmerged", "buffers_signal_buffer", "");
+weechat::hook_signal("buffer_moved", "buffers_signal_buffer", "");
+weechat::hook_signal("buffer_renamed", "buffers_signal_buffer", "");
+weechat::hook_signal("buffer_switch", "buffers_signal_buffer", "");
+
weechat::hook_signal("window_switch", "buffers_signal_buffer", "");
+weechat::hook_signal("hotlist_changed", "buffers_signal_hotlist", "");
#weechat::hook_command_run("/input switch_active_*", "buffers_signal_buffer", "");
-weechat::bar_item_update("buffers");
+weechat::bar_item_update($SCRIPT_NAME);
+
+
if ($weechat_version >= 0x00030600)
{
- weechat::hook_focus("buffers", "buffers_focus_buffers", "");
+ weechat::hook_focus($SCRIPT_NAME, "buffers_focus_buffers", "");
weechat::hook_hsignal("buffers_mouse", "buffers_hsignal_mouse", "");
weechat::key_bind("mouse", \%mouse_keys);
}
@@ -206,10 +240,13 @@ weechat::hook_command( $cmd_buffers_detach,
if ($weechat_version >= 0x00030800)
{
weechat::hook_config("buffers.look.detach", "hook_timer_detach", "");
+ $Hooks{timer_detach} = weechat::hook_timer( weechat::config_integer( $options{"detach"}) * 1000, 60, 0, "buffers_signal_hotlist", "") if ( weechat::config_integer( $options{"detach"}) > 0 );
}
weechat::hook_config("buffers.look.show_lag", "hook_timer_lag", "");
+ $Hooks{timer_lag} = weechat::hook_timer( weechat::config_integer(weechat::config_get("irc.network.lag_refresh_interval")) * 1000, 0, 0, "buffers_signal_hotlist", "") if ( weechat::config_boolean($options{"show_lag"}) );
+
# -------------------------------- [ command ] --------------------------------
sub buffers_cmd_whitelist
{
@@ -251,10 +288,11 @@ my ( $data, $buffer, $args ) = @_;
}
sub buffers_cmd_detach
{
-my ( $data, $buffer, $args ) = @_;
+ my ( $data, $buffer, $args ) = @_;
$args = lc($args);
my $immune_detach_buffers = weechat::config_string( weechat::config_get("buffers.look.immune_detach_buffers") );
return weechat::WEECHAT_RC_OK if ( $immune_detach_buffers eq "" and $args eq "del" or $immune_detach_buffers eq "" and $args eq "reset" );
+
my @buffers_list = split( /,/, $immune_detach_buffers );
# get buffers name
my $infolist = weechat::infolist_get("buffer", weechat::current_buffer(), "");
@@ -287,6 +325,7 @@ my ( $data, $buffer, $args ) = @_;
}
return weechat::WEECHAT_RC_OK;
}
+
sub create_whitelist
{
my @buffers_list = @{$_[0]};
@@ -311,16 +350,16 @@ sub hook_timer_detach
else
{
weechat::unhook($Hooks{timer_detach}) if $Hooks{timer_detach};
- $Hooks{timer_detach} = weechat::hook_timer( weechat::config_integer( $options{"detach"}) * 1000, 60, 0, "buffers_signal_buffer", "");
+ $Hooks{timer_detach} = weechat::hook_timer( weechat::config_integer( $options{"detach"}) * 1000, 60, 0, "buffers_signal_hotlist", "");
}
- weechat::bar_item_update("buffers");
+ weechat::bar_item_update($SCRIPT_NAME);
return weechat::WEECHAT_RC_OK;
}
sub hook_timer_lag
{
my $lag = $_[2];
- if ( $lag eq 0 )
+ if ( $lag eq "off" )
{
weechat::unhook($Hooks{timer_lag}) if $Hooks{timer_lag};
$Hooks{timer_lag} = "";
@@ -330,7 +369,7 @@ sub hook_timer_lag
weechat::unhook($Hooks{timer_lag}) if $Hooks{timer_lag};
$Hooks{timer_lag} = weechat::hook_timer( weechat::config_integer(weechat::config_get("irc.network.lag_refresh_interval")) * 1000, 0, 0, "buffers_signal_hotlist", "");
}
- weechat::bar_item_update("buffers");
+ weechat::bar_item_update($SCRIPT_NAME);
return weechat::WEECHAT_RC_OK;
}
@@ -353,64 +392,74 @@ sub buffers_config_init
return if ($buffers_config_file eq "");
my %default_options_color =
-("color_current_fg" => ["current_fg", "color", "foreground color for current buffer", "", 0, 0,"lightcyan", "lightcyan", 0, "", "","buffers_signal_config", "", "", ""],
- "color_current_bg" => ["current_bg", "color", "background color for current buffer", "", 0, 0,"red", "red", 0, "", "","buffers_signal_config", "", "", ""],
- "color_default_fg" => ["default_fg", "color", "default foreground color for buffer name", "", 0, 0,"default", "default", 0, "", "","buffers_signal_config", "", "", ""],
- "color_default_bg" => ["default_bg", "color", "default background color for buffer name", "", 0, 0,"default", "default", 0, "", "","buffers_signal_config", "", "", ""],
- "color_hotlist_highlight_fg" => ["hotlist_highlight_fg", "color", "change foreground color of buffer name if a highlight messaged received","", 0, 0,"magenta", "magenta", 0, "", "","buffers_signal_config", "", "", ""],
- "color_hotlist_highlight_bg" => ["hotlist_highlight_bg", "color", "change background color of buffer name if a highlight messaged received", "", 0, 0,"default", "default", 0, "", "","buffers_signal_config", "", "", ""],
- "color_hotlist_low_fg" => ["hotlist_low_fg", "color", "change foreground color of buffer name if a low message received", "", 0, 0,"white", "white", 0, "", "","buffers_signal_config", "", "", ""],
+("color_current_fg" => ["current_fg", "color", "foreground color for current buffer", "", 0, 0, "lightcyan", "lightcyan", 0, "", "", "buffers_signal_config", "", "", ""],
+ "color_current_bg" => ["current_bg", "color", "background color for current buffer", "", 0, 0, "red", "red", 0, "", "", "buffers_signal_config", "", "", ""],
+ "color_default_fg" => ["default_fg", "color", "default foreground color for buffer name", "", 0, 0, "default", "default", 0, "", "", "buffers_signal_config", "", "", ""],
+ "color_default_bg" => ["default_bg", "color", "default background color for buffer name", "", 0, 0, "default", "default", 0, "", "", "buffers_signal_config", "", "", ""],
+ "color_hotlist_highlight_fg" => ["hotlist_highlight_fg", "color", "change foreground color of buffer name if a highlight messaged received", "", 0, 0, "magenta", "magenta", 0, "", "", "buffers_signal_config", "", "", ""],
+ "color_hotlist_highlight_bg" => ["hotlist_highlight_bg", "color", "change background color of buffer name if a highlight messaged received", "", 0, 0, "default", "default", 0, "", "", "buffers_signal_config", "", "", ""],
+ "color_hotlist_low_fg" => ["hotlist_low_fg", "color", "change foreground color of buffer name if a low message received", "", 0, 0, "white", "white", 0, "", "", "buffers_signal_config", "", "", ""],
"color_hotlist_low_bg" => ["hotlist_low_bg", "color", "change background color of buffer name if a low message received", "", 0, 0,
- "default", "default", 0, "", "","buffers_signal_config", "", "", ""],
- "color_hotlist_message_fg" => ["hotlist_message_fg", "color", "change foreground color of buffer name if a normal message received", "", 0, 0,"yellow", "yellow", 0, "", "","buffers_signal_config", "", "", ""],
- "color_hotlist_message_bg" => ["hotlist_message_bg", "color", "change background color of buffer name if a normal message received", "", 0, 0,"default", "default", 0, "", "","buffers_signal_config", "", "", ""],
- "color_hotlist_private_fg" => ["hotlist_private_fg", "color", "change foreground color of buffer name if a private message received", "", 0, 0,"lightgreen", "lightgreen", 0, "", "","buffers_signal_config", "", "", ""],
- "color_hotlist_private_bg" => ["hotlist_private_bg", "color", "change background color of buffer name if a private message received", "", 0, 0,"default", "default", 0, "", "","buffers_signal_config", "", "", ""],
- "color_number" => ["number", "color", "color for buffer number", "", 0, 0,"lightgreen", "lightgreen", 0, "", "","buffers_signal_config", "", "", ""],
- "color_number_char" => ["number_char", "color", "color for buffer number char", "", 0, 0,"lightgreen", "lightgreen", 0, "", "","buffers_signal_config", "", "", ""],
- "color_whitelist_default_fg" => ["whitelist_default_fg", "color", "default foreground color for whitelist buffer name", "", 0, 0,"", "", 0, "", "","buffers_signal_config", "", "", ""],
- "color_whitelist_default_bg" => ["whitelist_default_bg", "color", "default background color for whitelist buffer name", "", 0, 0,"", "", 0, "", "","buffers_signal_config", "", "", ""],
- "color_whitelist_low_fg" => ["whitelist_low_fg", "color", "low color of whitelist buffer name", "", 0, 0,"", "", 0, "", "","buffers_signal_config", "", "", ""],
- "color_whitelist_low_bg" => ["whitelist_low_bg", "color", "low color of whitelist buffer name", "", 0, 0,"", "", 0, "", "","buffers_signal_config", "", "", ""],
- "color_whitelist_message_fg" => ["whitelist_message_fg", "color", "message color of whitelist buffer name", "", 0, 0,"", "", 0, "", "","buffers_signal_config", "", "", ""],
- "color_whitelist_message_bg" => ["whitelist_message_bg", "color", "message color of whitelist buffer name", "", 0, 0,"", "", 0, "", "","buffers_signal_config", "", "", ""],
- "color_whitelist_private_fg" => ["whitelist_private_fg", "color", "private color of whitelist buffer name", "", 0, 0,"", "", 0, "", "","buffers_signal_config", "", "", ""],
- "color_whitelist_private_bg" => ["whitelist_private_bg", "color", "private color of whitelist buffer name", "", 0, 0,"", "", 0, "", "","buffers_signal_config", "", "", ""],
- "color_whitelist_highlight_fg" => ["whitelist_highlight_fg", "color", "highlight color of whitelist buffer name", "", 0, 0,"", "", 0, "", "","buffers_signal_config", "", "", ""],
- "color_whitelist_highlight_bg" => ["whitelist_highlight_bg", "color", "highlight color of whitelist buffer name", "", 0, 0,"", "", 0, "", "","buffers_signal_config", "", "", ""],
- "color_none_channel_fg" => ["none_channel_fg", "color", "foreground color for none channel buffer (e.g.: core/server/plugin buffer)", "", 0, 0,"default", "default", 0, "", "","buffers_signal_config", "", "", ""],
- "color_none_channel_bg" => ["none_channel_bg", "color", "background color for none channel buffer (e.g.: core/server/plugin buffer)", "", 0, 0,"default", "default", 0, "", "","buffers_signal_config", "", "", ""],
- "queries_default_fg" => ["queries_default_fg", "color", "foreground color for query buffer without message", "", 0, 0,"default", "default", 0, "", "","buffers_signal_config", "", "", ""],
- "queries_default_bg" => ["queries_default_bg", "color", "background color for query buffer without message", "", 0, 0,"default", "default", 0, "", "","buffers_signal_config", "", "", ""],
- "queries_message_fg" => ["queries_message_fg", "color", "foreground color for query buffer with unread message", "", 0, 0,"default", "default", 0, "", "","buffers_signal_config", "", "", ""],
- "queries_message_bg" => ["queries_message_bg", "color", "background color for query buffer with unread message", "", 0, 0,"default", "default", 0, "", "","buffers_signal_config", "", "", ""],
- "queries_highlight_fg" => ["queries_highlight_fg", "color", "foreground color for query buffer with unread highlight", "", 0, 0,"default", "default", 0, "", "","buffers_signal_config", "", "", ""],
- "queries_highlight_bg" => ["queries_highlight_bg", "color", "background color for query buffer with unread highlight", "", 0, 0,"default", "default", 0, "", "","buffers_signal_config", "", "", ""],
+ "default", "default", 0, "", "", "buffers_signal_config", "", "", ""],
+ "color_hotlist_message_fg" => ["hotlist_message_fg", "color", "change foreground color of buffer name if a normal message received", "", 0, 0, "yellow", "yellow", 0, "", "", "buffers_signal_config", "", "", ""],
+ "color_hotlist_message_bg" => ["hotlist_message_bg", "color", "change background color of buffer name if a normal message received", "", 0, 0, "default", "default", 0, "", "", "buffers_signal_config", "", "", ""],
+ "color_hotlist_private_fg" => ["hotlist_private_fg", "color", "change foreground color of buffer name if a private message received", "", 0, 0, "lightgreen", "lightgreen", 0, "", "", "buffers_signal_config", "", "", ""],
+ "color_hotlist_private_bg" => ["hotlist_private_bg", "color", "change background color of buffer name if a private message received", "", 0, 0, "default", "default", 0, "", "", "buffers_signal_config", "", "", ""],
+ "color_number" => ["number", "color", "color for buffer number", "", 0, 0, "lightgreen", "lightgreen", 0, "", "", "buffers_signal_config", "", "", ""],
+ "color_number_char" => ["number_char", "color", "color for buffer number char", "", 0, 0, "lightgreen", "lightgreen", 0, "", "", "buffers_signal_config", "", "", ""],
+ "color_whitelist_default_fg" => ["whitelist_default_fg", "color", "default foreground color for whitelist buffer name", "", 0, 0, "", "", 0, "", "", "buffers_signal_config", "", "", ""],
+ "color_whitelist_default_bg" => ["whitelist_default_bg", "color", "default background color for whitelist buffer name", "", 0, 0, "", "", 0, "", "", "buffers_signal_config", "", "", ""],
+ "color_whitelist_low_fg" => ["whitelist_low_fg", "color", "low color of whitelist buffer name", "", 0, 0, "", "", 0, "", "", "buffers_signal_config", "", "", ""],
+ "color_whitelist_low_bg" => ["whitelist_low_bg", "color", "low color of whitelist buffer name", "", 0, 0, "", "", 0, "", "", "buffers_signal_config", "", "", ""],
+ "color_whitelist_message_fg" => ["whitelist_message_fg", "color", "message color of whitelist buffer name", "", 0, 0, "", "", 0, "", "", "buffers_signal_config", "", "", ""],
+ "color_whitelist_message_bg" => ["whitelist_message_bg", "color", "message color of whitelist buffer name", "", 0, 0, "", "", 0, "", "", "buffers_signal_config", "", "", ""],
+ "color_whitelist_private_fg" => ["whitelist_private_fg", "color", "private color of whitelist buffer name", "", 0, 0, "", "", 0, "", "", "buffers_signal_config", "", "", ""],
+ "color_whitelist_private_bg" => ["whitelist_private_bg", "color", "private color of whitelist buffer name", "", 0, 0, "", "", 0, "", "", "buffers_signal_config", "", "", ""],
+ "color_whitelist_highlight_fg" => ["whitelist_highlight_fg", "color", "highlight color of whitelist buffer name", "", 0, 0, "", "", 0, "", "", "buffers_signal_config", "", "", ""],
+ "color_whitelist_highlight_bg" => ["whitelist_highlight_bg", "color", "highlight color of whitelist buffer name", "", 0, 0, "", "", 0, "", "", "buffers_signal_config", "", "", ""],
+ "color_none_channel_fg" => ["none_channel_fg", "color", "foreground color for none channel buffer (e.g.: core/server/plugin buffer)", "", 0, 0, "default", "default", 0, "", "", "buffers_signal_config", "", "", ""],
+ "color_none_channel_bg" => ["none_channel_bg", "color", "background color for none channel buffer (e.g.: core/server/plugin buffer)", "", 0, 0, "default", "default", 0, "", "", "buffers_signal_config", "", "", ""],
+ "queries_default_fg" => ["queries_default_fg", "color", "foreground color for query buffer without message", "", 0, 0, "default", "default", 0, "", "", "buffers_signal_config", "", "", ""],
+ "queries_default_bg" => ["queries_default_bg", "color", "background color for query buffer without message", "", 0, 0, "default", "default", 0, "", "", "buffers_signal_config", "", "", ""],
+ "queries_message_fg" => ["queries_message_fg", "color", "foreground color for query buffer with unread message", "", 0, 0, "default", "default", 0, "", "", "buffers_signal_config", "", "", ""],
+ "queries_message_bg" => ["queries_message_bg", "color", "background color for query buffer with unread message", "", 0, 0, "default", "default", 0, "", "", "buffers_signal_config", "", "", ""],
+ "queries_highlight_fg" => ["queries_highlight_fg", "color", "foreground color for query buffer with unread highlight", "", 0, 0, "default", "default", 0, "", "", "buffers_signal_config", "", "", ""],
+ "queries_highlight_bg" => ["queries_highlight_bg", "color", "background color for query buffer with unread highlight", "", 0, 0, "default", "default", 0, "", "", "buffers_signal_config", "", "", ""],
+ "color_prefix_bufname" => ["prefix_bufname", "color", "color for prefix of buffer name", "", 0, 0, "default", "default", 0, "", "", "buffers_signal_config", "", "", ""],
+ "color_suffix_bufname" => ["suffix_bufname", "color", "color for suffix of buffer name", "", 0, 0, "default", "default", 0, "", "", "buffers_signal_config", "", "", ""],
);
my %default_options_look =
(
- "hotlist_counter" => ["hotlist_counter","boolean","show number of message for the buffer (this option needs WeeChat >= 0.3.5). The relevant option for notification is \"weechat.look.buffer_notify_default\"","",0,0,"off","off",0,"","","buffers_signal_config","","",""],
- "show_lag" => ["show_lag","boolean","show lag behind servername. This option is using \"irc.color.item_lag_finished\", \"irc.network.lag_min_show\" and \"irc.network.lag_refresh_interval\"","",0,0,"off","off",0,"","","buffers_signal_config","","",""],
- "look_whitelist_buffers" => ["whitelist_buffers", "string", "comma separated list of buffers for using a differnt color scheme (for example: freenode.#weechat,freenode.#weechat-fr)", "", 0, 0,"", "", 0, "", "", "buffers_signal_config_whitelist", "", "", ""],
- "hide_merged_buffers" => ["hide_merged_buffers", "integer", "hide merged buffers. The value determines which merged buffers should be hidden, keepserver meaning 'all except server buffers'. Other values correspondent to the buffer type.", "server|channel|private|keepserver|all|none", 0, 0,"none", "none", 0, "", "", "buffers_signal_config", "", "", ""],
- "indenting" => ["indenting", "integer", "use indenting for channel and query buffers. This option only takes effect if bar is left/right positioned", "off|on|under_name", 0, 0,"off", "off", 0, "", "", "buffers_signal_config", "", "", ""],
- "indenting_number" => ["indenting_number", "boolean", "use indenting for numbers. This option only takes effect if bar is left/right positioned", "", 0, 0,"on", "on", 0, "", "", "buffers_signal_config", "", "", ""],
- "short_names" => ["short_names", "boolean", "display short names (remove text before first \".\" in buffer name)", "", 0, 0,"on", "on", 0, "", "", "buffers_signal_config", "", "", ""],
- "show_number" => ["show_number", "boolean", "display channel number in front of buffername", "", 0, 0,"on", "on", 0, "", "", "buffers_signal_config", "", "", ""],
- "show_number_char" => ["number_char", "string", "display a char after channel number", "", 0, 0,".", ".", 0, "", "", "buffers_signal_config", "", "", ""],
- "show_prefix" => ["prefix", "boolean", "show your prefix for channel", "", 0, 0,"off", "off", 0, "", "", "buffers_signal_config", "", "", ""],
- "show_prefix_empty" => ["prefix_empty", "boolean", "use a placeholder for channels without prefix", "", 0, 0,"on", "on", 0, "", "", "buffers_signal_config", "", "", ""],
- "sort" => ["sort", "integer", "sort buffer-list by \"number\" or \"name\"", "number|name", 0, 0,"number", "number", 0, "", "", "buffers_signal_config", "", "", ""],
- "core_to_front" => ["core_to_front", "boolean", "core buffer and buffers with free content will be listed first. Take only effect if buffer sort is by name", "", 0, 0,"off", "off", 0, "", "", "buffers_signal_config", "", "", ""],
- "jump_prev_next_visited_buffer" => ["jump_prev_next_visited_buffer", "boolean", "jump to previously or next visited buffer if you click with left/right mouse button on currently visiting buffer", "", 0, 0,"off", "off", 0, "", "", "buffers_signal_config", "", "", ""],
- "name_size_max" => ["name_size_max","integer","maximum size of buffer name. 0 means no limitation","",0,256,0,0,0, "", "", "buffers_signal_config", "", "", ""],
- "name_crop_suffix" => ["name_crop_suffix","string","contains an optional char(s) that is appended when buffer name is shortened","",0,0,"+","+",0,"","","buffers_signal_config", "", "", ""],
- "detach" => ["detach", "integer","detach channel from buffers list after a specific period of time (in seconds) without action (weechat ≥ 0.3.8 required)", "", 0, 31536000,0, "number", 0, "", "", "buffers_signal_config", "", "", ""],
- "immune_detach_buffers"=> ["immune_detach_buffers", "string", "Comma seperated list of buffers to NOT automatically detatch. Allows \"*\" wildcard. Ex: \"BitlBee,freenode.*\"", "", 0, 0,"", "", 0, "", "", "buffers_signal_config_immune_detach_buffers", "", "", ""],
- "detach_query" => ["detach_query", "boolean", "query buffer will be detachted", "", 0, 0,"off", "off", 0, "", "", "buffers_signal_config", "", "", ""],
- "detach_free_content" => ["detach_free_content", "boolean", "buffers with free content will be detached (Ex: iset, chanmon)", "", 0, 0,"off", "off", 0, "", "", "buffers_signal_config", "", "", ""],
- "mark_inactive" => ["mark_inactive", "boolean", "if option is \"on\", inactive buffers (those you are not in) will have parentesis around them. An inactive buffer will not be detached.", "", 0, 0,"off", "off", 0, "", "", "buffers_signal_config", "", "", ""],
+ "hotlist_counter" => ["hotlist_counter", "boolean", "show number of message for the buffer (this option needs WeeChat >= 0.3.5). The relevant option for notification is \"weechat.look.buffer_notify_default\"", "", 0, 0, "off", "off", 0, "", "", "buffers_signal_config", "", "", ""],
+ "show_lag" => ["show_lag", "boolean", "show lag behind servername. This option is using \"irc.color.item_lag_finished\", \"irc.network.lag_min_show\" and \"irc.network.lag_refresh_interval\"", "", 0, 0, "off", "off", 0, "", "", "buffers_signal_config", "", "", ""],
+ "look_whitelist_buffers" => ["whitelist_buffers", "string", "comma separated list of buffers for using a differnt color scheme (for example: freenode.#weechat,freenode.#weechat-fr)", "", 0, 0, "", "", 0, "", "", "buffers_signal_config_whitelist", "", "", ""],
+ "hide_merged_buffers" => ["hide_merged_buffers", "integer", "hide merged buffers. The value determines which merged buffers should be hidden, keepserver meaning 'all except server buffers'. Other values correspondent to the buffer type.", "server|channel|private|keepserver|all|none", 0, 0, "none", "none", 0, "", "", "buffers_signal_config", "", "", ""],
+ "indenting" => ["indenting", "integer", "use indenting for channel and query buffers. This option only takes effect if bar is left/right positioned", "off|on|under_name", 0, 0, "off", "off", 0, "", "", "buffers_signal_config", "", "", ""],
+ "indenting_number" => ["indenting_number", "boolean", "use indenting for numbers. This option only takes effect if bar is left/right positioned", "", 0, 0, "on", "on", 0, "", "", "buffers_signal_config", "", "", ""],
+ "short_names" => ["short_names", "boolean", "display short names (remove text before first \".\" in buffer name)", "", 0, 0, "on", "on", 0, "", "", "buffers_signal_config", "", "", ""],
+ "show_number" => ["show_number", "boolean", "display channel number in front of buffername", "", 0, 0, "on", "on", 0, "", "", "buffers_signal_config", "", "", ""],
+ "show_number_char" => ["number_char", "string", "display a char behind channel number", "", 0, 0, ".", ".", 0, "", "", "buffers_signal_config", "", "", ""],
+ "show_prefix_bufname" => ["prefix_bufname", "string", "prefix displayed in front of buffername", "", 0, 0, "", "", 0, "", "", "buffers_signal_config", "", "", ""],
+ "show_suffix_bufname" => ["suffix_bufname", "string", "suffix displayed at end of buffername", "", 0, 0, "", "", 0, "", "", "buffers_signal_config", "", "", ""],
+ "show_prefix" => ["prefix", "boolean", "displays your prefix for channel in front of buffername", "", 0, 0, "off", "off", 0, "", "", "buffers_signal_config", "", "", ""],
+ "show_prefix_empty" => ["prefix_empty", "boolean", "use a placeholder for channels without prefix", "", 0, 0, "on", "on", 0, "", "", "buffers_signal_config", "", "", ""],
+ "show_prefix_query" => ["prefix_for_query", "string", "prefix displayed in front of query buffer", "", 0, 0, "", "", 0, "", "", "buffers_signal_config", "", "", ""],
+ "sort" => ["sort", "integer", "sort buffer-list by \"number\" or \"name\"", "number|name", 0, 0, "number", "number", 0, "", "", "buffers_signal_config", "", "", ""],
+ "core_to_front" => ["core_to_front", "boolean", "core buffer and buffers with free content will be listed first. Take only effect if buffer sort is by name", "", 0, 0, "off", "off", 0, "", "", "buffers_signal_config", "", "", ""],
+ "jump_prev_next_visited_buffer" => ["jump_prev_next_visited_buffer", "boolean", "jump to previously or next visited buffer if you click with left/right mouse button on currently visiting buffer", "", 0, 0, "off", "off", 0, "", "", "buffers_signal_config", "", "", ""],
+ "name_size_max" => ["name_size_max", "integer", "maximum size of buffer name. 0 means no limitation", "", 0, 256, 0, 0, 0, "", "", "buffers_signal_config", "", "", ""],
+ "name_crop_suffix" => ["name_crop_suffix", "string", "contains an optional char(s) that is appended when buffer name is shortened", "", 0, 0, "+", "+", 0, "", "", "buffers_signal_config", "", "", ""],
+ "detach" => ["detach", "integer", "detach channel from buffers list after a specific period of time (in seconds) without action (weechat ≥ 0.3.8 required) (0 means \"off\")", "", 0, 31536000, 0, "number", 0, "", "", "buffers_signal_config", "", "", ""],
+ "immune_detach_buffers" => ["immune_detach_buffers", "string", "comma separated list of buffers to NOT automatically detatch. Allows \"*\" wildcard. Ex: \"BitlBee,freenode.*\"", "", 0, 0, "", "", 0, "", "", "buffers_signal_config_immune_detach_buffers", "", "", ""],
+ "detach_query" => ["detach_query", "boolean", "query buffer will be detachted", "", 0, 0, "off", "off", 0, "", "", "buffers_signal_config", "", "", ""],
+ "detach_buffer_immediately" => ["detach_buffer_immediately", "string", "comma separated list of buffers to detach immediately. A query and highlight message will attach buffer again. Allows \"*\" wildcard. Ex: \"BitlBee,freenode.*\"", "", 0, 0, "", "", 0, "", "", "buffers_signal_config_detach_buffer_immediately", "", "", ""],
+ "detach_free_content" => ["detach_free_content", "boolean", "buffers with free content will be detached (Ex: iset, chanmon)", "", 0, 0, "off", "off", 0, "", "", "buffers_signal_config", "", "", ""],
+ "detach_displayed_buffers" => ["detach_displayed_buffers", "boolean", "buffers displayed in a (split) window will be detached", "", 0, 0, "on", "on", 0, "", "", "buffers_signal_config", "", "", ""],
+ "detach_display_window_number" => ["detach_display_window_number", "boolean", "window number will be add, behind buffer name (this option takes only effect with \"detach_displayed_buffers\" option)", "", 0, 0, "off", "off", 0, "", "", "buffers_signal_config", "", "", ""],
+ "mark_inactive" => ["mark_inactive", "boolean", "if option is \"on\", inactive buffers (those you are not in) will have parentesis around them. An inactive buffer will not be detached.", "", 0, 0, "off", "off", 0, "", "", "buffers_signal_config", "", "", ""],
+ "toggle_bar" => ["toogle_bar", "boolean", "if option is \"on\", buffers bar will hide/show when script is (un)loaded.", "", 0, 0, "on", "on", 0, "", "", "buffers_signal_config", "", "", ""],
+ "mouse_move_buffer" => ["mouse_move_buffer", "boolean", "if option is \"on\", mouse gestures (drag & drop) can move buffers in list.", "", 0, 0, "on", "on", 0, "", "", "buffers_signal_config", "", "", ""],
);
# section "color"
my $section_color = weechat::config_new_section($buffers_config_file,"color", 0, 0, "", "", "", "", "", "", "", "", "", "");
@@ -443,7 +492,8 @@ my %default_options_look =
$default_options_look{$option}[3],$default_options_look{$option}[4],$default_options_look{$option}[5],
$default_options_look{$option}[6],$default_options_look{$option}[7],$default_options_look{$option}[8],
$default_options_look{$option}[9],$default_options_look{$option}[10],$default_options_look{$option}[11],
- $default_options_look{$option}[12],$default_options_look{$option}[13],$default_options_look{$option}[14]);
+ $default_options_look{$option}[12],$default_options_look{$option}[13],$default_options_look{$option}[14],
+ $default_options_look{$option}[15]);
}
}
@@ -515,6 +565,7 @@ sub build_buffers
$buffer->{"number"} = $number;
$buffer->{"active"} = $active;
$buffer->{"current_buffer"} = weechat::infolist_integer($infolist, "current_buffer");
+ $buffer->{"num_displayed"} = weechat::infolist_integer($infolist, "num_displayed");
$buffer->{"plugin_name"} = weechat::infolist_string($infolist, "plugin_name");
$buffer->{"name"} = weechat::infolist_string($infolist, "name");
$buffer->{"short_name"} = weechat::infolist_string($infolist, "short_name");
@@ -540,6 +591,11 @@ sub build_buffers
}
my $result = check_immune_detached_buffers($buffer->{"name"}); # checking for wildcard
+
+ next if ( check_detach_buffer_immediately($buffer->{"name"}) eq 1
+ and $buffer->{"current_buffer"} eq 0
+ and ( not exists $hotlist{$buffer->{"pointer"}} or $hotlist{$buffer->{"pointer"}} < 2) ); # checking for buffer to immediately detach
+
unless ($result)
{
my $detach_time = weechat::config_integer( $options{"detach"});
@@ -593,6 +649,31 @@ sub build_buffers
push(@current1, $buffer);
}
}
+ elsif ( $buffer->{"current_buffer"} eq 0
+ and not exists $hotlist{$buffer->{"pointer"}}
+# and $buffer->{"type"} eq "channel"
+ and exists $buffers_timer{$buffer->{"pointer"}}
+ and $detach_time > 0
+ and $weechat_version >= 0x00030800
+ and $current_time - $buffers_timer{$buffer->{"pointer"}} >= $detach_time)
+ { # check for option detach_displayed_buffers and if buffer is displayed in a split window
+ if ( $buffer->{"num_displayed"} eq 1
+ and weechat::config_boolean($options{"detach_displayed_buffers"}) eq 0 )
+ {
+ my $infolist_window = weechat::infolist_get("window","","");
+ while (weechat::infolist_next($infolist_window))
+ {
+ my $buffer_ptr = weechat::infolist_pointer($infolist_window, "buffer");
+ if ($buffer_ptr eq $buffer->{"pointer"})
+ {
+ $buffer->{"window"} = weechat::infolist_integer($infolist_window, "number");
+ }
+ }
+ weechat::infolist_free($infolist_window);
+
+ push(@current2, $buffer);
+ }
+ }
}
else # buffer in "immune_detach_buffers"
{
@@ -780,6 +861,14 @@ sub build_buffers
$color_bg = weechat::color(",".$bg) if ($bg ne "");
# create channel number for output
+ if ( weechat::config_string( $options{"show_prefix_bufname"} ) ne "" )
+ {
+ $str .= $color_bg .
+ weechat::color( weechat::config_color( $options{"color_prefix_bufname"} ) ).
+ weechat::config_string( $options{"show_prefix_bufname"} ).
+ weechat::color("default");
+ }
+
if ( weechat::config_boolean( $options{"show_number"} ) eq 1 ) # on
{
if (( weechat::config_boolean( $options{"indenting_number"} ) eq 1)
@@ -831,6 +920,9 @@ sub build_buffers
}
}
}
+
+ $str .= weechat::config_string( $options{"show_prefix_query"}) if (weechat::config_string( $options{"show_prefix_query"} ) ne "" and $buffer->{"type"} eq "private");
+
if (weechat::config_boolean( $options{"show_prefix"} ) eq 1)
{
my $nickname = weechat::buffer_get_string($buffer->{"pointer"}, "localvar_nick");
@@ -841,8 +933,6 @@ sub build_buffers
my $infolist_nick = weechat::infolist_get("nicklist", $buffer->{"pointer"}, "nick_".$nickname);
if ($infolist_nick ne "")
{
- my $version = weechat::info_get("version_number", "");
- $version = 0 if ($version eq "");
while (weechat::infolist_next($infolist_nick))
{
if ((weechat::infolist_string($infolist_nick, "type") eq "nick")
@@ -852,7 +942,7 @@ sub build_buffers
if (($prefix ne " ") or (weechat::config_boolean( $options{"show_prefix_empty"} ) eq 1))
{
# with version >= 0.3.5, it is now a color name (for older versions: option name with color)
- if (int($version) >= 0x00030500)
+ if (int($weechat_version) >= 0x00030500)
{
$str .= weechat::color(weechat::infolist_string($infolist_nick, "prefix_color"));
}
@@ -889,8 +979,6 @@ sub build_buffers
}
else
{
- #$str .= weechat::buffer_get_string($buffer->{"pointer"},"localvar_server");
- #$str .= "/";
$str .= $buffer->{"short_name"};
$str .= add_inactive_parentless($buffer->{"type"},$buffer->{"nicks_count"});
$str .= add_hotlist_count($buffer->{"pointer"},%hotlist);
@@ -926,10 +1014,30 @@ sub build_buffers
$str .= weechat::color("default") . " (" . weechat::color($color_lag) . $lag . weechat::color("default") . ")";
}
}
+ if (weechat::config_boolean($options{"detach_displayed_buffers"}) eq 0
+ and weechat::config_boolean($options{"detach_display_window_number"}) eq 1)
+ {
+ if ($buffer->{"window"})
+ {
+ $str .= weechat::color("default") . " (" . weechat::color(weechat::config_color( $options{"color_number"})) . $buffer->{"window"} . weechat::color("default") . ")";
+ }
+ }
+ $str .= weechat::color("default");
+
+ if ( weechat::config_string( $options{"show_suffix_bufname"} ) ne "" )
+ {
+ $str .= weechat::color( weechat::config_color( $options{"color_suffix_bufname"} ) ).
+ weechat::config_string( $options{"show_suffix_bufname"} ).
+ weechat::color("default");
+ }
+
$str .= "\n";
$old_number = $buffer->{"number"};
}
+ # remove spaces and/or linefeed at the end
+ $str =~ s/\s+$//;
+ chomp($str);
return $str;
}
@@ -1025,7 +1133,8 @@ return $str;
sub buffers_signal_buffer
{
-my ($data, $signal, $signal_data) = @_;
+ my ($data, $signal, $signal_data) = @_;
+
# check for buffer_switch and set or remove detach time
if ($weechat_version >= 0x00030800)
{
@@ -1052,14 +1161,13 @@ my ($data, $signal, $signal_data) = @_;
delete $buffers_timer{$signal_data};
}
}
-
- weechat::bar_item_update("buffers");
+ weechat::bar_item_update($SCRIPT_NAME);
return weechat::WEECHAT_RC_OK;
}
sub buffers_signal_hotlist
{
- weechat::bar_item_update("buffers");
+ weechat::bar_item_update($SCRIPT_NAME);
return weechat::WEECHAT_RC_OK;
}
@@ -1068,20 +1176,29 @@ sub buffers_signal_config_whitelist
{
@whitelist_buffers = ();
@whitelist_buffers = split( /,/, weechat::config_string( $options{"look_whitelist_buffers"} ) );
- weechat::bar_item_update("buffers");
+ weechat::bar_item_update($SCRIPT_NAME);
return weechat::WEECHAT_RC_OK;
}
+
sub buffers_signal_config_immune_detach_buffers
{
@immune_detach_buffers = ();
@immune_detach_buffers = split( /,/, weechat::config_string( $options{"immune_detach_buffers"} ) );
- weechat::bar_item_update("buffers");
+ weechat::bar_item_update($SCRIPT_NAME);
+ return weechat::WEECHAT_RC_OK;
+}
+
+sub buffers_signal_config_detach_buffer_immediately
+{
+ @detach_buffer_immediately = ();
+ @detach_buffer_immediately = split( /,/, weechat::config_string( $options{"detach_buffer_immediately"} ) );
+ weechat::bar_item_update($SCRIPT_NAME);
return weechat::WEECHAT_RC_OK;
}
sub buffers_signal_config
{
- weechat::bar_item_update("buffers");
+ weechat::bar_item_update($SCRIPT_NAME);
return weechat::WEECHAT_RC_OK;
}
@@ -1092,7 +1209,7 @@ sub buffers_focus_buffers
my %info = %{$_[1]};
my $item_line = int($info{"_bar_item_line"});
undef my $hash;
- if (($info{"_bar_item_name"} eq "buffers") && ($item_line >= 0) && ($item_line <= $#buffers_focus))
+ if (($info{"_bar_item_name"} eq $SCRIPT_NAME) && ($item_line >= 0) && ($item_line <= $#buffers_focus))
{
$hash = $buffers_focus[$item_line];
}
@@ -1117,7 +1234,7 @@ sub buffers_hsignal_mouse
if ( $hash{"_key"} eq "button1" ) # left mouse button
{
- if ($hash{"number"} eq $hash{"number2"})
+ if ($hash{"number"} eq $hash{"number2"})
{
if ( weechat::config_integer($options{"jump_prev_next_visited_buffer"}) eq 1 )
{
@@ -1137,7 +1254,7 @@ sub buffers_hsignal_mouse
}
else
{
- move_buffer(%hash);
+ move_buffer(%hash) if (weechat::config_boolean($options{"mouse_move_buffer"}));
}
}
elsif ( ($hash{"_key"} eq "button2") && (weechat::config_integer($options{"jump_prev_next_visited_buffer"}) eq 1) )# right mouse button
@@ -1166,7 +1283,7 @@ sub buffers_hsignal_mouse
}
else
{
- move_buffer(%hash);
+ move_buffer(%hash) if (weechat::config_boolean($options{"mouse_move_buffer"}));
}
}
}
@@ -1179,8 +1296,20 @@ sub move_buffer
{
# if number 2 is not known (end of gesture outside buffers list), then set it
# according to mouse gesture
- $number2 = "999999";
- $number2 = "1" if (($hash{"_key"} =~ /gesture-left/) || ($hash{"_key"} =~ /gesture-up/));
+ $number2 = "1";
+ if (($hash{"_key"} =~ /gesture-right/) || ($hash{"_key"} =~ /gesture-down/))
+ {
+ $number2 = "999999";
+ if ($weechat_version >= 0x00030600)
+ {
+ my $hdata_buffer = weechat::hdata_get("buffer");
+ my $last_gui_buffer = weechat::hdata_get_list($hdata_buffer, "last_gui_buffer");
+ if ($last_gui_buffer)
+ {
+ $number2 = weechat::hdata_integer($hdata_buffer, $last_gui_buffer, "number") + 1;
+ }
+ }
+ }
}
my $ptrbuf = weechat::current_buffer();
weechat::command($hash{"pointer"}, "/buffer move ".$number2);
@@ -1198,3 +1327,43 @@ sub check_immune_detached_buffers
}
return 0;
}
+
+sub check_detach_buffer_immediately
+{
+ my ($buffername) = @_;
+ foreach ( @detach_buffer_immediately ){
+ my $detach_buffer = weechat::string_mask_to_regex($_);
+ if ($buffername =~ /^$detach_buffer$/i)
+ {
+ return 1;
+ }
+ }
+ return 0;
+}
+
+sub shutdown_cb
+{
+ weechat::command("","/bar hide " . $SCRIPT_NAME) if ( weechat::config_boolean($options{"toggle_bar"}) eq 1 );
+ return weechat::WEECHAT_RC_OK
+}
+
+sub check_bar_item
+{
+ my $item = 0;
+ my $infolist = weechat::infolist_get("bar", "", "");
+ while (weechat::infolist_next($infolist))
+ {
+ my $bar_items = weechat::infolist_string($infolist, "items");
+ if (index($bar_items,$SCRIPT_NAME) != -1)
+ {
+ my $name = weechat::infolist_string($infolist, "name");
+ if ($name ne $SCRIPT_NAME)
+ {
+ $item = 1;
+ last;
+ }
+ }
+ }
+ weechat::infolist_free($infolist);
+ return $item;
+}
diff --git a/weechat/perl/highmon.pl b/weechat/perl/highmon.pl
index b7e0aae..2aeb1de 100644
--- a/weechat/perl/highmon.pl
+++ b/weechat/perl/highmon.pl
@@ -1,6 +1,6 @@
#
# highmon.pl - Highlight Monitoring for weechat 0.3.0
-# Version 2.3.2
+# Version 2.4
#
# Add 'Highlight Monitor' buffer/bar to log all highlights in one spot
#
@@ -66,6 +66,14 @@
# Bugs and feature requests at: https://github.com/KenjiE20/highmon
# History:
+# 2013-12-04, KenjiE20 <longbow@longbowslair.co.uk>:
+# v2.4: -add: Support for eval style colour codes in time format used for bar output
+# 2013-10-22, KenjiE20 <longbow@longbowslair.co.uk>:
+# v2.3.3.2: -fix: Typo in fix command
+# 2013-10-10, KenjiE20 <longbow@longbowslair.co.uk>:
+# v2.3.3.1: -fix: Typo in closed buffer warning
+# 2013-10-07, KenjiE20 <longbow@longbowslair.co.uk>:
+# v2.3.3: -add: Warning and fixer for accidental buffer closes
# 2013-01-15, KenjiE20 <longbow@longbowslair.co.uk>:
# v2.3.2: -fix: Let bar output use the string set in weechat's config option
# -add: github info
@@ -302,6 +310,11 @@ sub highmon_buffer_input
sub highmon_buffer_close
{
$highmon_buffer = "";
+ # If user hasn't changed output style warn user
+ if (weechat::config_get_plugin("output") eq "buffer")
+ {
+ weechat::print("", "\tHighmon buffer has been closed but output is still set to buffer, unusual results may occur. To recreate the buffer use ".weechat::color("bold")."/highmon fix".weechat::color("-bold"));
+ }
return weechat::WEECHAT_RC_OK;
}
@@ -342,6 +355,14 @@ sub highmon_command_cb
{
highmon_config_clean($data, $buffer, $arg);
}
+ # Fix closed buffer
+ elsif ($cmd eq "fix")
+ {
+ if (weechat::config_get_plugin("output") eq "buffer" && $highmon_buffer eq "")
+ {
+ highmon_buffer_open();
+ }
+ }
return weechat::WEECHAT_RC_OK;
}
@@ -833,13 +854,14 @@ sub highmon_print
use POSIX qw(strftime);
$time = strftime(weechat::config_string(weechat::config_get("weechat.look.buffer_time_format")), localtime);
# Colourise
- if ($time =~ /\$\{\w+\}/) # Coloured string
+ if ($time =~ /\$\{(?:color:)?[\w,]+\}/) # Coloured string
{
- while ($time =~ /\$\{(\w+)\}/)
+ while ($time =~ /\$\{(?:color:)?([\w,]+)\}/)
{
$color = weechat::color($1);
- $time =~ s/\$\{\w+\}/$color/;
+ $time =~ s/\$\{(?:color:)?[\w,]+\}/$color/;
}
+ $time .= weechat::color("reset");
}
else # Default string
{
@@ -1049,7 +1071,7 @@ sub format_buffer_name
}
# Check result of register, and attempt to behave in a sane manner
-if (!weechat::register("highmon", "KenjiE20", "2.3.2", "GPL3", "Highlight Monitor", "", ""))
+if (!weechat::register("highmon", "KenjiE20", "2.4", "GPL3", "Highlight Monitor", "", ""))
{
# Double load
weechat::print ("", "\tHighmon is already loaded");
diff --git a/weechat/perl/iset.pl b/weechat/perl/iset.pl
index d27ec92..4b922ee 100644
--- a/weechat/perl/iset.pl
+++ b/weechat/perl/iset.pl
@@ -1,5 +1,5 @@
#
-# Copyright (C) 2008-2012 Sebastien Helleu <flashcode@flashtux.org>
+# Copyright (C) 2008-2013 Sebastien Helleu <flashcode@flashtux.org>
# Copyright (C) 2010-2012 Nils Görs <weechatter@arcor.de>
#
# This program is free software; you can redistribute it and/or modify
@@ -19,13 +19,24 @@
#
# History:
#
-# 2013-04-30, arza <arza@arza.us>:
+# 2014-01-30, stfn <stfnmd@gmail.com>:
+# version 3.4: add new options "color_value_diff" and "color_value_diff_selected"
+# 2014-01-16, luz <ne.tetewi@gmail.com>:
+# version 3.3: fix bug with column alignment in iset buffer when option
+# name contains unicode characters
+# 2013-08-03, Sebastien Helleu <flashcode@flashtux.org>:
+# version 3.2: allow "q" as input in iset buffer to close it
+# 2013-07-14, Sebastien Helleu <flashcode@flashtux.org>:
+# version 3.1: remove unneeded calls to iset_refresh() in mouse callback
+# (faster mouse actions when lot of options are displayed),
+# fix bug when clicking on a line after the last option displayed
+# 2013-04-30, arza <arza@arza.us>:
# version 3.0: simpler title, fix refresh on unset
-# 2012-12-16, nils_2 <weechatter@arcor.de>:
+# 2012-12-16, nils_2 <weechatter@arcor.de>:
# version 2.9: fix focus window with iset buffer on mouse click
-# 2012-08-25, nils_2 <weechatter@arcor.de>:
+# 2012-08-25, nils_2 <weechatter@arcor.de>:
# version 2.8: most important key and mouse bindings for iset buffer added to title-bar (idea The-Compiler)
-# 2012-07-31, nils_2 <weechatter@arcor.de>:
+# 2012-07-31, nils_2 <weechatter@arcor.de>:
# version 2.7: add combined option and value search (see /help iset)
# : add exact value search (see /help iset)
# : fix problem with metacharacter in value search
@@ -102,7 +113,7 @@
use strict;
my $PRGNAME = "iset";
-my $VERSION = "3.0";
+my $VERSION = "3.4";
my $DESCR = "Interactive Set for configuration options";
my $AUTHOR = "Sebastien Helleu <flashcode\@flashtux.org>";
my $LICENSE = "GPL3";
@@ -116,6 +127,7 @@ my @iset_focus = ();
my @options_names = ();
my @options_types = ();
my @options_values = ();
+my @options_default_values = ();
my @options_is_null = ();
my $option_max_length = 0;
my $current_line = 0;
@@ -211,6 +223,11 @@ sub iset_create_filter
sub iset_buffer_input
{
my ($data, $buffer, $string) = ($_[0], $_[1], $_[2]);
+ if ($string eq "q")
+ {
+ weechat::buffer_close($buffer);
+ return weechat::WEECHAT_RC_OK;
+ }
$search_value = "";
my @cmd_array = split(/ /,$string);
my $array_count = @cmd_array;
@@ -314,6 +331,7 @@ sub iset_get_options
@options_names = ();
@options_types = ();
@options_values = ();
+ @options_default_values = ();
@options_is_null = ();
$option_max_length = 0;
my %options_internal = ();
@@ -332,6 +350,7 @@ sub iset_get_options
next if (weechat::config_boolean($options_iset{"show_plugin_description"}) == 0 and index ($name, "plugins.desc.") != -1);
my $type = weechat::infolist_string($infolist, "type");
my $value = weechat::infolist_string($infolist, "value");
+ my $default_value = weechat::infolist_string($infolist, "default_value");
my $is_null = weechat::infolist_integer($infolist, "value_is_null");
if ($search_mode == 3)
{
@@ -340,6 +359,7 @@ sub iset_get_options
{
$options_internal{$name}{"type"} = $type;
$options_internal{$name}{"value"} = $value;
+ $options_internal{$name}{"default_value"} = $default_value;
$options_internal{$name}{"is_null"} = $is_null;
$option_max_length = length($name) if (length($name) > $option_max_length);
$iset_struct{$key} = $options_internal{$name};
@@ -350,6 +370,7 @@ sub iset_get_options
{
$options_internal{$name}{"type"} = $type;
$options_internal{$name}{"value"} = $value;
+ $options_internal{$name}{"default_value"} = $default_value;
$options_internal{$name}{"is_null"} = $is_null;
$option_max_length = length($name) if (length($name) > $option_max_length);
$iset_struct{$key} = $options_internal{$name};
@@ -364,6 +385,7 @@ sub iset_get_options
push(@options_names, $name);
push(@options_types, $options_internal{$name}{"type"});
push(@options_values, $options_internal{$name}{"value"});
+ push(@options_default_values, $options_internal{$name}{"default_value"});
push(@options_is_null, $options_internal{$name}{"is_null"});
}
}
@@ -388,6 +410,7 @@ sub iset_search_values
@options_names = ();
@options_types = ();
@options_values = ();
+ @options_default_values = ();
@options_is_null = ();
$option_max_length = 0;
my %options_internal = ();
@@ -400,12 +423,14 @@ sub iset_search_values
my $type = weechat::infolist_string($infolist, "type");
my $is_null = weechat::infolist_integer($infolist, "value_is_null");
my $value = weechat::infolist_string($infolist, "value");
+ my $default_value = weechat::infolist_string($infolist, "default_value");
if ($search_mode)
{
if ( grep /\Q$var_value/,lc($value) )
{
$options_internal{$name}{"type"} = $type;
$options_internal{$name}{"value"} = $value;
+ $options_internal{$name}{"default_value"} = $default_value;
$options_internal{$name}{"is_null"} = $is_null;
$option_max_length = length($name) if (length($name) > $option_max_length);
}
@@ -417,6 +442,7 @@ sub iset_search_values
{
$options_internal{$name}{"type"} = $type;
$options_internal{$name}{"value"} = $value;
+ $options_internal{$name}{"default_value"} = $default_value;
$options_internal{$name}{"is_null"} = $is_null;
$option_max_length = length($name) if (length($name) > $option_max_length);
}
@@ -429,6 +455,7 @@ sub iset_search_values
push(@options_names, $name);
push(@options_types, $options_internal{$name}{"type"});
push(@options_values, $options_internal{$name}{"value"});
+ push(@options_default_values, $options_internal{$name}{"default_value"});
push(@options_is_null, $options_internal{$name}{"is_null"});
}
}
@@ -441,7 +468,16 @@ sub iset_refresh_line
if ($y <= $#options_names)
{
return if (! defined($options_types[$y]));
- my $format = sprintf("%%s%%-%ds %%s %%-7s %%s %%s%%s%%s", $option_max_length);
+ my $format = sprintf("%%s%%s%%s %%s %%-7s %%s %%s%%s%%s");
+ my $padding;
+ if ($wee_version_number >= 0x00040200)
+ {
+ $padding = " " x ($option_max_length - weechat::strlen_screen($options_names[$y]));
+ }
+ else
+ {
+ $padding = " " x ($option_max_length - length($options_names[$y]));
+ }
my $around = "";
$around = "\"" if ((!$options_is_null[$y]) && ($options_types[$y] eq "string"));
@@ -452,6 +488,10 @@ sub iset_refresh_line
{
$color3 = weechat::color(weechat::config_color($options_iset{"color_value_undef"}));
}
+ elsif ($options_values[$y] ne $options_default_values[$y])
+ {
+ $color3 = weechat::color(weechat::config_color($options_iset{"color_value_diff"}));
+ }
else
{
$color3 = weechat::color(weechat::config_color($options_iset{"color_value"}));
@@ -464,6 +504,10 @@ sub iset_refresh_line
{
$color3 = weechat::color(weechat::config_color($options_iset{"color_value_undef_selected"}).",".weechat::config_color($options_iset{"color_bg_selected"}));
}
+ elsif ($options_values[$y] ne $options_default_values[$y])
+ {
+ $color3 = weechat::color(weechat::config_color($options_iset{"color_value_diff_selected"}).",".weechat::config_color($options_iset{"color_bg_selected"}));
+ }
else
{
$color3 = weechat::color(weechat::config_color($options_iset{"color_value_selected"}).",".weechat::config_color($options_iset{"color_bg_selected"}));
@@ -472,7 +516,7 @@ sub iset_refresh_line
my $value = $options_values[$y];
$value = "(undef)" if ($options_is_null[$y]);
my $strline = sprintf($format,
- $color1, $options_names[$y],
+ $color1, $options_names[$y], $padding,
$color2, $options_types[$y],
$color3, $around, $value, $around);
weechat::print_y($iset_buffer, $y, $strline);
@@ -537,14 +581,17 @@ sub iset_full_refresh
sub iset_set_current_line
{
my $new_current_line = $_[0];
- my $old_current_line = $current_line;
- $current_line = $new_current_line;
- $current_line = $#options_names if ($current_line > $#options_names);
- if ($old_current_line != $current_line)
+ if ($new_current_line >= 0)
{
- iset_refresh_line($old_current_line);
- iset_refresh_line($current_line);
- weechat::bar_item_update("isetbar_help") if (weechat::config_boolean($options_iset{"show_help_bar"}) == 1);
+ my $old_current_line = $current_line;
+ $current_line = $new_current_line;
+ $current_line = $#options_names if ($current_line > $#options_names);
+ if ($old_current_line != $current_line)
+ {
+ iset_refresh_line($old_current_line);
+ iset_refresh_line($current_line);
+ weechat::bar_item_update("isetbar_help") if (weechat::config_boolean($options_iset{"show_help_bar"}) == 1);
+ }
}
}
@@ -661,6 +708,7 @@ sub iset_config_cb
{
$options_types[$index] = weechat::infolist_string($infolist, "type");
$options_values[$index] = weechat::infolist_string($infolist, "value");
+ $options_default_values[$index] = weechat::infolist_string($infolist, "default_value");
$options_is_null[$index] = weechat::infolist_integer($infolist, "value_is_null");
iset_refresh_line($index);
iset_title() if ($option_name eq "iset.look.show_current_line");
@@ -1100,24 +1148,18 @@ sub iset_hsignal_mouse_cb
{
if ($hash{"_key"} eq "button1")
{
- $current_line = $hash{"_chat_line_y"};
- iset_refresh_line($current_line);
- iset_refresh();
+ iset_set_current_line($hash{"_chat_line_y"});
}
elsif ($hash{"_key"} eq "button2")
{
if ($options_types[$hash{"_chat_line_y"}] eq "boolean")
{
iset_set_option($options_names[$hash{"_chat_line_y"}], "toggle");
- $current_line = $hash{"_chat_line_y"};
- iset_refresh_line($current_line);
- iset_refresh();
+ iset_set_current_line($hash{"_chat_line_y"});
}
elsif ($options_types[$hash{"_chat_line_y"}] eq "string")
{
- $current_line = $hash{"_chat_line_y"};
- iset_refresh_line($current_line);
- iset_refresh();
+ iset_set_current_line($hash{"_chat_line_y"});
weechat::command("", "/$PRGNAME **set");
}
}
@@ -1125,20 +1167,16 @@ sub iset_hsignal_mouse_cb
{
if ($options_types[$hash{"_chat_line_y"}] eq "integer" or ($options_types[$hash{"_chat_line_y"}] eq "color"))
{
- $current_line = $hash{"_chat_line_y"};
- iset_refresh_line($current_line);
- iset_refresh();
+ iset_set_current_line($hash{"_chat_line_y"});
my $distance = distance($hash{"_chat_line_x"},$hash{"_chat_line_x2"});
weechat::command("", "/repeat $distance /$PRGNAME **decr");
}
}
elsif ($hash{"_key"} eq "button2-gesture-right" or $hash{"_key"} eq "button2-gesture-right-long")
{
- if ($options_types[$hash{"_chat_line_y"}] eq "integer" or ($options_types[$hash{"_chat_line_y"}] eq "color"))
+ if ($options_types[$hash{"_chat_line_y"}] eq "integer" or ($options_types[$hash{"_chat_line_y"}] eq "color"))
{
- $current_line = $hash{"_chat_line_y"};
- iset_refresh_line($current_line);
- iset_refresh();
+ iset_set_current_line($hash{"_chat_line_y"});
my $distance = distance($hash{"_chat_line_x"},$hash{"_chat_line_x2"});
weechat::command("", "/repeat $distance /$PRGNAME **incr");
}
@@ -1217,6 +1255,14 @@ sub iset_config_init
$iset_config_file, $section_color,
"value_selected", "color", "Color for selected option value", "", 0, 0,
"lightcyan", "lightcyan", 0, "", "", "full_refresh_cb", "", "", "");
+ $options_iset{"color_value_diff"} = weechat::config_new_option(
+ $iset_config_file, $section_color,
+ "value_diff", "color", "Color for option value different from default", "", 0, 0,
+ "magenta", "magenta", 0, "", "", "full_refresh_cb", "", "", "");
+ $options_iset{"color_value_diff_selected"} = weechat::config_new_option(
+ $iset_config_file, $section_color,
+ "value_diff_selected", "color", "Color for selected option value different from default", "", 0, 0,
+ "lightmagenta", "lightmagenta", 0, "", "", "full_refresh_cb", "", "", "");
$options_iset{"color_value_undef"} = weechat::config_new_option(
$iset_config_file, $section_color,
"value_undef", "color", "Color for option value undef", "", 0, 0,
diff --git a/weechat/perl/yaurls.pl b/weechat/perl/yaurls.pl
deleted file mode 100644
index caae3e2..0000000
--- a/weechat/perl/yaurls.pl
+++ /dev/null
@@ -1,301 +0,0 @@
-# Copyright (c) 2012 by R1cochet R1cochet@hushmail.com
-# All rights reserved
-#
-# 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 <http://www.gnu.org/licenses/>.
-#
-#
-# yaURLs, version 1.9, for weechat version 0.3.7 or later
-# will shorten URL's in channels
-#
-# Shorten URL's using any of the following services:
-# durl.me, is.gd, ln-s.net, lytn.it, metamark.net, sapo.pt, safe.mn, tinyURL.com
-#
-# Default color theme in 256color terminal
-# header: 46
-# prefix/suffix: *200
-# url: *190
-# domain: 196
-#
-#
-# Changelog:
-# 2012-09-21, R1cochet
-# version 1.9: Added more shortening services
-# 2012-03-09, Sebastien Helleu <flashcode@flashtux.org>
-# version 1.8: Fix reload of config file
-# 2012-03-08, R1cochet
-# version 1.7: Removed need for Regexp::Common and URI::Escape modules. Cleaned up some code
-# 2012-03-04, R1cochet
-# version 1.6: Fixed error with twitter links not being recognized. Added module URI::Escape to properly format URL's before shortening
-# 2012-02-28, R1cochet
-# version 1.5: Initial release
-
-use strict;
-use warnings;
-
-my $SCRIPT_NAME = "yaurls";
-my $SCRIPT_AUTHOR = "R1cochet";
-my $VERSION = "1.9";
-my $SCRIPT_LICENSE = "GPL3";
-my $SCRIPT_DESC = "yes, another URL shortener";
-
-# initialize global variables
-my $config_file; # config pointer
-my %config_section; # config section pointer
-my %config_options; # init config options
-my $incoming_nick = "";
-
-my %Unsafe = (RFC3986 => qr/[^A-Za-z0-9\-\._~]/,);
-my %escapes;
-for (0..255) {
- $escapes{chr($_)} = sprintf("%%%02X", $_);
-}
-
-weechat::register($SCRIPT_NAME, $SCRIPT_AUTHOR, $VERSION, $SCRIPT_LICENSE, $SCRIPT_DESC, "", "");
-
-### initial config
-sub init_config {
- $config_file = weechat::config_new("yaurls", "config_reload_cb", "");
- return if (!$config_file);
-
- # create new section in config file
- $config_section{'blacklists'} = weechat::config_new_section($config_file, "blacklists", 0, 0, "", "", "", "", "", "", "", "", "", "");
- if (!$config_section{'blacklists'}) {
- weechat::config_free($config_file);
- return;
- }
- # add the options to the section
- $config_options{'channel_blacklist'} = weechat::config_new_option($config_file, $config_section{'blacklists'}, "channel_blacklist", "string",
- "Comma seperated list of Channels to ignore", "", 0, 0, "", "", 1, "", "", "", "", "", "",);
- $config_options{'nick_blacklist'} = weechat::config_new_option($config_file, $config_section{'blacklists'}, "nick_blacklist", "string",
- "Comma seperated list of Nicks to ignore", "", 0, 0, "", "", 1, "", "", "", "", "", "",);
- $config_options{'server_blacklist'} = weechat::config_new_option($config_file, $config_section{'blacklists'}, "server_blacklist", "string",
- "Comma seperated list of Servers to ignore", "", 0, 0, "", "", 1, "", "", "", "", "", "",);
- $config_options{'string_blacklist'} = weechat::config_new_option($config_file, $config_section{'blacklists'}, "string_blacklist", "string",
- "Comma seperated list of Strings to ignore", "", 0, 0, "", "", 1, "", "", "", "", "", "",);
- $config_options{'url_blacklist'} = weechat::config_new_option($config_file, $config_section{'blacklists'}, "url_blacklist", "string",
- "Comma seperated list of URL's to ignore", "", 0, 0, "youtube.com", "youtube.com", 1, "", "", "", "", "", "",);
-
- $config_section{'colors'} = weechat::config_new_section($config_file, "colors", 0, 0, "", "", "", "", "", "", "", "", "", "");
- if (!$config_section{'colors'}) {
- weechat::config_free($config_file);
- return;
- }
- $config_options{'header_color'} = weechat::config_new_option($config_file, $config_section{'colors'}, "header_color", "color",
- "Set the color of the header", "", 0, 0, "green", "green", 0, "", "", "", "", "", "",);
- $config_options{'prefix_color'} = weechat::config_new_option($config_file, $config_section{'colors'}, "prefix_suffix_color", "color",
- "Set the color of the prefix and suffix", "", 0, 0, "magenta", "magenta", 0, "", "", "", "", "", "",);
- $config_options{'url_color'} = weechat::config_new_option($config_file, $config_section{'colors'}, "url_color", "color",
- "Set the color of the tinyURL link", "", 0, 0, "yellow", "yellow", 0, "", "", "", "", "", "",);
- $config_options{'domain_color'} = weechat::config_new_option($config_file, $config_section{'colors'}, "domain_color", "color",
- "Set the color of the domain name", "", 0, 0, "blue", "blue", 0, "", "", "", "", "", "",);
-
- $config_section{'engine'} = weechat::config_new_section($config_file, "engine", 0, 0, "", "", "", "", "", "", "", "", "", "");
- if (!$config_section{'engine'}) {
- weechat::config_free($config_file);
- return;
- }
- $config_options{'service'} = weechat::config_new_option($config_file, $config_section{'engine'}, "service", "integer",
- "Set which shortener service to use (durl = durl.me, is.gd = is.gd, ln-s = ln-s.net, lytn = lytn.it, ".
- "metamark = metamark.net, punyURL = sapo.pt, safe = safe.mn, tinyURL = tinyURL.com)",
- "durl|is.gd|ln-s|lytn|metamark|punyURL|safe|tinyURL", 0, 0, "tinyURL", "tinyURL", 0, "", "", "", "", "", "");
- $config_options{'convert_own'} = weechat::config_new_option($config_file, $config_section{'engine'}, "convert_own", "boolean",
- "Convert own links sent to buffer", "", 0, 0, "off", "off", 0, "", "", "", "", "", "",);
- $config_options{'maximum_length'} = weechat::config_new_option($config_file, $config_section{'engine'}, "maximum_length", "integer",
- "Set the maximum length of URL's to be converted (anything equal to or larger will be converted)", "", 20, 500, "35", "35", 0, "", "", "", "", "", "");
- $config_options{'timeout'} = weechat::config_new_option($config_file, $config_section{'engine'}, "timeout", "integer",
- "Set the maximum time limit for fetching the short URL (time in seconds)", "", 10, 120, "20", "20", 0, "", "", "", "", "", "");
-
- $config_section{'look'} = weechat::config_new_section($config_file, "look", 0, 0, "", "", "", "", "", "", "", "", "", "");
- if (!$config_section{'look'}) {
- weechat::config_free($config_file);
- return;
- }
- $config_options{'header'} = weechat::config_new_option($config_file, $config_section{'look'}, "header", "string",
- "Set the header string", "", 0, 0, "yaURLs", "yaURLs", 1, "", "", "", "", "", "",);
- $config_options{'header_prefix'} = weechat::config_new_option($config_file, $config_section{'look'}, "header_prefix", "string",
- "Set the header prefix", "", 0, 0, "{", "{", 1, "", "", "", "", "", "",);
- $config_options{'header_suffix'} = weechat::config_new_option($config_file, $config_section{'look'}, "header_suffix", "string",
- "Set the header suffix", "", 0, 0, "}~>", "}~>", 1, "", "", "", "", "", "",);
- $config_options{'format'} = weechat::config_new_option($config_file, $config_section{'look'}, "format", "string",
- "Set the print format (%H = Header, %U = tinyURL, %D = Domain)", "", 0, 0, "%H %U %D", "%H %U %D", 0, "", "", "", "", "", "",);
-}
-# intit callbacks
-sub config_reload_cb { # reload config file
- return weechat::config_reload($config_file);
-}
-
-sub config_read { # read my config file
- return weechat::config_read($config_file);
-}
-
-sub config_write { # write to my config file
- return weechat::config_write($config_file);
-}
-
-init_config(); # load config
-config_read(); # get options if already in config file
-
-weechat::hook_print( "", "irc_privmsg", "://", 1, "print_hook_cb", ""); # Hook into print
-
-sub build_header {
- my $header = weechat::color(weechat::config_color($config_options{'header_color'})) . weechat::config_string($config_options{'header'}) . weechat::color("reset");
- $header = weechat::color(weechat::config_color($config_options{'prefix_color'})) . weechat::config_string($config_options{'header_prefix'}) . weechat::color("reset") . $header;
- $header = $header . weechat::color(weechat::config_color($config_options{'prefix_color'})) . weechat::config_string($config_options{'header_suffix'}) . weechat::color("reset");
- return $header;
-}
-
-sub black_list1 { # match url, string
- my ($string, $black_list) = @_;
- my @black_list = split ",", $black_list;
- foreach(@black_list) {
- return 1 if $string =~ /\Q$_\E/i;
- }
- return 0;
-}
-
-sub black_list2 { # match nick, server, channel; front to end
- my ($string, $black_list) = @_;
- my @black_list = split ",", $black_list;
- foreach(@black_list) {
- return 1 if $string =~ /^\Q$_\E\z/;
- }
- return 0;
-}
-
-sub uri_escape {
- my $url = shift;
- utf8::encode($url);
- $url =~ s/($Unsafe{RFC3986})/$escapes{$1}/ge;
- return $url;
-}
-
-sub service_url {
- my $url = shift;
- $url = uri_escape($url);
-
- if (weechat::config_string($config_options{'service'}) eq "durl") {
- $url = "http://durl.me/api/Create.do?longurl=$url";
- }
- elsif (weechat::config_string($config_options{'service'}) eq "is.gd") {
- $url = "http://is.gd/create.php?format=simple&url=$url";
- }
- elsif (weechat::config_string($config_options{'service'}) eq "ln-s") {
- $url = "http://ln-s.net/home/api.jsp?url=$url";
- }
- elsif (weechat::config_string($config_options{'service'}) eq "lytn") {
- $url = "http://lytn.it/api.php?rel=2&link=$url";
- }
- elsif (weechat::config_string($config_options{'service'}) eq "metamark") {
- $url = "http://metamark.net/api/rest/simple?long_url=$url";
- }
- elsif (weechat::config_string($config_options{'service'}) eq "punyURL") {
- $url = "http://services.sapo.pt/PunyURL/GetCompressedURLByURL?url=$url";
- }
- elsif (weechat::config_string($config_options{'service'}) eq "safe") {
- $url = "http://safe.mn/api/?format=text&url=$url";
- }
- else {
- $url = "http://tinyurl.com/api-create.php?url=$url";
- }
-
- return $url;
-}
-
-sub process_cb {
- my ($buffer_domain, $command, $return_code, $out, $err) = @_;
-
- if ($return_code != 0) { # weechat::WEECHAT_HOOK_PROCESS_ERROR
- weechat::print("", "Error with command: $command");
- weechat::print("", "An error occured: $err") if ($err ne "");
- weechat::print("", "ret code: $return_code");
- }
- elsif ($out) {
- my ($buffer, $domain) = split "_:_", $buffer_domain, 2;
- my $header = build_header();
- $domain = weechat::color(weechat::config_color($config_options{'domain_color'})) . "($domain)" . weechat::color("reset");
-
- if (weechat::config_string($config_options{'service'}) eq "durl") {
- ($out) = $out =~ m/(http:\/\/durl\.me\/\w+)/;
- }
- elsif (weechat::config_string($config_options{'service'}) eq "ln-s") {
- $out =~ s/^(\d{3}\s)|\n*$//g;
- }
- elsif (weechat::config_string($config_options{'service'}) eq "punyURL") {
- weechat::print("", "punyURL called");
- ($out) = $out =~ m/.+\<ascii\>(.+)\<\/ascii\>/;
- }
- elsif (weechat::config_string($config_options{'service'}) eq "safe") {
- $out =~ s/\n*//g;
- }
-
- my $short_url = weechat::color(weechat::config_color($config_options{'url_color'})) . $out . weechat::color("reset");
- my $tiny_url = weechat::config_string($config_options{'format'});
-
- $tiny_url =~ s/%H/$header/;
- $tiny_url =~ s/%U/$short_url/;
- $tiny_url =~ s/%D/$domain/;
- weechat::print($buffer, "$tiny_url");
- }
- return weechat::WEECHAT_RC_OK;
-}
-
-sub print_hook_cb {
- my ($data, $buffer, $date, $tags, $displayed, $highlight, $prefix, $msg) = @_;
- return weechat::WEECHAT_RC_OK if ($displayed != 1); # return if initial message wont be shown
-
- if ((weechat::config_string($config_options{'string_blacklist'})) ne "") { # check message against "string blacklist"
- return weechat::WEECHAT_RC_OK if (black_list1($msg, weechat::config_string($config_options{'string_blacklist'}))); # return if string is blacklisted
- }
-
- my $hdata = weechat::hdata_get("buffer");
- my $buffer_name = weechat::hdata_string($hdata, $buffer, "name");
- my ($server, $channel) = split /\./, $buffer_name; # can be done with a match
- $channel =~ s/#//;
-
- if ((weechat::config_string($config_options{'server_blacklist'})) ne "") { # check message against "server blacklist"
- return weechat::WEECHAT_RC_OK if (black_list2($server, weechat::config_string($config_options{'server_blacklist'}))); # return if server is blacklisted
- }
-
- if ((weechat::config_string($config_options{'channel_blacklist'})) ne "") { # check message against "channel blacklist"
- return weechat::WEECHAT_RC_OK if (black_list2($channel, weechat::config_string($config_options{'channel_blacklist'}))); # return if nick is blacklisted
- }
-
- ($incoming_nick = $tags) =~ s/.*nick_//i;
- $incoming_nick =~ s/,.*//i;
- my $own_nick = weechat::info_get("irc_nick", $server);
-
- if (!weechat::config_boolean($config_options{'convert_own'})) { # check if converting own
- return weechat::WEECHAT_RC_OK if $incoming_nick =~ /^\Q$own_nick\E\z/;
- }
-
- if ((weechat::config_string($config_options{'nick_blacklist'})) ne "") { # check message against "nick blacklist"
- return weechat::WEECHAT_RC_OK if (black_list2($incoming_nick, weechat::config_string($config_options{'nick_blacklist'}))); # return if nick is blacklisted
- }
-
- my @msg = split " ", $msg;
- foreach(@msg) {
- if ($_ =~ /^(ht|f)tp/ && $_ =~ m|(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?|) {
- next if (length($_) <= weechat::config_integer($config_options{'maximum_length'})); # skip if url shorter than max
-
- if (weechat::config_string($config_options{'url_blacklist'}) ne "") {
- next if (black_list1($_, weechat::config_string($config_options{'url_blacklist'}))); # skip if url is blacklisted
- }
- my $buffer_domain = $buffer."_:_$2";
- my $url = service_url($_);
-
- weechat::hook_process("url:$url", weechat::config_integer($config_options{'timeout'}) * 1000, "process_cb", $buffer_domain);
- }
- }
- return weechat::WEECHAT_RC_OK;
-}
diff --git a/weechat/plugins.conf b/weechat/plugins.conf
new file mode 100644
index 0000000..70d1628
--- /dev/null
+++ b/weechat/plugins.conf
@@ -0,0 +1,319 @@
+#
+# plugins.conf -- weechat v0.4.4-dev
+#
+
+[var]
+fifo.fifo = "on"
+guile.check_license = "off"
+lua.check_license = "on"
+perl.buddylist.buddy.on.server = "on"
+perl.buddylist.buddy.on.server.color = "green"
+perl.buddylist.buddylist = "/home/kyrias/.weechat/buddylist.txt"
+perl.buddylist.callback.timeout = "60"
+perl.buddylist.check.buddies = "20"
+perl.buddylist.color.away = "cyan"
+perl.buddylist.color.default = "default"
+perl.buddylist.color.number = "lightmagenta"
+perl.buddylist.color.offline = "magenta"
+perl.buddylist.color.online = "cyan"
+perl.buddylist.color.server = "lightyellow"
+perl.buddylist.color.server.offline = "lightred"
+perl.buddylist.display.original.nick = "off"
+perl.buddylist.display.social.net = "on"
+perl.buddylist.display.social.net.color = "yellow"
+perl.buddylist.hide.bar = "off"
+perl.buddylist.hide.buddy.if.offline = "off"
+perl.buddylist.hide.server.if.buddies.offline = "off"
+perl.buddylist.hide.servername.in.buddylist = "off"
+perl.buddylist.show.query = "on"
+perl.buddylist.sort = "default"
+perl.buddylist.text.away = ""
+perl.buddylist.text.color = "white"
+perl.buddylist.text.offline = ""
+perl.buddylist.text.online = ""
+perl.buddylist.use.redirection = "on"
+perl.check_license = "on"
+perl.highmon.alignment = "channel,nick"
+perl.highmon.away_only = "off"
+perl.highmon.bar_lines = "3"
+perl.highmon.bar_scrolldown = "off"
+perl.highmon.color_buf = "on"
+perl.highmon.hotlist_show = "off"
+perl.highmon.logging = "off"
+perl.highmon.merge_private = ""
+perl.highmon.nick_prefix = "<"
+perl.highmon.nick_suffix = ">"
+perl.highmon.output = "bar"
+perl.highmon.short_names = "on"
+perl.isgd.auto = "on"
+perl.isgd.auto_min_length = "40"
+perl.isgd.color = "white"
+perl.listsort.max_size = "100"
+perl.mplex.away_msg = "Detached head"
+perl.mplex.change_away_stat = "on"
+perl.mplex.emit_signals = "off"
+perl.mplex.exec_script_cmds = "off"
+perl.mplex.interval = "60"
+perl.mplex.verbose = "on"
+perl.multiline.char = "↩"
+perl.multiline.hide_magic_nl = "on"
+perl.multiline.ipl = "on"
+perl.multiline.lead_linebreak = "on"
+perl.multiline.magic = "‼"
+perl.multiline.magic_enter_time = "1000"
+perl.multiline.magic_paste_only = "off"
+perl.multiline.modify_keys = "on"
+perl.multiline.paste_lock = "1"
+perl.multiline.send_empty = "on"
+perl.multiline.tab = "──▶▏"
+perl.multiline.weechat_paste_fix = "on"
+perl.notify_send.command = "notify-send $type: $name"
+perl.notify_send.ignore_nicks = ""
+perl.notify_send.wait_highlight = "60"
+perl.notify_send.wait_pm = "180"
+perl.stalker.additional_join_info = "off"
+perl.stalker.db_name = "%h/nicks.db"
+perl.stalker.debug = "off"
+perl.stalker.flood_max_nicks = "20"
+perl.stalker.flood_timer = "10"
+perl.stalker.guest_host_regex = "^webchat"
+perl.stalker.guest_nick_regex = "^(guest|weebot|Floodbot|ChanServ).*"
+perl.stalker.ignore_guest_hosts = "off"
+perl.stalker.ignore_guest_nicks = "on"
+perl.stalker.ignore_nickchange = "off"
+perl.stalker.ignore_whois = "off"
+perl.stalker.max_recursion = "20"
+perl.stalker.normalize_nicks = "on"
+perl.stalker.recursive_search = "on"
+perl.stalker.search_this_network_only = "on"
+perl.stalker.tags = ""
+perl.stalker.timeout = "1"
+perl.stalker.use_localvar = "off"
+perl.url_arza.min_length = "100"
+perl.url_arza.url = "http://arza.us/s/?password=&url="
+perl.url_arza.url_append_command = "&id_min_length=1"
+perl.url_arza.url_append_incoming = "&id_min_length=2"
+python.announce_url_title.announce_public = "off"
+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"
+python.announce_url_title.prefix = ""
+python.announce_url_title.reannounce_wait = "5"
+python.announce_url_title.suffix = ""
+python.announce_url_title.title_max_length = "80"
+python.announce_url_title.url_ignore = ""
+python.announce_url_title.user_agent = "WeeChat/%(version)s (http://www.weechat.org)"
+python.anotify.icon = "/usr/share/pixmaps/weechat.xpm"
+python.anotify.show_channel_topic = "on"
+python.anotify.show_dcc = "on"
+python.anotify.show_highlighted_message = "on"
+python.anotify.show_invite_message = "on"
+python.anotify.show_notice_message = "off"
+python.anotify.show_private_action_message = "on"
+python.anotify.show_private_message = "on"
+python.anotify.show_public_action_message = "off"
+python.anotify.show_public_message = "off"
+python.anotify.show_server = "on"
+python.anotify.show_upgrade_ended = "on"
+python.anotify.sticky = "off"
+python.anotify.sticky_away = "on"
+python.chanop.autodeop = "on"
+python.chanop.autodeop_delay = "60"
+python.chanop.default_banmask = "host"
+python.chanop.display_affected = "on"
+python.chanop.enable_bar = "on"
+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.foonetic = "#0"
+python.chanop.watchlist.freenode = "#kyriasis,##archlinux-botabuse,#archlinux,#archlinux-offtopic"
+python.check_license = "on"
+python.colorize_nicks.blacklist_channels = ""
+python.colorize_nicks.blacklist_nicks = "so,root"
+python.colorize_nicks.colorize_input = "on"
+python.colorize_nicks.greedy_matching = "on"
+python.colorize_nicks.ignore_tags = ""
+python.colorize_nicks.min_nick_length = "2"
+python.copy.autodeop = "on"
+python.copy.autodeop_delay = "180"
+python.copy.default_banmask = "host"
+python.copy.display_affected = "on"
+python.copy.enable_bar = "on"
+python.copy.enable_multi_kick = "off"
+python.copy.enable_remove = "off"
+python.copy.kick_reason = ""
+python.copy.op_command = "/msg chanserv op $channel $nick"
+python.copy.watchlist.freenode = "#kyriasis"
+python.listbuffer.autofocus = "on"
+python.listbuffer.channel_min_width = "25"
+python.listbuffer.modes_min_width = "8"
+python.listbuffer.sort_inverted = "on"
+python.listbuffer.sort_order = "users"
+python.listbuffer.users_min_width = "8"
+python.lnotify.show_highlight = "on"
+python.lnotify.show_icon = "weechat"
+python.lnotify.show_priv_msg = "on"
+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.urlserver.buffer_short_name = "off"
+python.urlserver.color = "darkgray"
+python.urlserver.color_in_msg = ""
+python.urlserver.debug = "off"
+python.urlserver.display_urls = "on"
+python.urlserver.display_urls_in_msg = "off"
+python.urlserver.http_allowed_ips = ""
+python.urlserver.http_auth = ""
+python.urlserver.http_autostart = "on"
+python.urlserver.http_bg_color = "#f4f4f4"
+python.urlserver.http_css_url = ""
+python.urlserver.http_embed_image = "off"
+python.urlserver.http_embed_youtube = "off"
+python.urlserver.http_embed_youtube_size = "480*350"
+python.urlserver.http_fg_color = "#000"
+python.urlserver.http_hostname = ""
+python.urlserver.http_hostname_display = ""
+python.urlserver.http_port = ""
+python.urlserver.http_port_display = ""
+python.urlserver.http_prefix_suffix = " "
+python.urlserver.http_scheme_display = "http"
+python.urlserver.http_time_format = "%d/%m/%y %H:%M:%S"
+python.urlserver.http_title = "WeeChat URLs"
+python.urlserver.http_url_prefix = ""
+python.urlserver.msg_ignore_buffers = "core.weechat,python.grep"
+python.urlserver.msg_ignore_dup_urls = "off"
+python.urlserver.msg_ignore_regex = ""
+python.urlserver.msg_ignore_tags = "irc_quit,irc_part,notify_none"
+python.urlserver.msg_require_tags = "nick_"
+python.urlserver.separators = "[|]"
+python.urlserver.url_min_length = "0"
+python.urlserver.urls_amount = "100"
+python.whois_on_query.command = "/whois $nick $nick"
+python.whois_on_query.self_query = "off"
+ruby.check_license = "on"
+tcl.check_license = "on"
+tcl.xosdnotify.align = "left bottom"
+tcl.xosdnotify.blink = "on"
+tcl.xosdnotify.blink_count = "4"
+tcl.xosdnotify.blink_interval = "700"
+tcl.xosdnotify.color = "#ffff00"
+tcl.xosdnotify.encoding = "utf-8"
+tcl.xosdnotify.font = "-*-fixed-*-*-*-*-*-200-*-*-*-*-*-*"
+tcl.xosdnotify.lines = "1"
+tcl.xosdnotify.offset = "16 16"
+
+[desc]
+perl.buddylist.buddy.on.server = "show buddy who is connected to a server, but not visiting the same channel(s) (default: on)"
+perl.buddylist.buddy.on.server.color = "color for online buddy but not visiting the same channel(s) (default: lightgreen)"
+perl.buddylist.buddylist = "path/file-name to store your buddies"
+perl.buddylist.callback.timeout = "time in seconds to wait for answer from server. (default: 60)"
+perl.buddylist.check.buddies = "time in seconds to send a /whois request to server. Be careful not to flood server (default: 20)"
+perl.buddylist.color.away = "color for away buddies"
+perl.buddylist.color.default = "fall back color. (default: standard weechat color)"
+perl.buddylist.color.number = "color for channel number (default: lightred). If empty, channel list option is off"
+perl.buddylist.color.offline = "color for offline buddies"
+perl.buddylist.color.online = "color for online buddies"
+perl.buddylist.color.server = "color for servername"
+perl.buddylist.color.server.offline = "color for disconnected server (default: hide)"
+perl.buddylist.display.original.nick = "display original nickname even if buddy changed his /nick (you have to add new nick to buddylist (default: off)"
+perl.buddylist.display.social.net = "using bitlbee, buddies will be sorted in sublists with social-network name (eg. msn/jabber/facebook)(default: on)"
+perl.buddylist.display.social.net.color = "color for social-network name (default: yellow)"
+perl.buddylist.hide.bar = "hides buddylist bar when all servers with added buddies are offline (on = default, always = buddylist bar will be hidden (for example if you want to add item 'buddylist' to 'weechat.bar.status.items', off = buddylist bar will not be hidden))"
+perl.buddylist.hide.buddy.if.offline = "hide buddy if offline (default: off)"
+perl.buddylist.hide.server.if.buddies.offline = "hides server when all buddies are offline for this server (default: off)"
+perl.buddylist.hide.servername.in.buddylist = "hide the servername in buddylist. If "on" only nicks will be displayed in buddylist (default: off)"
+perl.buddylist.show.query = "displays a query buffer in front of the channel list"
+perl.buddylist.sort = "sort method for buddylist (default = buddylist will be sort by nickname, status = buddylist will be sort by status (online, away, offline))"
+perl.buddylist.text.away = "optional away text in buddylist (sort method has to be 'status')"
+perl.buddylist.text.color = "color for optional online/away/offline-text in buddylist (default: white)"
+perl.buddylist.text.offline = "optional offline text in buddylist (sort method has to be 'status')"
+perl.buddylist.text.online = "optional online text in buddylist (sort method has to be 'status')"
+perl.buddylist.use.redirection = "using redirection to get status of buddies (needs weechat >=0.3.4) (default: on)"
+perl.isgd.auto = "Shorten all incoming URLs automatically (default: "off")"
+perl.isgd.auto_min_length = "Only shorten incoming URLs automatically which have this minimum length (default: "1")"
+perl.isgd.color = "Color used for printing shortened URLs (default: "white")"
+perl.listsort.max_size = "maximum size of /list output in kilobytes to be handled"
+perl.multiline.char = "character(s) which should be displayed to indicate end of line"
+perl.multiline.hide_magic_nl = "whether the new line inserted by magic enter key will be hidden"
+perl.multiline.ipl = "this setting controls override of ctrl-M (enter key) by script. Turn it off if you don't want multiline.pl to set and re-set the key binding."
+perl.multiline.lead_linebreak = "if turned on, multi-line messages always start on a new line"
+perl.multiline.magic = "indicator displayed when message will be sent soon"
+perl.multiline.magic_enter_time = "delay after pressing enter before sending automatically (in ms), or 0 to disable"
+perl.multiline.magic_paste_only = "only use multi-line messages for multi-line pastes (multi-line on enter is disabled by this)"
+perl.multiline.modify_keys = "if turned on, cursor keys are modified so that they respect line boundaries instead of treating the whole multi-line message as a single line"
+perl.multiline.paste_lock = "time-out to detect pastes (disable the weechat built-in paste detection if you want to use this)"
+perl.multiline.send_empty = "set to on to automatically disregard enter key on empty line"
+perl.multiline.tab = "character(s) which should be displayed instead of Tab key character"
+perl.multiline.weechat_paste_fix = "disable ctrl-J binding when paste is detected to stop silly weechat sending out pastes without allowing to edit them"
+perl.notify_send.command = "system command to be executed ($type, $name, and $message will be interpreted as values) (default: "notify-send $type: $name")"
+perl.notify_send.ignore_nicks = "comma-separated list of nicks to ignore (default: "")"
+perl.notify_send.wait_highlight = "necessary time delay between highlights (seconds) for command to be executed (default: "60")"
+perl.notify_send.wait_pm = "necessary time delay between private messages (seconds) for command to be executed (default: "180")"
+perl.stalker.additional_join_info = "add a line below the JOIN message that will display alternative nicks (tags: "irc_join", "irc_smart_filter" will be add to additional_join_info). You can use a localvar to drop additional join info for specific buffer(s) "stalker_drop_additional_join_info" (default: off)"
+perl.stalker.db_name = "file containing the SQLite database where information is recorded. This database is created on loading of stalker if it does not exist. ("%h" will be replaced by WeeChat home, "~/.weechat" by default) (default: %h/nicks.db)"
+perl.stalker.debug = "Prints debug output to core buffer so you know exactly what is going on. This is far too verbose to be enabled when not actively debugging something. (default: off)"
+perl.stalker.flood_max_nicks = "Maximum number of joins to allow in flood_timer length of time. Once maximum number of joins is reached, joins will be ignored until the timer ends (default:20)"
+perl.stalker.flood_timer = "Time in seconds for which flood protection is active. Once max_nicks is reached, joins will be ignored for the remaining duration of the timer. (default:10)"
+perl.stalker.guest_host_regex = "regex mask to ignore host masks"
+perl.stalker.guest_nick_regex = "Some networks set default nicknames when a user fails to identify to nickserv, other networks using relay-bots, some irc clients set default nicknames when someone connects and often these change from network to network depending on who is configuring the java irc clients. This allows a regular expression to be entered. When a nickname matches the regular expression and "ignore_guest_nicks" is enabled the nickname is dropped from the search as if it had never been seen. (default: ^(guest|weebot|Floodbot).*)"
+perl.stalker.ignore_guest_hosts = "See option guest_host_regex"
+perl.stalker.ignore_guest_nicks = "See option guest_nick_regex"
+perl.stalker.ignore_nickchange = "When enabled, /NICK changes won't be monitored. (default: off)"
+perl.stalker.ignore_whois = "When enabled, /WHOIS won't be monitored. (default: off)"
+perl.stalker.max_recursion = "For each correlation between nick <-> host that happens, one point of recursion happens. A corrupt database, general evilness, or misfortune can cause the recursion to skyrocket. This is a ceiling number that says if after this many correlation attempts we have not found all nickname and hostname correlations, stop the process and return the list to this point. Use this option with care on slower machines like raspberry pi."
+perl.stalker.normalize_nicks = "this option will truncate special chars from username (like: ~) (default: on)"
+perl.stalker.recursive_search = "When enabled, recursive search causes stalker to function better than a simple hostname to nickname map. Disabling the recursive search in effect turns stalker into a more standard hostname -> nickname map."
+perl.stalker.search_this_network_only = "When enabled searches are limited to within the network the window is currently set on. Turning this off is really only useful if multiple networks don't encode the hostmask. (default: on)"
+perl.stalker.tags = "comma separated list of tags used for messages printed by stalker. See documentation for possible tags (e.g. 'no_log', 'no_highlight'). This option does not effect DEBUG messages."
+perl.stalker.timeout = "timeout in seconds for hook_process(), used with option "additional_join_info". On slower machines, like raspberry pi, increase time. (default: 1)"
+perl.stalker.use_localvar = "When enabled, only channels with a localvar 'stalker' will be monitored. This option will not affect /NICK and /WHOIS monitoring. It's only for /JOIN messages. (default: off)"
+perl.url_arza.min_length = "minimum length for incoming urls to shorten, after http:// (default: 100)"
+perl.url_arza.url = "url for shortener, url to shorten is appended, the shortener should return the short url (default: http://arza.us/s/?password=&url=)"
+perl.url_arza.url_append_command = "string to append to the url when shortening in input line (default: &id_min_length=1)"
+perl.url_arza.url_append_incoming = "string to append to the url when shortening incoming urls (default: &id_min_length=2)"
+python.listbuffer.autofocus = "Focus the listbuffer in the current window if it isn't already displayed by a window."
+python.listbuffer.channel_min_width = "The minimum width used for the channel name in the channel list. If a channelname is shorter than this amount, the column will be padded with spaces."
+python.listbuffer.modes_min_width = "The minimum width used for modes in the channel list. If a channel has less modes than this amount, the column will be padded with spaces."
+python.listbuffer.sort_inverted = "Invert the sort order for the channel list."
+python.listbuffer.sort_order = "Last used sort order for the channel list."
+python.listbuffer.users_min_width = "The minimum width used for the usercount in the channel list. If the usercount has less digits than this amount, the column will be padded with spaces."
+python.urlserver.buffer_short_name = "use buffer short name on dedicated buffer (default: "off")"
+python.urlserver.color = "color for urls displayed after message (default: "darkgray")"
+python.urlserver.color_in_msg = "color for urls displayed inside irc message: it is a number (irc color) between 00 and 15 (see doc for a list of irc colors) (default: "")"
+python.urlserver.debug = "print some debug messages (default: "off")"
+python.urlserver.display_urls = "display URLs below messages (default: "on")"
+python.urlserver.display_urls_in_msg = "add shorten url next to the original url (only in IRC messages) (useful for urlserver behind relay/irc) (default: "off")"
+python.urlserver.http_allowed_ips = "regex for IPs allowed to use server (example: "^(123.45.67.89|192.160.*)$") (default: "")"
+python.urlserver.http_auth = "login and password (format: "login:password") required to access to page with list of URLs (default: "")"
+python.urlserver.http_autostart = "start the built-in HTTP server automatically) (default: "on")"
+python.urlserver.http_bg_color = "background color for HTML page (default: "#f4f4f4")"
+python.urlserver.http_css_url = "URL of external Cascading Style Sheet to add (BE CAREFUL: the HTTP referer will be sent to site hosting CSS file!) (empty value = use default embedded CSS) (default: "")"
+python.urlserver.http_embed_image = "embed images in HTML page (BE CAREFUL: the HTTP referer will be sent to site hosting image!) (default: "off")"
+python.urlserver.http_embed_youtube = "embed youtube videos in HTML page (BE CAREFUL: the HTTP referer will be sent to youtube!) (default: "off")"
+python.urlserver.http_embed_youtube_size = "size for embedded youtube video, format is "xxx*yyy" (default: "480*350")"
+python.urlserver.http_fg_color = "foreground color for HTML page (default: "#000")"
+python.urlserver.http_hostname = "force hostname/IP in bind of socket (empty value = auto-detect current hostname) (default: "")"
+python.urlserver.http_hostname_display = "display this hostname in shortened URLs (default: "")"
+python.urlserver.http_port = "force port for listening (empty value = find a random free port) (default: "")"
+python.urlserver.http_port_display = "display this port in shortened URLs. Useful if you forward a different external port to the internal port (default: "")"
+python.urlserver.http_prefix_suffix = "suffix displayed between prefix and message in HTML page (default: " ")"
+python.urlserver.http_scheme_display = "display this scheme in shortened URLs (default: "http")"
+python.urlserver.http_time_format = "time format in the HTML page (default: "%d/%m/%y %H:%M:%S")"
+python.urlserver.http_title = "title of the HTML page (default: "WeeChat URLs")"
+python.urlserver.http_url_prefix = "prefix to add in URLs to prevent external people to scan your URLs (for example: prefix "xx" will give URL: http://host.com:1234/xx/8) (default: "")"
+python.urlserver.msg_ignore_buffers = "comma-separated list (without spaces) of buffers to ignore (full name like "irc.freenode.#weechat") (default: "core.weechat,python.grep")"
+python.urlserver.msg_ignore_dup_urls = "ignore duplicated URLs (do not add an URL in list if it is already) (default: "off")"
+python.urlserver.msg_ignore_regex = "ignore messages matching this regex (default: "")"
+python.urlserver.msg_ignore_tags = "comma-separated list (without spaces) of tags (or beginning of tags) to ignore (for example, use "notify_none" to ignore self messages or "nick_weebot" to ignore messages from nick "weebot") (default: "irc_quit,irc_part,notify_none")"
+python.urlserver.msg_require_tags = "comma-separated list (without spaces) of tags (or beginning of tags) required to shorten URLs (for example "nick_" to shorten URLs only in messages from other users) (default: "nick_")"
+python.urlserver.separators = "separators for short url list (string with exactly 3 chars) (default: "[|]")"
+python.urlserver.url_min_length = "minimum length for an URL to be shortened (0 = shorten all URLs, -1 = detect length based on shorten URL) (default: "0")"
+python.urlserver.urls_amount = "number of URLs to keep in memory (and in file when script is not loaded) (default: "100")"
+python.whois_on_query.command = "the command sent to do the whois ($nick is repladed by nick) (default: "/whois $nick $nick")"
+python.whois_on_query.self_query = "if on, send whois for self queries (default: "off")"
diff --git a/weechat/python/announce_url_title.py b/weechat/python/announce_url_title.py
index 95bd796..f652c15 100644
--- a/weechat/python/announce_url_title.py
+++ b/weechat/python/announce_url_title.py
@@ -20,25 +20,27 @@
#
#
# If someone posts an URL in a configured channel
-# this script will post back title
+# this script will post back title
# Explanation about ignores:
# * plugins.var.python.announce_url_title.ignore_buffers:
-# Comma separated list of patterns for define ignores.
+# Comma separated list of patterns for define ignores.
# URLs from channels where its name matches any of these patterns will be ignored.
# Wildcards '*', '?' and char groups [..] can be used.
# An ignore exception can be added by prefixing '!' in the pattern.
#
# Example:
# *ubuntu*,!#ubuntu-offtopic
-# any urls from a 'ubuntu' channel will be ignored,
+# any urls from a 'ubuntu' channel will be ignored,
# except from #ubuntu-offtopic
#
# * plugins.var.python.announce_url_title.url_ignore
# simply does partial match, so specifying 'google' will ignore every url with the word google in it
-#
+#
#
# History:
+# 2013-11-07, excalibr
+# version 17: add more characters to exclude in escaping (this fix problem with youtube urls)
# 2012-11-15, xt
# version 16: improve escaping
# 2011-09-04, Deltafire
@@ -84,7 +86,7 @@ from urllib import quote
SCRIPT_NAME = "announce_url_title"
SCRIPT_AUTHOR = "xt <xt@bash.no>"
-SCRIPT_VERSION = "16"
+SCRIPT_VERSION = "17"
SCRIPT_LICENSE = "GPL3"
SCRIPT_DESC = "Announce URL titles to channel or locally"
@@ -164,7 +166,7 @@ def url_print_cb(data, buffer, time, tags, displayed, highlight, prefix, message
ignorelist = w.config_get_plugin('url_ignore').split(',')
for url in urlRe.findall(message):
- url = quote(url, ":/") # Escape URL
+ url = quote(url, "%/:=&?~#+!$,;@()*[]") # Escape URL
ignore = False
for ignore_part in ignorelist:
if ignore_part.strip():
diff --git a/weechat/python/listbuffer.py b/weechat/python/listbuffer.py
deleted file mode 100644
index 227a3ba..0000000
--- a/weechat/python/listbuffer.py
+++ /dev/null
@@ -1,467 +0,0 @@
-# -*- coding: utf-8 -*-
-#
-# ListBuffer, version 0.8.1 for WeeChat version 0.3
-# Latest development version: https://github.com/FiXato/listbuffer
-#
-# Show /list results in a common buffer and interact with them.
-#
-# This script allows you to easily join channels from the /list output.
-# It will open a common buffer for the /list result, through which you
-# browse with your cursor keys, and join with the meta-enter keys.
-# Adjust sorting with meta->, meta-< and meta-/ keybindings.
-#
-## History:
-### 2011-09-08: FiXato:
-#
-# * version 0.1: initial release.
-# * added a common buffer for /list results
-# * added highlighting for currently selected line
-# * added /join support via enter key
-# * added scroll_top and scroll_bottom support
-#
-# * version 0.2: /list format bugfix
-# * added support for /list results without modes
-# * some servers don't send 321 (/list start). Taken into account.
-#
-# * version 0.3: Sorting support
-# * Added some basic sorting support. Scroll through sort options
-# with meta-> and meta-< (users, channel, topic, modes)
-#
-### 2011-09-19: FiXato
-#
-# * version 0.4:
-# * Case-insensitive buffer lookup fix.
-# * Removed default enter keybind
-#
-### 2011-12-28: troydm:
-#
-# * version 0.5: It's an upside-down-world
-# * Added inverted sorting support provided by Dmitry "troydm" Geurkov
-# Use meta-/ to switch between inverted and regular sorting.
-#
-### 2012-02-10: FiXato:
-#
-# * version 0.6: Stop shoving that buffer in my face!
-# * The listbuffer should no longer pop up by itself when you load the script.
-# It should only pop up now when you actually do a /list query.
-#
-# * version 0.7: .. but please pop it up in my current window when I ask for it
-# * Added setting plugins.var.python.listbuffer.autofocus
-# This will autofocus the listbuffer in the current window if another window isn't
-# already showing it, and of course only when the user issues /list
-#
-### 2012-07-10: FiXato:
-#
-# * version 0.7.1: Forgetful bugfix
-# * Made sure lb_curline global variable is defined
-#
-### 2013-03-19: FiXato:
-#
-# * version 0.8: Sorted out the sorting
-# * Added automatically updating options for sorting:
-# * plugins.var.python.listbuffer.sort_inverted
-# * plugins.var.python.listbuffer.sort_order
-# * version 0.8.1: Pad it baby!
-# * Channel modes are equally padded even when there are no channel modes.
-# * Added padding options:
-# * plugins.var.python.listbuffer.modes_min_width
-# * plugins.var.python.listbuffer.channel_min_width
-# * plugins.var.python.listbuffer.users_min_width
-#
-## Acknowledgements:
-# * Dmitry "troydm" Geurkov, for providing the inverse-sorting patch to the project.
-# * Sebastien "Flashcode" Helleu, for developing the kick-ass IRC client WeeChat
-# and the iset.pl script which inspired me to this script.
-# * Nils "nils_2" Görs, for his contributions to iset.pl which served as
-# example code.
-# * David "drubin" Rubin, for his urlgrab.py script, which also served
-# as example code.
-# * ArZa, whose listsort.pl script helped me getting started with
-# grabbing the /list results. Parts of his code have been shamelessly
-# copied and ported to Python.
-# * Khaled Mardam-Bey, for making me yearn for similar /list support in
-# WeeChat as mIRC already offered. :P
-# * mave_, for pointing out that sort orders weren't remembered.
-#
-## TODO:
-# - Auto-scroll selected line upon window scroll.
-# - Add option to hide already joined channels.
-# - Improve sorting methods
-# - Add auto-join support
-# - Detect if channel is already in auto-join
-# - Allow automatically switching to the listbuffer
-# - Add support for ALIS (/squery alis LIST * -mix 100 (IRCNet)
-# - Make colours configurable
-# - Limit number of channels to parse
-# - Add filter support a la iset
-# - Allow selecting multiple channels
-# - Add optional command redirection.
-#
-## Copyright (c) 2011,2012,2013 Filip H.F. "FiXato" Slagter,
-# <FiXato [at] Gmail [dot] com>
-# http://profile.fixato.org
-#
-# Permission is hereby granted, free of charge, to any person obtaining
-# a copy of this software and associated documentation files (the
-# "Software"), to deal in the Software without restriction, including
-# without limitation the rights to use, copy, modify, merge, publish,
-# distribute, sublicense, and/or sell copies of the Software, and to
-# permit persons to whom the Software is furnished to do so, subject to
-# the following conditions:
-#
-# The above copyright notice and this permission notice shall be
-# included in all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-# NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#
-SCRIPT_NAME = "listbuffer"
-SCRIPT_AUTHOR = "Filip H.F. 'FiXato' Slagter <fixato [at] gmail [dot] com>"
-SCRIPT_VERSION = "0.8.1"
-SCRIPT_LICENSE = "MIT"
-SCRIPT_DESC = "A common buffer for /list output."
-SCRIPT_COMMAND = "listbuffer"
-
-import_ok = True
-
-try:
- import weechat
-except ImportError:
- print "This script must be run under WeeChat."
- import_ok = False
-
-import re
-
-lb_settings = (
- ("autofocus", "on", "Focus the listbuffer in the current window if it isn't already displayed by a window."),
- ("sort_order", "users", "Last used sort order for the channel list."),
- ("sort_inverted", "on", "Invert the sort order for the channel list."),
- ("modes_min_width", "8", "The minimum width used for modes in the channel list. If a channel has less modes than this amount, the column will be padded with spaces."),
- ("channel_min_width", "25", "The minimum width used for the channel name in the channel list. If a channelname is shorter than this amount, the column will be padded with spaces."),
- ("users_min_width", "8", "The minimum width used for the usercount in the channel list. If the usercount has less digits than this amount, the column will be padded with spaces."),
-)
-lb_buffer = None
-lb_curline = 0
-lb_channels = []
-lb_network = None
-lb_list_started = False
-lb_current_sort = None
-lb_sort_inverted = False
-lb_sort_options = (
- 'channel',
- 'users',
- 'modes',
- 'topic',
-)
-
-# server numeric Nick Chan Users Modes Topic
-lb_channel_list_expression = '(:\S+) (\d{3}) (\S+) (\S+) (\d+) :(\[(.*?)\] )?(.*)'
-
-# Create listbuffer.
-def lb_create_buffer():
- global lb_buffer, lb_curline
-
- if not lb_buffer:
- lb_buffer = weechat.buffer_new("listbuffer", "lb_input_cb", \
- "", "lb_close_cb", "")
- lb_set_buffer_title()
- # Sets notify to 0 as this buffer does not need to be in hotlist.
- weechat.buffer_set(lb_buffer, "notify", "0")
- weechat.buffer_set(lb_buffer, "nicklist", "0")
- weechat.buffer_set(lb_buffer, "type", "free")
- weechat.buffer_set(lb_buffer, "key_bind_ctrl-L", "/listbuffer **refresh")
- weechat.buffer_set(lb_buffer, "key_bind_meta2-A", "/listbuffer **up")
- weechat.buffer_set(lb_buffer, "key_bind_meta2-B", "/listbuffer **down")
- weechat.buffer_set(lb_buffer, "key_bind_meta2-1~", "/listbuffer **scroll_top")
- weechat.buffer_set(lb_buffer, "key_bind_meta2-4~", "/listbuffer **scroll_bottom")
- weechat.buffer_set(lb_buffer, "key_bind_meta-ctrl-J", "/listbuffer **enter")
- weechat.buffer_set(lb_buffer, "key_bind_meta-ctrl-M", "/listbuffer **enter")
- weechat.buffer_set(lb_buffer, "key_bind_meta->", "/listbuffer **sort_next")
- weechat.buffer_set(lb_buffer, "key_bind_meta-<", "/listbuffer **sort_previous")
- weechat.buffer_set(lb_buffer, "key_bind_meta-/", "/listbuffer **sort_invert")
- lb_curline = 0
- if weechat.config_get_plugin("autofocus") == "on":
- if not weechat.window_search_with_buffer(lb_buffer):
- weechat.command("", "/buffer " + weechat.buffer_get_string(lb_buffer,"name"))
-
-def lb_set_buffer_title():
- global lb_buffer, lb_current_sort
- ascdesc = '(v)' if lb_sort_inverted else '(^)'
- weechat.buffer_set(lb_buffer, "title", lb_line_format({
- 'channel': 'Channel name%s' % (ascdesc if lb_current_sort == 'channel' else ''),
- 'users': 'Users%s' % (ascdesc if lb_current_sort == 'users' else ''),
- 'modes': 'Modes%s' % (ascdesc if lb_current_sort == 'modes' else ''),
- 'topic': 'Topic%s' % (ascdesc if lb_current_sort == 'topic' else ''),
- 'nomodes': None,
- }))
-
-def lb_list_start(data, signal, message):
- lb_initialise_list
-
- return weechat.WEECHAT_RC_OK
-
-def lb_initialise_list(signal):
- global lb_channels, lb_network, lb_list_started
-
- lb_create_buffer()
- lb_channels = []
- lb_network = signal.split(',')[0]
- lb_list_started = True
- return
-
-
-def lb_list_chan(data, signal, message):
- global lb_channels, lb_buffer, lb_list_started
-
- # Work-around for IRCds which don't send 321 Numeric (/List start)
- if not lb_list_started:
- lb_initialise_list(signal)
-
- for chan_data in re.findall(lb_channel_list_expression,message):
- lb_channels.append({
- 'server': chan_data[0][1:-1],
- 'numeric': chan_data[1],
- 'nick': chan_data[2],
- 'channel': chan_data[3],
- 'users': chan_data[4],
- 'nomodes': chan_data[5] == '',
- 'modes': chan_data[6],
- 'topic': weechat.hook_modifier_exec("irc_color_decode", "1", chan_data[7])
- })
- return weechat.WEECHAT_RC_OK
-
-def lb_list_end(data, signal, message):
- global lb_list_started
-
- # Work-around for IRCds which don't send 321 Numeric (/List start)
- if not lb_list_started:
- lb_initialise_list(signal)
-
- lb_list_started = False
- if lb_current_sort:
- lb_sort()
- lb_refresh()
- return weechat.WEECHAT_RC_OK
-
-def keyEvent (data, buffer, args):
- global lb_options
- lb_options[args]()
-
-def lb_input_cb(data, buffer, input_data):
- global lb_options, lb_curline
- lb_options[input_data]()
- return weechat.WEECHAT_RC_OK
-
-def lb_refresh():
- global lb_channels, lb_buffer
- weechat.buffer_clear(lb_buffer)
-
- y = 0
- for list_data in lb_channels:
- lb_refresh_line(y)
- y += 1
- return
-
-def lb_refresh_line(y):
- global lb_buffer, lb_curline, lb_channels
- if y >= 0 and y < len(lb_channels):
- formatted_line = lb_line_format(lb_channels[y], y == lb_curline)
- weechat.prnt_y(lb_buffer, y, formatted_line)
-
-def lb_refresh_curline():
- global lb_curline
- lb_refresh_line(lb_curline-1)
- lb_refresh_line(lb_curline)
- lb_refresh_line(lb_curline+1)
- return
-
-def lb_line_format(list_data,curr=False):
- str = ""
- if (curr):
- str += weechat.color("yellow,red")
- channel_text = list_data['channel'].ljust(int(weechat.config_get_plugin('channel_min_width')))
- users_text = "(%s)" % list_data['users']
- padded_users_text = users_text.rjust(int(weechat.config_get_plugin('users_min_width')) + 2)
- str += "%s%s %s " % (weechat.color("bold"), channel_text, padded_users_text)
- if not list_data['nomodes']:
- modes = "[%s]" % list_data['modes']
- else:
- modes = "[]"
- str += "%s: " % modes.rjust(int(weechat.config_get_plugin('modes_min_width')) + 2)
- str += "%s" % list_data['topic']
- return str
-
-def lb_line_up():
- global lb_curline
- if lb_curline <= 0:
- return
- lb_curline -= 1
- lb_refresh_curline()
- lb_check_outside_window()
- return
-
-def lb_line_down():
- global lb_curline, lb_channels
- if lb_curline+1 >= len(lb_channels):
- return
- lb_curline += 1
- lb_refresh_curline()
- lb_check_outside_window()
- return
-
-def lb_line_run():
- global lb_channels, lb_curline, lb_network
- buff = weechat.info_get("irc_buffer", lb_network)
- channel = lb_channels[lb_curline]['channel']
- command = "/join %s" % channel
- weechat.command(buff, command)
- return
-
-def lb_line_select():
- return
-
-def lb_scroll_top():
- global lb_curline
- old_y = lb_curline
- lb_curline = 0
- lb_refresh_curline()
- lb_refresh_line(old_y)
- weechat.command(lb_buffer, "/window scroll_top")
- return
-
-def lb_scroll_bottom():
- global lb_curline, lb_channels
- old_y = lb_curline
- lb_curline = len(lb_channels)-1
- lb_refresh_curline()
- lb_refresh_line(old_y)
- weechat.command(lb_buffer, "/window scroll_bottom")
- return
-
-def lb_check_outside_window():
- global lb_buffer, lb_curline
- if (lb_buffer):
- infolist = weechat.infolist_get("window", "", "current")
- if (weechat.infolist_next(infolist)):
- start_line_y = weechat.infolist_integer(infolist, "start_line_y")
- chat_height = weechat.infolist_integer(infolist, "chat_height")
- if(start_line_y > lb_curline):
- weechat.command(lb_buffer, "/window scroll -%i" %(start_line_y - lb_curline))
- elif(start_line_y <= lb_curline - chat_height):
- weechat.command(lb_buffer, "/window scroll +%i"%(lb_curline - start_line_y - chat_height + 1))
- weechat.infolist_free(infolist)
-
-def lb_sort_next():
- global lb_current_sort, lb_sort_options
- if lb_current_sort:
- new_index = lb_sort_options.index(lb_current_sort) + 1
- else:
- new_index = 0
-
- if len(lb_sort_options) <= new_index:
- new_index = 0
-
- lb_set_current_sort_order(lb_sort_options[new_index])
- lb_sort()
-
-def lb_set_current_sort_order(value):
- global lb_current_sort
- lb_current_sort = value
- weechat.config_set_plugin('sort_order', lb_current_sort)
-
-def lb_set_invert_sort_order(value):
- global lb_sort_inverted
- lb_sort_inverted = value
- weechat.config_set_plugin('sort_inverted', ('on' if lb_sort_inverted else 'off'))
-
-def lb_sort_previous():
- global lb_current_sort, lb_sort_options
- if lb_current_sort:
- new_index = lb_sort_options.index(lb_current_sort) - 1
- else:
- new_index = 0
-
- if new_index < 0:
- new_index = len(lb_sort_options) - 1
-
- lb_set_current_sort_order(lb_sort_options[new_index])
- lb_sort()
-
-def lb_sort(sort_key=None):
- global lb_channels, lb_current_sort, lb_sort_inverted
- if sort_key:
- lb_set_current_sort_order(sort_key)
- if lb_current_sort == 'users':
- lb_channels = sorted(lb_channels, key=lambda chan_data: int(chan_data[lb_current_sort]))
- else:
- lb_channels = sorted(lb_channels, key=lambda chan_data: chan_data[lb_current_sort])
- if lb_sort_inverted:
- lb_channels.reverse()
- lb_set_buffer_title()
- lb_refresh()
-
-def lb_sort_invert():
- global lb_current_sort, lb_sort_inverted
- if lb_current_sort:
- lb_set_invert_sort_order(not lb_sort_inverted)
- lb_sort()
-
-def lb_close_cb(*kwargs):
- """ A callback for buffer closing. """
- global lb_buffer
-
- lb_buffer = None
- return weechat.WEECHAT_RC_OK
-
-lb_options = {
- 'refresh' : lb_refresh,
- 'up' : lb_line_up,
- 'down' : lb_line_down,
- 'enter' : lb_line_run,
- 'space' : lb_line_select,
- 'scroll_top' : lb_scroll_top,
- 'scroll_bottom': lb_scroll_bottom,
- 'sort_next' : lb_sort_next,
- 'sort_previous': lb_sort_previous,
- 'sort_invert': lb_sort_invert
-}
-
-def lb_command_main(data, buffer, args):
- if args[0:2] == "**":
- keyEvent(data, buffer, args[2:])
- return weechat.WEECHAT_RC_OK
-
-def lb_set_default_settings():
- global lb_settings
- # Set default settings
- for option, default_value, description in lb_settings:
- if not weechat.config_is_set_plugin(option):
- weechat.config_set_plugin(option, default_value)
- version = weechat.info_get("version_number", "") or 0
- if int(version) >= 0x00030500:
- weechat.config_set_desc_plugin(option, description)
-
-def lb_reset_stored_sort_order():
- global lb_current_sort, lb_sort_inverted
- lb_current_sort = weechat.config_get_plugin('sort_order')
- lb_sort_inverted = (True if weechat.config_get_plugin('sort_inverted') == 'on' else False)
-
-if __name__ == "__main__" and import_ok:
- if weechat.register(SCRIPT_NAME, SCRIPT_AUTHOR, SCRIPT_VERSION,
- SCRIPT_LICENSE, SCRIPT_DESC, "lb_close_cb", ""):
- lb_set_default_settings()
- lb_reset_stored_sort_order()
- lb_buffer = weechat.buffer_search("python", "listbuffer")
-
- weechat.hook_signal("*,irc_in_321", "lb_list_start", "")
- weechat.hook_signal("*,irc_in_322", "lb_list_chan", "")
- weechat.hook_signal("*,irc_in_323", "lb_list_end", "")
- weechat.hook_command(SCRIPT_COMMAND,
- "List Buffer",
- "", "", "",
- "lb_command_main", "")
diff --git a/weechat/relay.conf b/weechat/relay.conf
index 7c45ba4..fdc3e30 100644
--- a/weechat/relay.conf
+++ b/weechat/relay.conf
@@ -1,5 +1,5 @@
#
-# relay.conf -- weechat v0.4.3-dev
+# relay.conf -- weechat v0.4.4-dev
#
[look]
diff --git a/weechat/rmodifier.conf b/weechat/rmodifier.conf
index c21d8ef..0184cde 100644
--- a/weechat/rmodifier.conf
+++ b/weechat/rmodifier.conf
@@ -1,5 +1,5 @@
#
-# rmodifier.conf -- weechat v0.4.3-dev
+# rmodifier.conf -- weechat v0.4.4-dev
#
[look]
diff --git a/weechat/script.conf b/weechat/script.conf
index 570e651..f88e3cb 100644
--- a/weechat/script.conf
+++ b/weechat/script.conf
@@ -1,5 +1,5 @@
#
-# script.conf -- weechat v0.4.3-dev
+# script.conf -- weechat v0.4.4-dev
#
[look]
diff --git a/weechat/sec.conf b/weechat/sec.conf
index a6d419a..a120da0 100644
--- a/weechat/sec.conf
+++ b/weechat/sec.conf
@@ -1,5 +1,5 @@
#
-# sec.conf -- weechat v0.4.3-dev
+# sec.conf -- weechat v0.4.4-dev
#
[crypt]
diff --git a/weechat/xfer.conf b/weechat/xfer.conf
index c102e9d..98813d8 100644
--- a/weechat/xfer.conf
+++ b/weechat/xfer.conf
@@ -1,5 +1,5 @@
#
-# xfer.conf -- weechat v0.4.3-dev
+# xfer.conf -- weechat v0.4.4-dev
#
[look]
@@ -30,6 +30,7 @@ timeout = 300
auto_accept_chats = off
auto_accept_files = off
auto_accept_nicks = ""
+auto_check_crc32 = off
auto_rename = on
auto_resume = on
convert_spaces = on
diff --git a/weechat/yaurls.conf b/weechat/yaurls.conf
index ed55160..4eb7773 100644
--- a/weechat/yaurls.conf
+++ b/weechat/yaurls.conf
@@ -1,5 +1,5 @@
#
-# yaurls.conf -- weechat v0.4.3-dev
+# yaurls.conf -- weechat v0.4.3-rc2
#
[blacklists]