about summary refs log tree commit diff
path: root/weechat/.weechat/perl/colorize_lines.pl
diff options
context:
space:
mode:
authorBen Harris <ben@tilde.team>2020-01-06 13:18:26 -0500
committerBen Harris <ben@tilde.team>2020-01-06 13:18:26 -0500
commit6427b33677d81e18a49ff80b24fdbe2c18592266 (patch)
tree34b05beaaee2b3e858800864e6c38209d5027a7d /weechat/.weechat/perl/colorize_lines.pl
parentcf5d32598ee2985e3c1c4894f0350b626c5be5fb (diff)
annual channel purge
Diffstat (limited to 'weechat/.weechat/perl/colorize_lines.pl')
-rw-r--r--weechat/.weechat/perl/colorize_lines.pl6
1 files changed, 5 insertions, 1 deletions
diff --git a/weechat/.weechat/perl/colorize_lines.pl b/weechat/.weechat/perl/colorize_lines.pl
index 6b0decd..d828620 100644
--- a/weechat/.weechat/perl/colorize_lines.pl
+++ b/weechat/.weechat/perl/colorize_lines.pl
@@ -19,6 +19,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # history:
+# 3.8: new option custom_action_text (https://github.com/weechat/scripts/issues/313) (idea by 3v1n0)
 # 3.7: new option "alternate_color" (https://github.com/weechat/scripts/issues/333) (idea by snuffkins)
 # 3.6: new option "own_lines_color" (idea by Linkandzelda)
 #    : add help about "localvar" to option
@@ -85,7 +86,7 @@
 
 use strict;
 my $PRGNAME     = "colorize_lines";
-my $VERSION     = "3.7";
+my $VERSION     = "3.8";
 my $AUTHOR      = "Nils Görs <weechatter\@arcor.de>";
 my $LICENCE     = "GPL3";
 my $DESCR       = "Colorize users' text in chat area with their nick color, including highlights";
@@ -102,6 +103,7 @@ my %config = ("buffers"                 => "all",       # all, channel, query
               "highlight_words"         => "off",       # on, off
               "highlight_words_color"   => "black,darkgray",
               "alternate_color"         => "",
+              "custom_action_text"      => "",
 );
 
 my %help_desc = ("buffers"                  => "Buffer type affected by the script (all/channel/query, default: all)",
@@ -116,6 +118,7 @@ my %help_desc = ("buffers"                  => "Buffer type affected by the scri
                  "highlight_words"          => "highlight word(s) in text, matching word(s) in weechat.look.highlight",
                  "highlight_words_color"    => "color for highlight word in text (format: fg,bg)",
                  "alternate_color"          => "alternate between two colors for messages (format: fg,bg:fg,bg)",
+                 "custom_action_text"       => "customise the text attributes of ACTION message (note: content is evaluated, see /help eval)",
 );
 
 my @ignore_tags_array;
@@ -262,6 +265,7 @@ sub colorize_cb
         # remove the first color reset - after * nick
         # make other resets reset to our color
         $right =~ s/\34//;
+        $color = weechat::string_eval_expression($config{custom_action_text}, {}, {}, {}) if ( $config{custom_action_text} ne "");
         $right =~ s/\34/\34$color/g;
         $out = $left . "\t" . $right . "\34"
     } else {