X-Git-Url: https://git.rmz.io/dotfiles.git/blobdiff_plain/95742b97c1c066ff9744907de318a405d6ea7f93..2512c622d1a79a40a95f4d26dda652fc825930fc:/weechat/perl/highmon.pl diff --git a/weechat/perl/highmon.pl b/weechat/perl/highmon.pl index 967f973..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.3.2 +# Version 2.4 # # Add 'Highlight Monitor' buffer/bar to log all highlights in one spot # @@ -66,6 +66,8 @@ # Bugs and feature requests at: https://github.com/KenjiE20/highmon # History: +# 2013-12-04, KenjiE20 : +# v2.4: -add: Support for eval style colour codes in time format used for bar output # 2013-10-22, KenjiE20 : # v2.3.3.2: -fix: Typo in fix command # 2013-10-10, KenjiE20 : @@ -852,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 { @@ -1068,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.3.2", "GPL3", "Highlight Monitor", "", "")) +if (!weechat::register("highmon", "KenjiE20", "2.4", "GPL3", "Highlight Monitor", "", "")) { # Double load weechat::print ("", "\tHighmon is already loaded");