about summary refs log tree commit diff
path: root/weechat/.weechat/perl
diff options
context:
space:
mode:
authorBen Harris <ben@tilde.team>2021-05-27 14:24:04 -0400
committerBen Harris <ben@tilde.team>2021-05-27 14:24:04 -0400
commitc32a2c632209f26959a810ebd6fa961b643bb8a8 (patch)
tree8832eec865e17f459ed68914b45deeaf1d6b4c18 /weechat/.weechat/perl
parent5996e710c58785c88925d96225b7fa8bd1b33e8e (diff)
update scripts and autojoins
Diffstat (limited to 'weechat/.weechat/perl')
-rw-r--r--weechat/.weechat/perl/colorize_lines.pl8
1 files changed, 5 insertions, 3 deletions
diff --git a/weechat/.weechat/perl/colorize_lines.pl b/weechat/.weechat/perl/colorize_lines.pl
index 93a4465..c03ff4f 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:
+# 4.0: add compatibility with XDG directories (WeeChat >= 3.2)
 # 3.9: add compatibility with new weechat_print modifier data (WeeChat >= 2.9)
 # 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)
@@ -87,7 +88,7 @@
 
 use strict;
 my $PRGNAME     = "colorize_lines";
-my $VERSION     = "3.9";
+my $VERSION     = "4.0";
 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";
@@ -111,7 +112,7 @@ my %help_desc = ("buffers"                  => "Buffer type affected by the scri
                  "blacklist_buffers"        => "Comma-separated list of channels to be ignored (e.g. freenode.#weechat,*.#python)",
                  "lines"                    => "Apply nickname color to the lines (off/on/nicks). The latter will limit highlighting to nicknames in option 'nicks'. You can use a localvar to color all lines with a given color (eg: /buffer set localvar_set_colorize_lines *yellow). You'll have enable this option to use alternate_color.",
                  "highlight"                => "Apply highlight color to the highlighted lines (off/on/nicks). The latter will limit highlighting to nicknames in option 'nicks'. Options 'weechat.color.chat_highlight' and 'weechat.color.chat_highlight_bg' will be used as colors.",
-                 "nicks"                    => "Comma-separater list of nicks (e.g. freenode.cat,*.dog) OR file name starting with '/' (e.g. /file.txt). In the latter case, nicknames will get loaded from that file inside weechat folder (e.g. from ~/.weechat/file.txt). Nicknames in file are newline-separated (e.g. freenode.dog\\n*.cat)",
+                 "nicks"                    => "Comma-separater list of nicks (e.g. freenode.cat,*.dog) OR file name starting with '/' (e.g. /file.txt). In the latter case, nicknames will get loaded from that file inside weechat config folder. Nicknames in file are newline-separated (e.g. freenode.dog\\n*.cat)",
                  "own_lines"                => "Apply nickname color to own lines (off/on/only). The latter turns off all other kinds of coloring altogether. This option has an higher priority than alternate_color option.",
                  "own_lines_color"          => "this color will be used for own messages. Set an empty value to use weechat.color.chat_nick_self option",
                  "tags"                     => "Comma-separated list of tags to accept (see /debug tags)",
@@ -324,7 +325,8 @@ sub get_alternate_color
 sub nicklist_read
 {
     return if (substr($config{nicks}, 0, 1) ne "/");
-    my $file = weechat::info_get("weechat_dir", "") . $config{nicks};
+    my $options = { "directory" => "config" };
+    my $file = weechat::string_eval_path_home("%h" . $config{nicks}, {}, {}, $options);
     return unless -e $file;
     my $nili = "";
     open (WL, "<", $file) || DEBUG("$file: $!");