# HG changeset patch # User Steve Losh # Date 1316978973 14400 # Node ID 3eb50a0fe94f52613ee6f7b7cbf4f29ccfa4606e # Parent 8183cec0eac62d4a1e9469ec8bb1d4bfc4f6b00e Add weechat. diff -r 8183cec0eac6 -r 3eb50a0fe94f weechat/alias.conf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/weechat/alias.conf Sun Sep 25 15:29:33 2011 -0400 @@ -0,0 +1,37 @@ +# +# alias.conf -- weechat v0.3.5 +# + +[cmd] +AAWAY = "allserv /away" +AME = "allchan /me" +AMSG = "allchan /msg *" +ANICK = "allserv /nick" +BYE = "quit" +C = "buffer clear" +CHAT = "dcc chat" +CL = "buffer clear" +CLOSE = "buffer close" +EXIT = "quit" +IG = "ignore" +J = "join" +K = "kick" +KB = "kickban" +LEAVE = "part" +M = "msg" +MUB = "unban *" +N = "names" +Q = "query" +REDRAW = "window refresh" +SAY = "msg *" +SIGNOFF = "quit" +T = "topic" +UB = "unban" +V = "command core version" +W = "who" +WC = "window merge" +WI = "whois" +WII = "whois $1 $1" +WW = "whowas" + +[completion] diff -r 8183cec0eac6 -r 3eb50a0fe94f weechat/icon.png Binary file weechat/icon.png has changed diff -r 8183cec0eac6 -r 3eb50a0fe94f weechat/irc.conf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/weechat/irc.conf Sun Sep 25 15:29:33 2011 -0400 @@ -0,0 +1,220 @@ +# +# irc.conf -- weechat v0.3.5 +# + +[look] +buffer_switch_autojoin = on +buffer_switch_join = on +color_nicks_in_names = off +color_nicks_in_nicklist = off +color_nicks_in_server_messages = on +color_pv_nick_like_channel = on +display_away = local +display_ctcp_blocked = on +display_ctcp_reply = on +display_ctcp_unknown = on +display_host_join = on +display_host_join_local = on +display_host_quit = on +display_old_topic = on +display_pv_away_once = on +display_pv_back = on +hide_nickserv_pwd = on +highlight_tags = "irc_privmsg,irc_notice" +item_away_message = on +item_channel_modes = on +item_channel_modes_hide_key = off +item_display_server = buffer_plugin +item_nick_modes = on +item_nick_prefix = on +msgbuffer_fallback = current +new_channel_position = none +new_pv_position = none +nick_color_force = "" +nick_color_stop_chars = "_|[" +nick_completion_smart = speakers +nick_prefix = "" +nick_suffix = "" +notice_as_pv = auto +notify_tags_ison = "notify_message" +notify_tags_whois = "notify_message" +part_closes_buffer = off +raw_messages = 256 +server_buffer = merge_with_core +smart_filter = on +smart_filter_delay = 5 +smart_filter_join = on +smart_filter_nick = on +smart_filter_quit = on +topic_strip_colors = off + +[color] +input_nick = lightcyan +item_away = yellow +item_channel_modes = default +item_lag_counting = default +item_lag_finished = yellow +message_join = green +message_quit = red +nick_prefix = green +nick_prefixes = "q:lightred;a:lightcyan;o:lightgreen;h:lightmagenta;v:yellow;*:lightblue" +nick_suffix = green +notice = green +reason_quit = default +topic_new = white +topic_old = darkgray + +[network] +autoreconnect_delay_growing = 2 +autoreconnect_delay_max = 1800 +colors_receive = on +colors_send = on +lag_check = 60 +lag_disconnect = 0 +lag_min_show = 500 +lag_refresh_interval = 1 +notify_check_ison = 1 +notify_check_whois = 5 +send_unknown_commands = off + +[msgbuffer] + +[ctcp] + +[ignore] + +[server_default] +addresses = "" +anti_flood_prio_high = 2 +anti_flood_prio_low = 2 +autoconnect = off +autojoin = "" +autoreconnect = on +autoreconnect_delay = 10 +autorejoin = off +autorejoin_delay = 30 +away_check = 0 +away_check_max_nicks = 25 +command = "" +command_delay = 0 +connection_timeout = 60 +default_msg_part = "WeeChat %v" +default_msg_quit = "WeeChat %v" +ipv6 = off +local_hostname = "" +nicks = "sjl,sjl1,sjl2,sjl3,sjl4" +notify = "" +password = "" +proxy = "" +realname = "" +sasl_mechanism = plain +sasl_password = "" +sasl_timeout = 15 +sasl_username = "" +ssl = off +ssl_cert = "" +ssl_dhkey_size = 2048 +ssl_priorities = "NORMAL" +ssl_verify = on +username = "sjl" + +[server] +freenode.addresses = "chat.freenode.net/6667" +freenode.proxy +freenode.ipv6 +freenode.ssl +freenode.ssl_cert +freenode.ssl_priorities +freenode.ssl_dhkey_size +freenode.ssl_verify +freenode.password +freenode.sasl_mechanism +freenode.sasl_username +freenode.sasl_password +freenode.sasl_timeout +freenode.autoconnect +freenode.autoreconnect +freenode.autoreconnect_delay +freenode.nicks +freenode.username +freenode.realname +freenode.local_hostname +freenode.command +freenode.command_delay +freenode.autojoin +freenode.autorejoin +freenode.autorejoin_delay +freenode.connection_timeout +freenode.anti_flood_prio_high +freenode.anti_flood_prio_low +freenode.away_check +freenode.away_check_max_nicks +freenode.default_msg_part +freenode.default_msg_quit +freenode.notify +oftc.addresses = "irc.oftc.net/6667" +oftc.proxy +oftc.ipv6 +oftc.ssl +oftc.ssl_cert +oftc.ssl_priorities +oftc.ssl_dhkey_size +oftc.ssl_verify +oftc.password +oftc.sasl_mechanism +oftc.sasl_username +oftc.sasl_password +oftc.sasl_timeout +oftc.autoconnect +oftc.autoreconnect +oftc.autoreconnect_delay +oftc.nicks +oftc.username +oftc.realname +oftc.local_hostname +oftc.command +oftc.command_delay +oftc.autojoin +oftc.autorejoin +oftc.autorejoin_delay +oftc.connection_timeout +oftc.anti_flood_prio_high +oftc.anti_flood_prio_low +oftc.away_check +oftc.away_check_max_nicks +oftc.default_msg_part +oftc.default_msg_quit +oftc.notify +sjl.addresses = "stevelosh.com/30789" +sjl.proxy +sjl.ipv6 +sjl.ssl +sjl.ssl_cert +sjl.ssl_priorities +sjl.ssl_dhkey_size +sjl.ssl_verify +sjl.password +sjl.sasl_mechanism +sjl.sasl_username +sjl.sasl_password +sjl.sasl_timeout +sjl.autoconnect +sjl.autoreconnect +sjl.autoreconnect_delay +sjl.nicks +sjl.username +sjl.realname +sjl.local_hostname +sjl.command +sjl.command_delay +sjl.autojoin +sjl.autorejoin +sjl.autorejoin_delay +sjl.connection_timeout +sjl.anti_flood_prio_high +sjl.anti_flood_prio_low +sjl.away_check +sjl.away_check_max_nicks +sjl.default_msg_part +sjl.default_msg_quit +sjl.notify diff -r 8183cec0eac6 -r 3eb50a0fe94f weechat/logger.conf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/weechat/logger.conf Sun Sep 25 15:29:33 2011 -0400 @@ -0,0 +1,19 @@ +# +# logger.conf -- weechat v0.3.5 +# + +[look] +backlog = 20 + +[file] +auto_log = on +info_lines = off +mask = "$plugin.$name.weechatlog" +name_lower_case = on +path = "%h/logs/" +replacement_char = "_" +time_format = "%Y-%m-%d %H:%M:%S" + +[level] + +[mask] diff -r 8183cec0eac6 -r 3eb50a0fe94f weechat/perl/autoload/buffers.pl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/weechat/perl/autoload/buffers.pl Sun Sep 25 15:29:33 2011 -0400 @@ -0,0 +1,490 @@ +# +# Copyright (c) 2008-2011 by Sébastien Helleu +# +# 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 . +# + +# +# Display sidebar with list of buffers. +# +# History: +# 2011-08-24, Sébastien Helleu : +# v2.4: add mouse support +# 2011-06-06, Nils G : +# v2.3: added: missed option "color_whitelist_default" +# 2011-03-23, Sébastien Helleu : +# v2.2: fix color of nick prefix with WeeChat >= 0.3.5 +# 2011-02-13, Nils G : +# v2.1: add options "color_whitelist_*" +# 2010-10-05, Sébastien Helleu : +# v2.0: add options "sort" and "show_number" +# 2010-04-12, Sébastien Helleu : +# v1.9: replace call to log() by length() to align buffer numbers +# 2010-04-02, Sébastien Helleu : +# v1.8: fix bug with background color and option indenting_number +# 2010-04-02, Helios : +# v1.7: add indenting_number option +# 2010-02-25, m4v : +# v1.6: add option to hide empty prefixes +# 2010-02-12, Sébastien Helleu : +# v1.5: add optional nick prefix for buffers like IRC channels +# 2009-09-30, Sébastien Helleu : +# v1.4: remove spaces for indenting when bar position is top/bottom +# 2009-06-14, Sébastien Helleu : +# v1.3: add option "hide_merged_buffers" +# 2009-06-14, Sébastien Helleu : +# v1.2: improve display with merged buffers +# 2009-05-02, Sébastien Helleu : +# v1.1: sync with last API changes +# 2009-02-21, Sébastien Helleu : +# v1.0: remove timer used to update bar item first time (not needed any more) +# 2009-02-17, Sébastien Helleu : +# v0.9: fix bug with indenting of private buffers +# 2009-01-04, Sébastien Helleu : +# v0.8: update syntax for command /set (comments) +# 2008-10-20, Jiri Golembiovsky : +# v0.7: add indenting option +# 2008-10-01, Sébastien Helleu : +# v0.6: add default color for buffers, and color for current active buffer +# 2008-09-18, Sébastien Helleu : +# v0.5: fix color for "low" level entry in hotlist +# 2008-09-18, Sébastien Helleu : +# v0.4: rename option "show_category" to "short_names", +# remove option "color_slash" +# 2008-09-15, Sébastien Helleu : +# v0.3: fix bug with priority in hotlist (var not defined) +# 2008-09-02, Sébastien Helleu : +# v0.2: add color for buffers with activity and config options for +# colors, add config option to display/hide categories +# 2008-03-15, Sébastien Helleu : +# v0.1: script creation +# +# Help about settings: +# display short names (remove text before first "." in buffer name): +# /set plugins.var.perl.buffers.short_names on +# use indenting for some buffers like IRC channels: +# /set plugins.var.perl.buffers.indenting on +# use indenting for numbers: +# /set plugins.var.perl.buffers.indenting_number on +# hide merged buffers: +# /set plugins.var.perl.buffers.hide_merged_buffers on +# show prefix: +# /set plugins.var.perl.buffers.show_prefix on +# /set plugins.var.perl.buffers.show_prefix_empty on +# change colors: +# /set plugins.var.perl.buffers.color_number color +# /set plugins.var.perl.buffers.color_default color +# /set plugins.var.perl.buffers.color_hotlist_low color +# /set plugins.var.perl.buffers.color_hotlist_message color +# /set plugins.var.perl.buffers.color_hotlist_private color +# /set plugins.var.perl.buffers.color_hotlist_highlight color +# /set plugins.var.perl.buffers.color_current color +# (replace "color" by your color, which may be "fg" or "fg,bg") +# + +use strict; + +my $version = "2.4"; + +# -------------------------------[ config ]------------------------------------- + +my %default_options = ("short_names" => "on", + "indenting" => "on", + "indenting_number" => "on", + "hide_merged_buffers" => "off", + "show_number" => "on", + "show_prefix" => "off", + "show_prefix_empty" => "on", + "sort" => "number", # "number" or "name" + "color_hotlist_low" => "white", + "color_hotlist_message" => "yellow", + "color_hotlist_private" => "lightgreen", + "color_hotlist_highlight" => "magenta", + "color_current" => "lightcyan,red", + "color_default" => "default", + "color_number" => "lightgreen", + "color_whitelist_buffers" => "", + "color_whitelist_default" => "", + "color_whitelist_low" => "", + "color_whitelist_message" => "", + "color_whitelist_private" => "", + "color_whitelist_highlight" => "", + + ); +my %mouse_keys = ("\@item(buffers):button1*" => "hsignal:buffers_mouse"); +my %options; +my %hotlist_level = (0 => "low", 1 => "message", 2 => "private", 3 => "highlight"); +my @whitelist_buffers = ""; +my @buffers_focus = (); + +# --------------------------------[ init ]-------------------------------------- + +weechat::register("buffers", "Sébastien Helleu ", $version, + "GPL3", "Sidebar with list of buffers", "", ""); + +foreach my $option (keys %default_options) +{ + if (!weechat::config_is_set_plugin($option)) + { + weechat::config_set_plugin($option, $default_options{$option}); + } +} +buffers_read_options(); + +weechat::bar_item_new("buffers", "build_buffers", ""); +weechat::bar_new("buffers", "0", "0", "root", "", "left", "horizontal", + "vertical", "0", "0", "default", "default", "default", "1", + "buffers"); +weechat::hook_signal("buffer_*", "buffers_signal_buffer", ""); +weechat::hook_signal("hotlist_*", "buffers_signal_hotlist", ""); +weechat::hook_config("plugins.var.perl.buffers.*", "buffers_signal_config", ""); +weechat::bar_item_update("buffers"); +my $weechat_version = weechat::info_get("version_number", "") || 0; +if ($weechat_version >= 0x00030600) +{ + weechat::hook_focus("buffers", "buffers_focus_buffers", ""); + weechat::hook_hsignal("buffers_mouse", "buffers_hsignal_mouse", ""); + weechat::key_bind("mouse", \%mouse_keys); +} + +# ------------------------------------------------------------------------------ + +sub buffers_read_options +{ + foreach my $option (keys %default_options) + { + $options{$option} = weechat::config_get_plugin($option); + } + @whitelist_buffers = split(/,/, $options{color_whitelist_buffers}); +} + +sub build_buffers +{ + my $str = ""; + + # get bar position (left/right/top/bottom) + my $position = "left"; + my $option_position = weechat::config_get("weechat.bar.buffers.position"); + if ($option_position ne "") + { + $position = weechat::config_string($option_position); + } + + # read hotlist + my %hotlist; + my $infolist = weechat::infolist_get("hotlist", "", ""); + while (weechat::infolist_next($infolist)) + { + $hotlist{weechat::infolist_pointer($infolist, "buffer_pointer")} = + weechat::infolist_integer($infolist, "priority"); + } + weechat::infolist_free($infolist); + + # read buffers list + @buffers_focus = (); + my @buffers; + my @current1 = (); + my @current2 = (); + my $old_number = -1; + my $max_number = 0; + my $max_number_digits = 0; + my $active_seen = 0; + $infolist = weechat::infolist_get("buffer", "", ""); + while (weechat::infolist_next($infolist)) + { + my $buffer; + my $number = weechat::infolist_integer($infolist, "number"); + if ($number ne $old_number) + { + @buffers = (@buffers, @current2, @current1); + @current1 = (); + @current2 = (); + $active_seen = 0; + } + if ($number > $max_number) + { + $max_number = $number; + } + $old_number = $number; + my $active = weechat::infolist_integer($infolist, "active"); + if ($active) + { + $active_seen = 1; + } + $buffer->{"pointer"} = weechat::infolist_pointer($infolist, "pointer"); + $buffer->{"number"} = $number; + $buffer->{"active"} = $active; + $buffer->{"current_buffer"} = weechat::infolist_integer($infolist, "current_buffer"); + $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"); + $buffer->{"full_name"} = $buffer->{"plugin_name"}.".".$buffer->{"name"}; + if ($active_seen) + { + push(@current2, $buffer); + } + else + { + push(@current1, $buffer); + } + } + if ($max_number >= 1) + { + $max_number_digits = length(int($max_number)); + } + @buffers = (@buffers, @current2, @current1); + weechat::infolist_free($infolist); + + # sort buffers by number, name or shortname + my %sorted_buffers; + if (1) + { + my $number = 0; + for my $buffer (@buffers) + { + my $key; + if ($options{"sort"} eq "name") + { + my $name = $buffer->{"name"}; + $name = $buffer->{"short_name"} if ($options{"short_names"} eq "on"); + $key = sprintf("%s%08d", lc($name), $buffer->{"number"}); + } + else + { + $key = sprintf("%08d", $number); + } + $sorted_buffers{$key} = $buffer; + $number++; + } + } + + # build string with buffers + $old_number = -1; + foreach my $key (sort keys %sorted_buffers) + { + my $buffer = $sorted_buffers{$key}; + if (($options{"hide_merged_buffers"} eq "on") && (! $buffer->{"active"})) + { + next; + } + + push(@buffers_focus, $buffer); + my $color = ""; + # whitelist buffer? + if (grep /^$buffer->{"name"}$/, @whitelist_buffers) + { + # options empty? + if ($options{"color_whitelist_default"} eq "") + { + $color = $options{"color_default"}; + } + else + { + # use color + $color = $options{"color_whitelist_default"}; + } + } + else + { + # no whitelist buffer + $color = $options{"color_default"}; + } + + $color = "default" if ($color eq ""); + my $bg = ""; + + if (exists $hotlist{$buffer->{"pointer"}}) + { + if (grep /^$buffer->{"name"}$/, @whitelist_buffers) + { + if ($options{"color_whitelist_".$hotlist_level{$hotlist{$buffer->{"pointer"}}}} eq "") # no color in settings + { + $color = $options{"color_hotlist_".$hotlist_level{$hotlist{$buffer->{"pointer"}}}}; # use standard colors + } + else + { + $color = $options{"color_whitelist_".$hotlist_level{$hotlist{$buffer->{"pointer"}}}}; + } + } + else + { + $color = $options{"color_hotlist_".$hotlist_level{$hotlist{$buffer->{"pointer"}}}}; + } + } + if ($buffer->{"current_buffer"}) + { + $color = $options{"color_current"}; + $bg = $1 if ($color =~ /.*,(.*)/); + } + my $color_bg = ""; + $color_bg = weechat::color(",".$bg) if ($bg ne ""); + if ($options{"show_number"} eq "on") + { + if (($options{"indenting_number"} eq "on") + && (($position eq "left") || ($position eq "right"))) + { + $str .= weechat::color("default").$color_bg + .(" " x ($max_number_digits - length(int($buffer->{"number"})))); + } + if ($old_number ne $buffer->{"number"}) + { + $str .= weechat::color($options{"color_number"}) + .$color_bg + .$buffer->{"number"} + .weechat::color("default") + .$color_bg + ."."; + } + else + { + my $indent = ""; + $indent = ((" " x length($buffer->{"number"}))." ") if (($position eq "left") || ($position eq "right")); + $str .= weechat::color("default") + .$color_bg + .$indent; + } + } + if (($options{"indenting"} eq "on") + && (($position eq "left") || ($position eq "right"))) + { + my $type = weechat::buffer_get_string($buffer->{"pointer"}, "localvar_type"); + if (($type eq "channel") || ($type eq "private")) + { + $str .= " "; + } + } + if ($options{"show_prefix"} eq "on") + { + my $nickname = weechat::buffer_get_string($buffer->{"pointer"}, "localvar_nick"); + if ($nickname ne "") + { + # with version >= 0.3.2, this infolist will return only nick + # with older versions, whole nicklist is returned for buffer, and this can be very slow + 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") + && (weechat::infolist_string($infolist_nick, "name") eq $nickname)) + { + my $prefix = weechat::infolist_string($infolist_nick, "prefix"); + if (($prefix ne " ") or ($options{"show_prefix_empty"} eq "on")) + { + # with version >= 0.3.5, it is now a color name (for older versions: option name with color) + if (int($version) >= 0x00030500) + { + $str .= weechat::color(weechat::infolist_string($infolist_nick, "prefix_color")); + } + else + { + $str .= weechat::color(weechat::config_color( + weechat::config_get( + weechat::infolist_string($infolist_nick, "prefix_color")))); + } + $str .= $prefix; + } + last; + } + } + weechat::infolist_free($infolist_nick); + } + } + } + $str .= weechat::color($color); + if ($options{"short_names"} eq "on") + { + $str .= $buffer->{"short_name"}; + } + else + { + $str .= $buffer->{"name"}; + } + $str .= "\n"; + $old_number = $buffer->{"number"}; + } + + + return $str; +} + +sub buffers_signal_buffer +{ + weechat::bar_item_update("buffers"); + return weechat::WEECHAT_RC_OK; +} + +sub buffers_signal_hotlist +{ + weechat::bar_item_update("buffers"); + return weechat::WEECHAT_RC_OK; +} + +sub buffers_signal_config +{ + buffers_read_options(); + weechat::bar_item_update("buffers"); + return weechat::WEECHAT_RC_OK; +} + +# called when mouse click occured in buffers item: this callback returns buffer +# hash according to line of item where click ccured +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)) + { + $hash = $buffers_focus[$item_line]; + } + else + { + $hash = {}; + my $hash_focus = $buffers_focus[0]; + foreach my $key (keys %$hash_focus) + { + $hash->{$key} = "?"; + } + } + return $hash; +} + +# called when a mouse action is done on buffers item, to execute action +# action can be: jump to a buffer, or move buffer in list (drag & drop of buffer) +sub buffers_hsignal_mouse +{ + my ($data, $signal, %hash) = ($_[0], $_[1], %{$_[2]}); + if ($hash{"number"} eq $hash{"number2"}) + { + weechat::command("", "/buffer ".$hash{"full_name"}); + } + else + { + my $number2 = $hash{"number2"}; + if ($number2 eq "?") + { + # 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/)); + } + my $ptrbuf = weechat::current_buffer(); + weechat::command("", "/buffer ".$hash{"number"}); + weechat::command("", "/buffer move ".$number2); + weechat::buffer_set($ptrbuf, "display", "1"); + } +} diff -r 8183cec0eac6 -r 3eb50a0fe94f weechat/perl/autoload/colorize_lines.pl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/weechat/perl/autoload/colorize_lines.pl Sun Sep 25 15:29:33 2011 -0400 @@ -0,0 +1,482 @@ +# +# Copyright (c) 2010-2011 by Nils Görs +# +# colors the channel text with nick color and also highlight the whole line +# colorize_nicks.py script will be supported +# +# 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 . +# +# settings see help page +# +# history: +# 0.7: fixed: bug when irc.look.nick_suffix was set (reported and beta-testing by: hw2) (>= weechat 0.3.4) +# blacklist_channels option supports servername +# clean up code +# 0.6: code optimazations. +# rename of script (rainbow_text.pl -> colorize_lines.pl) (suggested by xt and flashcode) +# 0.5: support of hotlist_max_level_nicks_add and weechat.color.chat_nick_colors (>= weechat 0.3.4) +# 0.4: support of weechat.look.highlight_regex option (>= weechat 0.3.4) +# : support of weechat.look.highlight option +# : highlighted line did not work with "." inside servername +# ; internal "autoset" function fixed +# 0.3: support of colorize_nicks.py implemented. +# : /me text displayed wrong nick colour (colour from suffix was used) +# : highlight messages will be checked case insensitiv +# 0.2: supports highlight_words_add from buffer_autoset.py script (suggested: Emralegna) +# : correct look_nickmode colour will be used (bug reported by: Emralegna) +# : /me text will be coloured, too +# 0.1: initial release +# +# requirements: sunglasses ;-) + +use strict; +my $prgname = "colorize_lines"; +my $version = "0.7"; +my $description = "colors text in chat area with according nick color. Highlight messages will be fully highlighted in chat area"; + +# default values +my %default_options = ( "var_highlight" => "on", + "var_chat" => "on", + "var_shuffle" => "off", + "var_buffer_autoset" => "off", + "var_look_highlight" => "off", + "var_look_highlight_regex" => "off", + "var_hotlist_max_level_nicks_add" => "off", + "zahl" => 0, + "default_version" => 0, + "prefix_action" => "", + "var_blacklist_channels" => "", +); +my @var_blacklist_channels = ""; + +my $nick_mode = ""; + +# standard colours. +my %colours = (0 => "darkgray", 1 => "red", 2 => "lightred", 3 => "green", + 4 => "lightgreen", 5 => "brown", 6 => "yellow", 7 => "blue", + 8 => "lightblue", 9 => "magenta", 10 => "lightmagenta", 11 => "cyan", + 12 => "lightcyan", 13 => "white"); + +# program starts here +sub colorize_cb { +my ( $data, $modifier, $modifier_data, $string ) = @_; + +if (index($modifier_data,"irc_privmsg") == -1){ # its neither a channel nor a query buffer + return $string; +} + +if ($default_options{var_highlight} eq "off" and $default_options{var_chat} eq "off"){ # all options OFF + return $string; +} + +$modifier_data =~ (m/irc;(.+?)\.(.+?)\;/); # irc;servername.channelname; +my ($t0, $t1 , $t2) = split(/;/,$modifier_data); +#$t1 =~ m/^(.+)\.(.+)$/; +my $servername = $1; +my $channel_name = $2; + + +if ( grep /^$servername.$channel_name$/, @var_blacklist_channels ) { # check for blacklist_channels + return $string; +} + +my $my_nick = weechat::info_get( 'irc_nick', $servername ); # get nick with servername (;freenode.) + +$string =~ m/^(.*)\t(.*)/; # get the nick name: nick[tab]string +my $nick = $1; # nick with nick_mode and color codes +my $line = $2; # get written text +$line = weechat::string_remove_color($line,""); # remove color-codes from line, first + +$modifier_data =~ m/nick_(.*),/; # get the nick name from modifier_data (without nick_mode and color codes!) +$nick = $1; + +# recreate irc.look.nick_suffix and irc.color.nick_suffix +my $nick_suffix_with_color = ""; +my $nick_suffix = weechat::config_string( weechat::config_get("irc.look.nick_suffix")); +if ( $nick_suffix ne "" ){ + my $nick_suffix_color = weechat::color( weechat::config_color( weechat::config_get( "irc.color.nick_suffix" ))); + $nick_suffix_with_color = $nick_suffix_color . $nick_suffix; +} + +# check for action (/me) +my $prefix_action_with_color = ""; +if (index($modifier_data,"irc_action") >= 0){ + my $prefix_action_color = weechat::color( weechat::config_color( weechat::config_get( "weechat.color.chat_prefix_action" ))); + my $prefix_action = weechat::config_string( weechat::config_get("weechat.look.prefix_action")); + $prefix_action_with_color = $prefix_action_color . $prefix_action; +} + +# check if look.nickmode is ON and no prefix and no query buffer +$nick_mode = ""; +if ( weechat::config_boolean(weechat::config_get("weechat.look.nickmode")) == 1 and ($nick ne $default_options{prefix_action}) and (index($modifier_data,"notify_private")) == -1){ +# if ($nick =~ m/^\@|^\%|^\+|^\~|^\*|^\&|^\!|^\-/) { # check for nick modes (@%+~*&!-) without colour + my $buf_pointer = weechat::buffer_search("irc",$servername . "." . $channel_name); + my $nick_pointer = weechat::nicklist_search_nick($buf_pointer,"",$nick); + $nick_mode = weechat::nicklist_nick_get_string($buf_pointer,$nick_pointer,"prefix"); + my $color_mode = weechat::color( weechat::config_string( weechat::config_get( weechat::nicklist_nick_get_string($buf_pointer,$nick_pointer,"prefix_color") ) ) ); + if ( $nick_mode eq " " or $color_mode eq ""){ # no nick_mode! + $nick_mode = ""; + }else{ # nick_mode exists + $nick_mode = $color_mode . $nick_mode; + } +} + +# i wrote the message + if ($nick eq $my_nick ){ # i wrote the message + if ($default_options{var_chat} eq "on"){ + my $nick_color = weechat::config_color(weechat::config_get("weechat.color.chat_nick_self")); # get my nick color + $nick_color = weechat::color($nick_color); + $line = colorize_nicks($nick_color,$modifier_data,$line); + + if (index($modifier_data,"irc_action") >= 0){ + $nick = $prefix_action_with_color; + }else{ + $nick = $nick . $nick_suffix_with_color; + } + $line = $nick_mode . $nick_color . $nick . "\t" . $nick_color . $line . weechat::color('reset'); + return $line; + }else{ + return $string; + } + } + +# get nick color +$nick = weechat::string_remove_color($nick,""); # remove colour-codes from nick +my $nick_color = weechat::info_get('irc_nick_color', $nick); # get nick-colour + + my $var_hl_max_level_nicks_add = 0; +# highlight message received? + if ($default_options{var_highlight} eq "on"){ # highlight_mode on? + if ( $default_options{var_buffer_autoset} eq "on" || $default_options{var_look_highlight} eq "on" ){# buffer_autoset or look_highlight "on"? + my $highlight_words = ""; + + # get strings from buffer_autoset and/or weechat.look.highlight and weechat.look.highlight_regex + if ($default_options{var_buffer_autoset} eq "on"){ + my $highlight_words_add = weechat::config_string(weechat::config_get("buffer_autoset.buffer.irc.".$servername.".".$channel_name.".highlight_words_add")); + $highlight_words .= $highlight_words_add . ","; + } + + if ($default_options{var_look_highlight} eq "on"){ + my $look_highlight = weechat::config_string( weechat::config_get("weechat.look.highlight") ); + $highlight_words .= $look_highlight; + } + if ( $default_options{var_hotlist_max_level_nicks_add} eq "on" and weechat::config_string(weechat::config_get("buffer_autoset.buffer.irc.".$servername.".".$channel_name.".hotlist_max_level_nicks_add")) =~ /$nick\:[0-2]/ ){ + $var_hl_max_level_nicks_add = 1; + } + + # kill "," at end of string + $/ = ","; + chomp($highlight_words); + + foreach ( split( /,+/, $highlight_words ) ) { # check for highlight_words + if ($_ eq ""){next;} # ignore empty string + my $search_string = shell2regex($_); + + if ($string =~ m/\b$search_string\b/gi){ # i (ignorecase) + my $color_highlight = weechat::config_color(weechat::config_get("weechat.color.chat_highlight")); + my $color_highlight_bg = weechat::config_color(weechat::config_get("weechat.color.chat_highlight_bg")); + my $high_color = weechat::color("$color_highlight,$color_highlight_bg"); + if (index($modifier_data,"irc_action") >= 0){ + $line = colorize_nicks($high_color,$modifier_data,$line); + $nick = $prefix_action_with_color; + $line = $high_color . $nick . "\t" . $high_color . $line . weechat::color('reset'); + return $line; + } + $line = colorize_nicks($high_color,$modifier_data,$line); + $line = $nick_mode . $high_color . $nick . $nick_suffix_with_color . "\t" . $high_color . $line . weechat::color('reset'); + return $line; + } + } + } + # buffer_autoset is off. + if (lc($string) =~ m/(\w.*$my_nick.*)/){ # my name called in string (case insensitiv)? + my $color_highlight = weechat::config_color(weechat::config_get("weechat.color.chat_highlight")); + my $color_highlight_bg = weechat::config_color(weechat::config_get("weechat.color.chat_highlight_bg")); + my $high_color = weechat::color("$color_highlight,$color_highlight_bg"); + + if (index($modifier_data,"irc_action") >= 0){ # action used (/me) + $line = colorize_nicks($high_color,$modifier_data,$line); + $nick = $prefix_action_with_color; + $line = $high_color . $nick . "\t" . $high_color . $line . weechat::color('reset'); + return $line; + } + +# highlight whole line + if ( $var_hl_max_level_nicks_add eq 0 ){ + $line = colorize_nicks($high_color,$modifier_data,$line); + $line = $nick_mode . $high_color . $nick . $nick_suffix_with_color . "\t" . $high_color . $line . weechat::color('reset'); + return $line; + } + } + } # highlight area finished + +# simple channel message + if ($default_options{var_chat} eq "on"){ # chat_mode on? + if ($default_options{var_shuffle} eq "on"){ # color_shuffle on? + my $zahl2 = 0; + my $my_color = weechat::config_color(weechat::config_get("weechat.color.chat_nick_self")); # get my own nick colour + for (1){ # get a random colour but don't use + redo if ( $default_options{zahl} == ($zahl2 = int(rand(14))) or ($colours{$zahl2} eq $my_color) ); # latest color nor own nick color + $default_options{zahl} = $zahl2; + } + $nick_color = weechat::color($colours{$default_options{zahl}}); # get new random color + } + +# check for weechat version and use weechat.look.highlight_regex option + if ( $default_options{default_version} eq 1 ){ # weechat is >= 0.3.4? + if ( $default_options{var_look_highlight_regex} eq "on" ){ + if ( weechat::string_has_highlight_regex($line,weechat::config_string(weechat::config_get("weechat.look.highlight_regex"))) eq 1 ){ + my $color_highlight = weechat::config_color(weechat::config_get("weechat.color.chat_highlight")); + my $color_highlight_bg = weechat::config_color(weechat::config_get("weechat.color.chat_highlight_bg")); + my $high_color = weechat::color("$color_highlight,$color_highlight_bg"); + $line = colorize_nicks($high_color,$modifier_data,$line); + $line = $nick_mode . $high_color . $nick . $nick_suffix_with_color . "\t" . $high_color . $line . weechat::color('reset'); + return $line; + } + } + } + if (index($modifier_data,"irc_action") >= 0){ +# if ($default_options{prefix_action} eq $nick){ + my $nick_color = weechat::info_get('irc_nick_color', $nick); # get nick-color + $line = colorize_nicks($nick_color,$modifier_data,$line); + $nick = $prefix_action_with_color; + $line = $nick . "\t" . $nick_color . $line . weechat::color('reset'); + return $line; + } + + $line = colorize_nicks($nick_color,$modifier_data,$line); + $line = $nick_mode . $nick_color . $nick . $nick_suffix_with_color . "\t" . $nick_color . $line . weechat::color('reset'); # create new line nick_color+nick+separator+text + return $line; + }else{ + return $string; # return original string + } +} # end of sub colorize_cb{} + +# converts shell wildcard characters to regex +sub shell2regex { + my $globstr = shift; + my %patmap = ( + '*' => '.*', + '?' => '.', + '[' => '[', + ']' => ']', + ); + $globstr =~ s{(.)} { $patmap{$1} || "\Q$1" }ge; + return $globstr; +} + +# check for colorize_nicks script an set colour before and after nick name +sub colorize_nicks{ +my ( $nick_color, $mf_data, $line ) = @_; + +my $pyth_ptn = weechat::infolist_get("python_script","","colorize_nicks"); +weechat::infolist_next($pyth_ptn); + +if ( "colorize_nicks" eq weechat::infolist_string($pyth_ptn,"name") ){ # does colorize_nicks is installed? + $line = weechat::hook_modifier_exec( "colorize_nicks",$mf_data,$line); # call colorize_nicks function and color the nick(s) + my @array = ""; + my $color_code_reset = weechat::color('reset'); + @array=split(/$color_code_reset/,$line); + my $new_line = ""; + foreach (@array){ + $new_line .= $nick_color . $_ . weechat::color('reset'); + } + $new_line =~ s/\s+$//g; # remove space at end + $line = $new_line; +} +weechat::infolist_free($pyth_ptn); + +return $line; +} + +# changes in settings hooked by hook_config()? +sub toggle_config_by_set{ +my ( $pointer, $name, $value ) = @_; + $name = substr($name,length("plugins.var.perl.$prgname."),length($name)); + $default_options{"var_" . $name} = $value; + + if ( $name eq "blacklist_channels" ){ + @var_blacklist_channels = ""; + @var_blacklist_channels = split( /,/, $default_options{"var_" . $name} ); + } + +return weechat::WEECHAT_RC_OK ; +} + +# toggle functions on/off manually +sub change_settings{ +my $getarg = lc($_[2]); # switch to lower-case + + if ($getarg eq "highlight"){ + if ($default_options{var_highlight} eq "on"){ + weechat::config_set_plugin("highlight", "off"); + } else{ + weechat::config_set_plugin("highlight", "on"); + } + return weechat::WEECHAT_RC_OK; + } + + if ($getarg eq "autoset"){ + if ($default_options{var_buffer_autoset} eq "on"){ + weechat::config_set_plugin("buffer_autoset", "off"); + } else{ + weechat::config_set_plugin("buffer_autoset", "on"); + } + return weechat::WEECHAT_RC_OK; + } + + if ($getarg eq "lookhighlight"){ + if ($default_options{var_look_highlight} eq "on"){ + weechat::config_set_plugin("look_highlight", "off"); + } else{ + weechat::config_set_plugin("look_highlight", "on"); + } + return weechat::WEECHAT_RC_OK; + } + + if ($getarg eq "lookhighlight_regex"){ + if ($default_options{var_look_highlight_regex} eq "on"){ + weechat::config_set_plugin("look_highlight_regex", "off"); + } else{ + weechat::config_set_plugin("look_highlight_regex", "on"); + } + return weechat::WEECHAT_RC_OK; + } + + if ($getarg eq "hotlist"){ + if ($default_options{var_hotlist_max_level_nicks_add} eq "on"){ + weechat::config_set_plugin("hotlist_max_level_nicks_add", "off"); + } else{ + weechat::config_set_plugin("hotlist_max_level_nicks_add", "on"); + } + return weechat::WEECHAT_RC_OK; + } + + if ($getarg eq "chat"){ + if ($default_options{var_chat} eq "on"){ + weechat::config_set_plugin("chat", "off"); + } else{ + weechat::config_set_plugin("chat", "on"); + } + return weechat::WEECHAT_RC_OK; + } + + if ($getarg eq "shuffle"){ + if ($default_options{var_shuffle} eq "on"){ + weechat::config_set_plugin("shuffle", "off"); + } else{ + weechat::config_set_plugin("shuffle", "on"); + } + return weechat::WEECHAT_RC_OK; + } +weechat::command("", "/help $prgname"); # no arguments given. Print help +return weechat::WEECHAT_RC_OK; +} + +# main routine +# first function called by a WeeChat-script. +weechat::register($prgname, "Nils Görs ", $version, + "GPL3", $description, "", ""); + + if (!weechat::config_is_set_plugin("highlight")){ + weechat::config_set_plugin("highlight", $default_options{var_highlight}); + }else{ + $default_options{var_highlight} = weechat::config_get_plugin("highlight"); + } + if (!weechat::config_is_set_plugin("buffer_autoset")){ + weechat::config_set_plugin("buffer_autoset", $default_options{var_buffer_autoset}); + }else{ + $default_options{var_buffer_autoset} = weechat::config_get_plugin("buffer_autoset"); + } + if (!weechat::config_is_set_plugin("hotlist_max_level_nicks_add")){ + weechat::config_set_plugin("hotlist_max_level_nicks_add", $default_options{var_hotlist_max_level_nicks_add}); + }else{ + $default_options{var_hotlist_max_level_nicks_add} = weechat::config_get_plugin("hotlist_max_level_nicks_add"); + } + if (!weechat::config_is_set_plugin("look_highlight")){ + weechat::config_set_plugin("look_highlight", $default_options{var_look_highlight}); + }else{ + $default_options{var_look_highlight} = weechat::config_get_plugin("look_highlight"); + } + if (!weechat::config_is_set_plugin("look_highlight_regex")){ + weechat::config_set_plugin("look_highlight_regex", $default_options{var_look_highlight_regex}); + }else{ + $default_options{var_look_highlight_regex} = weechat::config_get_plugin("look_highlight_regex"); + } + if (!weechat::config_is_set_plugin("chat")){ + weechat::config_set_plugin("chat", $default_options{var_chat}); + }else{ + $default_options{var_chat} = weechat::config_get_plugin("chat"); + } + if (!weechat::config_is_set_plugin("shuffle")){ + weechat::config_set_plugin("shuffle", $default_options{var_shuffle}); + }else{ + $default_options{var_shuffle} = weechat::config_get_plugin("shuffle"); + } + if (!weechat::config_is_set_plugin("blacklist_channels")){ + weechat::config_set_plugin("blacklist_channels", $default_options{var_blacklist_channels}); + }else{ + $default_options{var_blacklist_channels} = weechat::config_get_plugin("blacklist_channels"); + } + + # read nick colours if exists (>= weechat 0.3.4) in %colours + my $colours_buf = weechat::config_string(weechat::config_get("weechat.color.chat_nick_colors")); + if ( $colours_buf ne "" ) { + my @array = split(/,/,$colours_buf); + my $i = 0; + foreach (@array){ + $colours{$i++} = $_; + } + undef $colours_buf; + undef @array; + } + +$default_options{prefix_action} = weechat::config_string(weechat::config_get("weechat.look.prefix_action")); +weechat::hook_modifier("weechat_print","colorize_cb", ""); +#weechat::hook_modifier("colorize_text","colorize_cb", ""); + +# check weechat version + $default_options{default_version} = weechat::info_get("version_number", ""); + if (( $default_options{default_version} ne "" ) && ( $default_options{default_version} >= 0x00030400 )){ # v0.3.4? + $default_options{default_version} = 1; # yes! + } + +weechat::hook_command($prgname, $description, + + " ", + + " toggle highlight color in chat area (on/off)\n". + " colors the text in chat area with according nick color (on/off)\n". + " toggle shuffle color mode on/off\n". + " toggle highlight color mode for buffer_autoset on/off\n". + " toggle highlight color mode for weechat.look.highlight on/off\n". + " toggle highlight color in chat area for option weechat.look.highlight_regex on/off\n". + " toggle hotlist_max_level_nicks_add on/off\n\n". + "Options (script):\n". + " 'plugins.var.perl.$prgname.highlight' : toggle highlight color in chat area on/off.\n". + " 'plugins.var.perl.$prgname.hotlist_max_level_nicks_add' : toggle highlight for hotlist on/off\n". + " 'plugins.var.perl.$prgname.buffer_autoset' : toggle highlight color in chat area for buffer_autoset on/off\n". + " 'plugins.var.perl.$prgname.look_highlight' : toggle highlight color in chat area for option weechat.look.highlight on/off\n". + " 'plugins.var.perl.$prgname.look_highlight_regex' : toggle highlight color in chat area for option weechat.look.highlight_regex on/off\n". + " 'plugins.var.perl.$prgname.chat' : toggle colored text for chats on/off\n". + " 'plugins.var.perl.$prgname.shuffle' : toggle shuffle color mode for chats area on/off\n". + " 'plugins.var.perl.$prgname.blacklist_channels' : comma separated list with channelname (e.g.: freenode.#weechat,freenode.#weechat-fr)\n\n". + "Options (global):\n". + " 'weechat.color.chat_highlight' : highlight color\n". + " 'weechat.color.chat_highlight_bg' : highlight background color\n". + " 'weechat.color.chat_nick*' : colors for nicks\n\n". + "To use the buffer_autoset and/or hotlist_max_level_nicks_install buffer_autoset script from: http://www.weechat.org/scripts/\n", + "highlight|chat|shuffle|autoset|lookhighlight|lookhighlight_regex|hotlist", "change_settings", ""); + +weechat::hook_config( "plugins.var.perl.$prgname.*", "toggle_config_by_set", "" ); diff -r 8183cec0eac6 -r 3eb50a0fe94f weechat/plugins.conf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/weechat/plugins.conf Sun Sep 25 15:29:33 2011 -0400 @@ -0,0 +1,57 @@ +# +# plugins.conf -- weechat v0.3.5 +# + +[var] +fifo.fifo = "on" +perl.buffers.color_current = "black,green" +perl.buffers.color_default = "default" +perl.buffers.color_hotlist_highlight = "lightmagenta" +perl.buffers.color_hotlist_low = "white" +perl.buffers.color_hotlist_message = "yellow" +perl.buffers.color_hotlist_private = "lightgreen" +perl.buffers.color_number = "green" +perl.buffers.color_whitelist_buffers = "" +perl.buffers.color_whitelist_default = "" +perl.buffers.color_whitelist_highlight = "" +perl.buffers.color_whitelist_low = "" +perl.buffers.color_whitelist_message = "" +perl.buffers.color_whitelist_private = "" +perl.buffers.hide_merged_buffers = "on" +perl.buffers.indenting = "on" +perl.buffers.indenting_number = "on" +perl.buffers.short_names = "on" +perl.buffers.show_category = "off" +perl.buffers.show_number = "on" +perl.buffers.show_prefix = "off" +perl.buffers.show_prefix_empty = "on" +perl.buffers.sort = "number" +perl.check_license = "on" +perl.colorize_lines.blacklist_channels = "" +perl.colorize_lines.buffer_autoset = "off" +perl.colorize_lines.chat = "off" +perl.colorize_lines.highlight = "on" +perl.colorize_lines.hotlist_max_level_nicks_add = "off" +perl.colorize_lines.look_highlight = "off" +perl.colorize_lines.look_highlight_regex = "off" +perl.colorize_lines.shuffle = "off" +python.check_license = "on" +python.growl.hostname = "" +python.growl.icon = "icon.png" +python.growl.password = "" +python.growl.show_channel_topic = "on" +python.growl.show_dcc = "on" +python.growl.show_highlighted_message = "on" +python.growl.show_invite_message = "on" +python.growl.show_notice_message = "off" +python.growl.show_private_action_message = "on" +python.growl.show_private_message = "on" +python.growl.show_public_action_message = "off" +python.growl.show_public_message = "off" +python.growl.show_server = "on" +python.growl.show_upgrade_ended = "on" +python.growl.sticky = "off" +python.growl.sticky_away = "on" +tcl.check_license = "on" + +[desc] diff -r 8183cec0eac6 -r 3eb50a0fe94f weechat/python/autoload/growl.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/weechat/python/autoload/growl.py Sun Sep 25 15:29:33 2011 -0400 @@ -0,0 +1,463 @@ +# -*- coding: utf-8 -*- +# +# growl.py +# Copyright (c) 2011 Sorin Ionescu +# +# 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 . + + +SCRIPT_NAME = 'growl' +SCRIPT_AUTHOR = 'Sorin Ionescu ' +SCRIPT_VERSION = '1.0.0' +SCRIPT_LICENSE = 'GPL3' +SCRIPT_DESC = 'Sends Growl notifications upon events.' + +# Changelog +# +# 2011-03-27: v1.0.0 Initial release. + + +# ------------------------------------------------------------------------------ +# Settings +# ------------------------------------------------------------------------------ +SETTINGS = { + 'show_public_message' : 'off', + 'show_private_message' : 'on', + 'show_public_action_message' : 'off', + 'show_private_action_message' : 'on', + 'show_notice_message' : 'off', + 'show_invite_message' : 'on', + 'show_highlighted_message' : 'on', + 'show_server' : 'on', + 'show_channel_topic' : 'on', + 'show_dcc' : 'on', + 'show_upgrade_ended' : 'on', + 'sticky' : 'off', + 'sticky_away' : 'on', + 'hostname' : '', + 'password' : '', + 'icon' : 'icon.png', +} + + +# ------------------------------------------------------------------------------ +# Imports +# ------------------------------------------------------------------------------ +try: + import re + import os + import weechat + import Growl + IMPORT_OK = True +except ImportError as error: + IMPORT_OK = False + if str(error) == 'No module named weechat': + print('This script must be run under WeeChat.') + print('Get WeeChat at http://www.weechat.org.') + if str(error) == 'No module named Growl': + weechat.prnt('', 'Growl: Python bindings are not installed.') + + +# ------------------------------------------------------------------------------ +# Globals +# ------------------------------------------------------------------------------ +TAGGED_MESSAGES = { + 'public message or action' : set(['irc_privmsg', 'notify_message']), + 'private message or action' : set(['irc_privmsg', 'notify_private']), + 'notice message' : set(['irc_notice', 'notify_private']), + 'invite message' : set(['irc_invite', 'notify_highlight']), + 'channel topic' : set(['irc_topic',]), + 'away status' : set(['away_info',]), +} + +UNTAGGED_MESSAGES = { + 'dcc chat request' : re.compile( + r'^xfer: incoming chat request from (\w+)', + re.UNICODE), + 'dcc chat closed' : re.compile( + r'^xfer: chat closed with (\w+)', + re.UNICODE), + 'dcc get request' : re.compile( + r'^xfer: incoming file from (\w+) [^:]+: ' + + '((?:,\w|[^,])+),', + re.UNICODE), + 'dcc get completed' : re.compile( + r'^xfer: file ([^\s]+) received from \w+: OK', + re.UNICODE), + 'dcc get failed' : re.compile( + r'^xfer: file ([^\s]+) received from \w+: ' + + 'FAILED', + re.UNICODE), + 'dcc send completed' : re.compile( + r'^xfer: file ([^\s]+) sent to \w+: OK', + re.UNICODE), + 'dcc send failed' : re.compile( + r'^xfer: file ([^\s]+) sent to \w+: FAILED', + re.UNICODE), +} + +DISPATCH_TABLE = { + 'away status' : 'set_away_status', + 'public message or action' : 'notify_public_message_or_action', + 'private message or action' : 'notify_private_message_or_action', + 'notice message' : 'notify_notice_message', + 'invite message' : 'notify_invite_message', + 'channel topic' : 'notify_channel_topic', + 'dcc chat request' : 'notify_dcc_chat_request', + 'dcc chat closed' : 'notify_dcc_chat_closed', + 'dcc get request' : 'notify_dcc_get_request', + 'dcc get completed' : 'notify_dcc_get_completed', + 'dcc get failed' : 'notify_dcc_get_failed', + 'dcc send completed' : 'notify_dcc_send_completed', + 'dcc send failed' : 'notify_dcc_send_failed', +} + +STATE = { + 'growl' : None, + 'is_away' : False +} + +# ------------------------------------------------------------------------------ +# Notifiers +# ------------------------------------------------------------------------------ +def cb_irc_server_connected(data, signal, signal_data): + '''Notify when connected to IRC server.''' + if weechat.config_get_plugin('show_server') == 'on': + growl_notify( + 'Server', + 'Server Connected', + 'Connected to network {0}.'.format(signal_data)) + return weechat.WEECHAT_RC_OK + +def cb_irc_server_disconnected(data, signal, signal_data): + '''Notify when disconnected to IRC server.''' + if weechat.config_get_plugin('show_server') == 'on': + growl_notify( + 'Server', + 'Server Disconnected', + 'Disconnected from network {0}.'.format(signal_data)) + return weechat.WEECHAT_RC_OK + +def cb_notify_upgrade_ended(data, signal, signal_data): + '''Notify on end of WeeChat upgrade.''' + if weechat.config_get_plugin('show_upgrade_ended') == 'on': + growl_notify( + 'WeeChat', + 'WeeChat Upgraded', + 'WeeChat has been upgraded.') + return weechat.WEECHAT_RC_OK + +def notify_highlighted_message(prefix, message): + '''Notify on highlighted message.''' + if weechat.config_get_plugin("show_highlighted_message") == "on": + growl_notify( + 'Highlight', + 'Highlighted Message', + "{0}: {1}".format(prefix, message), + priority=2) + +def notify_public_message_or_action(prefix, message, highlighted): + '''Notify on public message or action.''' + if prefix == ' *': + regex = re.compile(r'^(\w+) (.+)$', re.UNICODE) + match = regex.match(message) + if match: + prefix = match.group(1) + message = match.group(2) + notify_public_action_message(prefix, message, highlighted) + else: + if highlighted: + notify_highlighted_message(prefix, message) + else: + if weechat.config_get_plugin("show_public_message") == "on": + growl_notify( + 'Public', + 'Public Message', + '{0}: {1}'.format(prefix, message)) + +def notify_private_message_or_action(prefix, message, highlighted): + '''Notify on private message or action.''' + regex = re.compile(r'^CTCP_MESSAGE.+?ACTION (.+)$', re.UNICODE) + match = regex.match(message) + if match: + notify_private_action_message(prefix, match.group(1), highlighted) + else: + if prefix == ' *': + regex = re.compile(r'^(\w+) (.+)$', re.UNICODE) + match = regex.match(message) + if match: + prefix = match.group(1) + message = match.group(2) + notify_private_action_message(prefix, message, highlighted) + else: + if highlighted: + notify_highlighted_message(prefix, message) + else: + if weechat.config_get_plugin("show_private_message") == "on": + growl_notify( + 'Private', + 'Private Message', + '{0}: {1}'.format(prefix, message)) + +def notify_public_action_message(prefix, message, highlighted): + '''Notify on public action message.''' + if weechat.config_get_plugin("show_public_action_message") == "on": + if highlighted: + notify_highlighted_message(prefix, message) + else: + growl_notify( + 'Action', + 'Public Action Message', + '{0}: {1}'.format(prefix, message), + priority=1) + +def notify_private_action_message(prefix, message, highlighted): + '''Notify on private action message.''' + if weechat.config_get_plugin("show_private_action_message") == "on": + if highlighted: + notify_highlighted_message(prefix, message) + else: + growl_notify( + 'Action', + 'Private Action Message', + '{0}: {1}'.format(prefix, message), + priority=1) + +def notify_notice_message(prefix, message, highlighted): + '''Notify on notice message.''' + if weechat.config_get_plugin("show_notice_message") == "on": + regex = re.compile(r'^([^\s]*) [^:]*: (.+)$', re.UNICODE) + match = regex.match(message) + if match: + prefix = match.group(1) + message = match.group(2) + if highlighted: + notify_highlighted_message(prefix, message) + else: + growl_notify( + 'Notice', + 'Notice Message', + '{0}: {1}'.format(prefix, message)) + +def notify_invite_message(prefix, message, highlighted): + '''Notify on channel invitation message.''' + if weechat.config_get_plugin("show_invite_message") == "on": + regex = re.compile( + r'^You have been invited to ([^\s]+) by ([^\s]+)$', re.UNICODE) + match = regex.match(message) + if match: + channel = match.group(1) + nick = match.group(2) + growl_notify( + 'Invite', + 'Channel Invitation', + '{0} has invited you to join {1}.'.format(nick, channel)) + +def notify_channel_topic(prefix, message, highlighted): + '''Notify on channel topic change.''' + if weechat.config_get_plugin("show_channel_topic") == "on": + regex = re.compile( + r'^\w+ has (?:changed|unset) topic for ([^\s]+)'+ + '(?:(?: from "(?:(?:"\w|[^"])+)")? to "((?:"\w|[^"])+)")?', + re.UNICODE) + match = regex.match(message) + if match: + channel = match.group(1) + topic = match.group(2) or '' + growl_notify( + 'Channel', + 'Channel Topic', + "{0}: {1}".format(channel, topic)) + +def notify_dcc_chat_request(match): + '''Notify on DCC chat request.''' + if weechat.config_get_plugin("show_dcc") == "on": + nick = match.group(1) + growl_notify( + 'DCC', + 'Direct Chat Request', + '{0} wants to chat directly.'.format(nick)) + +def notify_dcc_chat_closed(match): + '''Notify on DCC chat termination.''' + if weechat.config_get_plugin("show_dcc") == "on": + nick = match.group(1) + growl_notify( + 'DCC', + 'Direct Chat Ended', + 'Direct chat with {0} has ended.'.format(nick)) + +def notify_dcc_get_request(match): + 'Notify on DCC get request.' + if weechat.config_get_plugin("show_dcc") == "on": + nick = match.group(1) + file_name = match.group(2) + growl_notify( + 'DCC', + 'File Transfer Request', + '{0} wants to send you {1}.'.format(nick, file_name)) + +def notify_dcc_get_completed(match): + 'Notify on DCC get completion.' + if weechat.config_get_plugin("show_dcc") == "on": + file_name = match.group(1) + growl_notify('DCC', 'Download Complete', file_name) + +def notify_dcc_get_failed(match): + 'Notify on DCC get failure.' + if weechat.config_get_plugin("show_dcc") == "on": + file_name = match.group(1) + growl_notify('DCC', 'Download Failed', file_name) + +def notify_dcc_send_completed(match): + 'Notify on DCC send completion.' + if weechat.config_get_plugin("show_dcc") == "on": + file_name = match.group(1) + growl_notify('DCC', 'Upload Complete', file_name) + +def notify_dcc_send_failed(match): + 'Notify on DCC send failure.' + if weechat.config_get_plugin("show_dcc") == "on": + file_name = match.group(1) + growl_notify('DCC', 'Upload Failed', file_name) + + +# ------------------------------------------------------------------------------ +# Utility +# ------------------------------------------------------------------------------ +def set_away_status(prefix, message, highlighted): + '''Sets away status for use by sticky notifications.''' + regex = re.compile(r'^\[\w+ \b(away|back)\b:', re.UNICODE) + match = regex.match(message) + if match: + status = match.group(1) + if status == 'away': + STATE['is_away'] = True + if status == 'back': + STATE['is_away'] = False + +def cb_process_message( + data, + wbuffer, + date, + tags, + displayed, + highlight, + prefix, + message +): + '''Delegates incoming messages to appropriate handlers.''' + tags = set(tags.split(',')) + functions = globals() + is_public_message = tags.issuperset( + TAGGED_MESSAGES['public message or action']) + buffer_name = weechat.buffer_get_string(wbuffer, 'name') + dcc_buffer_regex = re.compile(r'^irc_dcc\.', re.UNICODE) + dcc_buffer_match = dcc_buffer_regex.match(buffer_name) + highlighted = False + if highlight == "1": + highlighted = True + # Private DCC message identifies itself as public. + if is_public_message and dcc_buffer_match: + notify_private_message_or_action(prefix, message, highlighted) + return weechat.WEECHAT_RC_OK + # Pass identified, untagged message to its designated function. + for key, value in UNTAGGED_MESSAGES.items(): + match = value.match(message) + if match: + functions[DISPATCH_TABLE[key]](match) + return weechat.WEECHAT_RC_OK + # Pass identified, tagged message to its designated function. + for key, value in TAGGED_MESSAGES.items(): + if tags.issuperset(value): + functions[DISPATCH_TABLE[key]](prefix, message, highlighted) + return weechat.WEECHAT_RC_OK + return weechat.WEECHAT_RC_OK + +def growl_notify(notification, title, description, priority=None): + '''Returns whether Growl notifications should be sticky.''' + growl = STATE['growl'] + is_away = STATE['is_away'] + is_sticky = False + if weechat.config_get_plugin('sticky') == 'on': + is_sticky = True + if weechat.config_get_plugin('sticky_away') == 'on' and is_away: + is_sticky = True + growl.notify(notification, title, description, '', is_sticky, priority) + + +# ------------------------------------------------------------------------------ +# Main +# ------------------------------------------------------------------------------ +def main(): + '''Sets up WeeChat Growl notifications.''' + # Initialize options. + for option, value in SETTINGS.items(): + if not weechat.config_is_set_plugin(option): + weechat.config_set_plugin(option, value) + # Initialize Growl. + name = "WeeChat" + hostname = weechat.config_get_plugin('hostname') + password = weechat.config_get_plugin('password') + icon = Growl.Image.imageFromPath( + os.path.join( + weechat.info_get("weechat_dir", ""), + weechat.config_get_plugin('icon'))) + notifications = [ + 'Public', + 'Private', + 'Action', + 'Notice', + 'Invite', + 'Highlight', + 'Server', + 'Channel', + 'DCC', + 'WeeChat' + ] + if len(hostname) == 0: + hostname = None + if len(password) == 0: + password = None + growl = Growl.GrowlNotifier( + applicationName=name, + hostname=hostname, + password=password, + notifications=notifications, + applicationIcon=icon) + growl.register() + STATE['growl'] = growl + # Register hooks. + weechat.hook_signal( + 'irc_server_connected', + 'cb_irc_server_connected', + '') + weechat.hook_signal( + 'irc_server_disconnected', + 'cb_irc_server_disconnected', + '') + weechat.hook_signal('upgrade_ended', 'cb_upgrade_ended', '') + weechat.hook_print('', '', '', 1, 'cb_process_message', '') + +if __name__ == '__main__' and IMPORT_OK and weechat.register( + SCRIPT_NAME, + SCRIPT_AUTHOR, + SCRIPT_VERSION, + SCRIPT_LICENSE, + SCRIPT_DESC, + '', + '' +): + main() + diff -r 8183cec0eac6 -r 3eb50a0fe94f weechat/relay.conf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/weechat/relay.conf Sun Sep 25 15:29:33 2011 -0400 @@ -0,0 +1,24 @@ +# +# relay.conf -- weechat v0.3.5 +# + +[look] +auto_open_buffer = on +raw_messages = 256 + +[color] +status_active = lightblue +status_auth_failed = lightred +status_connecting = yellow +status_disconnected = lightred +status_waiting_auth = brown +text = default +text_bg = default +text_selected = white + +[network] +bind_address = "" +max_clients = 5 +password = "" + +[port] diff -r 8183cec0eac6 -r 3eb50a0fe94f weechat/rmodifier.conf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/weechat/rmodifier.conf Sun Sep 25 15:29:33 2011 -0400 @@ -0,0 +1,11 @@ +# +# rmodifier.conf -- weechat v0.3.5 +# + +[look] +hide_char = "*" + +[modifier] +nickserv = "history_add,input_text_display;^(/(msg|quote) +nickserv +(identify|ghost \S+) +)(.*);1,4*" +oper = "history_add,input_text_display;^(/oper +\S+ +)(.*);1,2*" +set_pass = "history_add;^(/set +\S*password\S* +)(.*);1,2*" diff -r 8183cec0eac6 -r 3eb50a0fe94f weechat/weechat.conf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/weechat/weechat.conf Sun Sep 25 15:29:33 2011 -0400 @@ -0,0 +1,455 @@ +# +# weechat.conf -- weechat v0.3.5 +# + +[debug] + +[startup] +command_after_plugins = "" +command_before_plugins = "" +display_logo = on +display_version = on + +[look] +align_end_of_lines = message +buffer_notify_default = all +buffer_time_format = "%H:%M:%S" +color_pairs_auto_reset = 5 +color_real_white = off +command_chars = "" +confirm_quit = off +day_change = on +day_change_time_format = "%a, %d %b %Y" +highlight = "sjl" +highlight_regex = "sjl" +highlight_tags = "" +hline_char = "-" +hotlist_add_buffer_if_away = on +hotlist_buffer_separator = ", " +hotlist_count_max = 2 +hotlist_count_min_msg = 2 +hotlist_names_count = 3 +hotlist_names_length = 0 +hotlist_names_level = 12 +hotlist_names_merged_buffers = off +hotlist_short_names = on +hotlist_sort = group_time_asc +hotlist_unique_numbers = on +input_cursor_scroll = 20 +input_share = none +input_share_overwrite = off +input_undo_max = 32 +item_time_format = "%H:%M" +jump_current_to_previous_buffer = on +jump_previous_buffer_when_closing = on +nickmode = on +nickmode_empty = off +paste_max_lines = 3 +prefix_action = " *" +prefix_align = right +prefix_align_max = 15 +prefix_align_min = 0 +prefix_align_more = on +prefix_buffer_align = right +prefix_buffer_align_max = 0 +prefix_buffer_align_more = on +prefix_error = "=!=" +prefix_join = "-->" +prefix_network = "--" +prefix_quit = "<--" +prefix_suffix = "|" +read_marker = line +read_marker_always_show = off +read_marker_string = "- " +save_config_on_exit = on +save_layout_on_exit = none +scroll_amount = 3 +scroll_page_percent = 100 +search_text_not_found_alert = on +set_title = on +time_format = "%a, %d %b %Y %T" + +[palette] + +[color] +bar_more = lightmagenta +chat = default +chat_bg = default +chat_buffer = white +chat_channel = white +chat_delimiters = green +chat_highlight = lightmagenta +chat_highlight_bg = default +chat_host = cyan +chat_nick = lightcyan +chat_nick_colors = "cyan,magenta,green,brown,lightblue,default,lightcyan,lightmagenta,lightgreen,blue" +chat_nick_other = cyan +chat_nick_self = white +chat_prefix_action = white +chat_prefix_buffer = brown +chat_prefix_error = yellow +chat_prefix_join = lightgreen +chat_prefix_more = lightmagenta +chat_prefix_network = magenta +chat_prefix_quit = lightred +chat_prefix_suffix = green +chat_read_marker = magenta +chat_read_marker_bg = default +chat_server = brown +chat_text_found = yellow +chat_text_found_bg = lightmagenta +chat_time = default +chat_time_delimiters = brown +chat_value = cyan +input_actions = lightgreen +input_text_not_found = red +nicklist_away = cyan +nicklist_group = green +nicklist_offline = blue +separator = blue +status_count_highlight = magenta +status_count_msg = brown +status_count_other = default +status_count_private = green +status_data_highlight = lightmagenta +status_data_msg = yellow +status_data_other = default +status_data_private = lightgreen +status_filter = green +status_more = yellow +status_name = white +status_name_ssl = lightgreen +status_number = yellow +status_time = default + +[completion] +default_template = "%(nicks)|%(irc_channels)" +nick_add_space = on +nick_completer = ":" +nick_first_only = off +nick_ignore_chars = "[]`_-^" +partial_completion_alert = on +partial_completion_command = off +partial_completion_command_arg = off +partial_completion_count = on +partial_completion_other = off + +[history] +display_default = 5 +max_commands = 100 +max_lines = 4096 +max_visited_buffers = 50 + +[proxy] + +[network] +gnutls_ca_file = "%h/ssl/CAs.pem" +gnutls_handshake_timeout = 30 + +[plugin] +autoload = "*" +debug = off +extension = ".so" +path = "%h/plugins" +save_config_on_unload = on + +[bar] +buffers.color_bg = default +buffers.color_delim = default +buffers.color_fg = default +buffers.conditions = "" +buffers.filling_left_right = vertical +buffers.filling_top_bottom = horizontal +buffers.hidden = off +buffers.items = "buffers" +buffers.position = left +buffers.priority = 0 +buffers.separator = on +buffers.size = 0 +buffers.size_max = 0 +buffers.type = root +input.color_bg = default +input.color_delim = cyan +input.color_fg = default +input.conditions = "" +input.filling_left_right = vertical +input.filling_top_bottom = horizontal +input.hidden = off +input.items = "[input_prompt]+(away),[input_search],[input_paste],input_text" +input.position = bottom +input.priority = 1000 +input.separator = off +input.size = 1 +input.size_max = 0 +input.type = window +nicklist.color_bg = default +nicklist.color_delim = cyan +nicklist.color_fg = default +nicklist.conditions = "nicklist" +nicklist.filling_left_right = vertical +nicklist.filling_top_bottom = columns_vertical +nicklist.hidden = on +nicklist.items = "buffer_nicklist" +nicklist.position = right +nicklist.priority = 200 +nicklist.separator = on +nicklist.size = 0 +nicklist.size_max = 0 +nicklist.type = window +status.color_bg = blue +status.color_delim = cyan +status.color_fg = default +status.conditions = "" +status.filling_left_right = vertical +status.filling_top_bottom = horizontal +status.hidden = off +status.items = "[time],[buffer_count],[buffer_plugin],buffer_number+:+buffer_name+{buffer_nicklist_count}+buffer_filter,[lag],[hotlist],completion,scroll" +status.position = bottom +status.priority = 500 +status.separator = off +status.size = 1 +status.size_max = 0 +status.type = window +title.color_bg = blue +title.color_delim = cyan +title.color_fg = default +title.conditions = "" +title.filling_left_right = vertical +title.filling_top_bottom = horizontal +title.hidden = off +title.items = "buffer_title" +title.position = top +title.priority = 500 +title.separator = off +title.size = 1 +title.size_max = 0 +title.type = window + +[layout] + +[notify] + +[filter] +irc_smart = on;*;irc_smart_filter;* +nicks = on;*;irc_366;* + +[key] +ctrl-? = "/input delete_previous_char" +ctrl-A = "/input move_beginning_of_line" +ctrl-B = "/input move_previous_char" +ctrl-Cb = "/input insert \x02" +ctrl-Cc = "/input insert \x03" +ctrl-Ci = "/input insert \x1D" +ctrl-Co = "/input insert \x0F" +ctrl-Cr = "/input insert \x12" +ctrl-Cu = "/input insert \x15" +ctrl-D = "/input delete_next_char" +ctrl-E = "/input move_end_of_line" +ctrl-F = "/input move_next_char" +ctrl-H = "/input delete_previous_char" +ctrl-I = "/input complete_next" +ctrl-J = "/input return" +ctrl-K = "/input delete_end_of_line" +ctrl-L = "/window refresh" +ctrl-M = "/input return" +ctrl-N = "/buffer +1" +ctrl-P = "/buffer -1" +ctrl-R = "/input search_text" +ctrl-Sctrl-U = "/input set_unread" +ctrl-T = "/input transpose_chars" +ctrl-U = "/input delete_beginning_of_line" +ctrl-W = "/input delete_previous_word" +ctrl-X = "/input switch_active_buffer" +ctrl-Y = "/input clipboard_paste" +meta-0 = "/buffer *10" +meta-1 = "/buffer *1" +meta-2 = "/buffer *2" +meta-3 = "/buffer *3" +meta-4 = "/buffer *4" +meta-5 = "/buffer *5" +meta-6 = "/buffer *6" +meta-7 = "/buffer *7" +meta-8 = "/buffer *8" +meta-9 = "/buffer *9" +meta-< = "/input jump_previously_visited_buffer" +meta-= = "/filter toggle" +meta-> = "/input jump_next_visited_buffer" +meta-OA = "/input history_global_previous" +meta-OB = "/input history_global_next" +meta-OC = "/input move_next_word" +meta-OD = "/input move_previous_word" +meta-OF = "/input move_end_of_line" +meta-OH = "/input move_beginning_of_line" +meta-Oa = "/input history_global_previous" +meta-Ob = "/input history_global_next" +meta-Oc = "/input move_next_word" +meta-Od = "/input move_previous_word" +meta2-15~ = "/buffer -1" +meta2-17~ = "/buffer +1" +meta2-18~ = "/window -1" +meta2-19~ = "/window +1" +meta2-1;3A = "/buffer -1" +meta2-1;3B = "/buffer +1" +meta2-1;3C = "/buffer +1" +meta2-1;3D = "/buffer -1" +meta2-1;5A = "/input history_global_previous" +meta2-1;5B = "/input history_global_next" +meta2-1~ = "/input move_beginning_of_line" +meta2-20~ = "/bar scroll title * x-50%" +meta2-21~ = "/bar scroll title * x+50%" +meta2-23~ = "/bar scroll nicklist * y-100%" +meta2-24~ = "/bar scroll nicklist * y+100%" +meta2-3~ = "/input delete_next_char" +meta2-4~ = "/input move_end_of_line" +meta2-5;3~ = "/window scroll_up" +meta2-5~ = "/window page_up" +meta2-6;3~ = "/window scroll_down" +meta2-6~ = "/window page_down" +meta2-7~ = "/input move_beginning_of_line" +meta2-8~ = "/input move_end_of_line" +meta2-A = "/input history_previous" +meta2-B = "/input history_next" +meta2-C = "/input move_next_char" +meta2-D = "/input move_previous_char" +meta2-F = "/input move_end_of_line" +meta2-G = "/window page_down" +meta2-H = "/input move_beginning_of_line" +meta2-I = "/window page_up" +meta2-Z = "/input complete_previous" +meta-meta2-1~ = "/window scroll_top" +meta-meta2-23~ = "/bar scroll nicklist * yb" +meta-meta2-24~ = "/bar scroll nicklist * ye" +meta-meta2-4~ = "/window scroll_bottom" +meta-meta2-5~ = "/window scroll_up" +meta-meta2-6~ = "/window scroll_down" +meta-meta2-7~ = "/window scroll_top" +meta-meta2-8~ = "/window scroll_bottom" +meta-meta2-A = "/buffer -1" +meta-meta2-B = "/buffer +1" +meta-meta2-C = "/buffer +1" +meta-meta2-D = "/buffer -1" +meta-_ = "/input redo" +meta-a = "/input jump_smart" +meta-b = "/input move_previous_word" +meta-d = "/input delete_next_word" +meta-f = "/input move_next_word" +meta-h = "/input hotlist_clear" +meta-j01 = "/buffer 1" +meta-j02 = "/buffer 2" +meta-j03 = "/buffer 3" +meta-j04 = "/buffer 4" +meta-j05 = "/buffer 5" +meta-j06 = "/buffer 6" +meta-j07 = "/buffer 7" +meta-j08 = "/buffer 8" +meta-j09 = "/buffer 9" +meta-j10 = "/buffer 10" +meta-j11 = "/buffer 11" +meta-j12 = "/buffer 12" +meta-j13 = "/buffer 13" +meta-j14 = "/buffer 14" +meta-j15 = "/buffer 15" +meta-j16 = "/buffer 16" +meta-j17 = "/buffer 17" +meta-j18 = "/buffer 18" +meta-j19 = "/buffer 19" +meta-j20 = "/buffer 20" +meta-j21 = "/buffer 21" +meta-j22 = "/buffer 22" +meta-j23 = "/buffer 23" +meta-j24 = "/buffer 24" +meta-j25 = "/buffer 25" +meta-j26 = "/buffer 26" +meta-j27 = "/buffer 27" +meta-j28 = "/buffer 28" +meta-j29 = "/buffer 29" +meta-j30 = "/buffer 30" +meta-j31 = "/buffer 31" +meta-j32 = "/buffer 32" +meta-j33 = "/buffer 33" +meta-j34 = "/buffer 34" +meta-j35 = "/buffer 35" +meta-j36 = "/buffer 36" +meta-j37 = "/buffer 37" +meta-j38 = "/buffer 38" +meta-j39 = "/buffer 39" +meta-j40 = "/buffer 40" +meta-j41 = "/buffer 41" +meta-j42 = "/buffer 42" +meta-j43 = "/buffer 43" +meta-j44 = "/buffer 44" +meta-j45 = "/buffer 45" +meta-j46 = "/buffer 46" +meta-j47 = "/buffer 47" +meta-j48 = "/buffer 48" +meta-j49 = "/buffer 49" +meta-j50 = "/buffer 50" +meta-j51 = "/buffer 51" +meta-j52 = "/buffer 52" +meta-j53 = "/buffer 53" +meta-j54 = "/buffer 54" +meta-j55 = "/buffer 55" +meta-j56 = "/buffer 56" +meta-j57 = "/buffer 57" +meta-j58 = "/buffer 58" +meta-j59 = "/buffer 59" +meta-j60 = "/buffer 60" +meta-j61 = "/buffer 61" +meta-j62 = "/buffer 62" +meta-j63 = "/buffer 63" +meta-j64 = "/buffer 64" +meta-j65 = "/buffer 65" +meta-j66 = "/buffer 66" +meta-j67 = "/buffer 67" +meta-j68 = "/buffer 68" +meta-j69 = "/buffer 69" +meta-j70 = "/buffer 70" +meta-j71 = "/buffer 71" +meta-j72 = "/buffer 72" +meta-j73 = "/buffer 73" +meta-j74 = "/buffer 74" +meta-j75 = "/buffer 75" +meta-j76 = "/buffer 76" +meta-j77 = "/buffer 77" +meta-j78 = "/buffer 78" +meta-j79 = "/buffer 79" +meta-j80 = "/buffer 80" +meta-j81 = "/buffer 81" +meta-j82 = "/buffer 82" +meta-j83 = "/buffer 83" +meta-j84 = "/buffer 84" +meta-j85 = "/buffer 85" +meta-j86 = "/buffer 86" +meta-j87 = "/buffer 87" +meta-j88 = "/buffer 88" +meta-j89 = "/buffer 89" +meta-j90 = "/buffer 90" +meta-j91 = "/buffer 91" +meta-j92 = "/buffer 92" +meta-j93 = "/buffer 93" +meta-j94 = "/buffer 94" +meta-j95 = "/buffer 95" +meta-j96 = "/buffer 96" +meta-j97 = "/buffer 97" +meta-j98 = "/buffer 98" +meta-j99 = "/buffer 99" +meta-jmeta-l = "/input jump_last_buffer" +meta-jmeta-r = "/server raw" +meta-jmeta-s = "/server jump" +meta-k = "/input grab_key_command" +meta-n = "/window scroll_next_highlight" +meta-p = "/window scroll_previous_highlight" +meta-r = "/input delete_line" +meta-u = "/input scroll_unread" +meta-wmeta2-1;3A = "/window up" +meta-wmeta2-1;3B = "/window down" +meta-wmeta2-1;3C = "/window right" +meta-wmeta2-1;3D = "/window left" +meta-wmeta-meta2-A = "/window up" +meta-wmeta-meta2-B = "/window down" +meta-wmeta-meta2-C = "/window right" +meta-wmeta-meta2-D = "/window left" +meta-wmeta-b = "/window balance" +meta-wmeta-s = "/window swap" +meta-z = "/window zoom" +ctrl-_ = "/input undo" diff -r 8183cec0eac6 -r 3eb50a0fe94f weechat/xfer.conf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/weechat/xfer.conf Sun Sep 25 15:29:33 2011 -0400 @@ -0,0 +1,36 @@ +# +# xfer.conf -- weechat v0.3.5 +# + +[look] +auto_open_buffer = on +progress_bar_size = 20 + +[color] +status_aborted = lightred +status_active = lightblue +status_connecting = yellow +status_done = lightgreen +status_failed = lightred +status_waiting = lightcyan +text = default +text_bg = default +text_selected = white + +[network] +blocksize = 65536 +fast_send = on +own_ip = "" +port_range = "" +speed_limit = 0 +timeout = 300 + +[file] +auto_accept_chats = off +auto_accept_files = off +auto_rename = on +auto_resume = on +convert_spaces = on +download_path = "%h/xfer" +upload_path = "~" +use_nick_in_filename = on diff -r 8183cec0eac6 -r 3eb50a0fe94f zsh/misc.zsh --- a/zsh/misc.zsh Sun Sep 25 15:27:45 2011 -0400 +++ b/zsh/misc.zsh Sun Sep 25 15:29:33 2011 -0400 @@ -8,6 +8,8 @@ alias f='fab' alias fd='fab dev' +alias weechat='weechat-curses' + alias spotlight-off='sudo mdutil -a -i off && sudo mv /System/Library/CoreServices/Search.bundle/ /System/Library/CoreServices/SearchOff.bundle/ && killall SystemUIServer' alias spotlight-on='sudo mdutil -a -i on && sudo mv /System/Library/CoreServices/SearchOff.bundle/ /System/Library/CoreServices/Search.bundle/ && killall SystemUIServer'