Skip to content

Commit dd62797

Browse files
committed
hotlist2extern.pl 1.0: add compatibility with WeeChat >= 3.2 (XDG directories)
1 parent a5f799a commit dd62797

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

perl/hotlist2extern.pl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#
2323
# Script inspirated and tested by LaoLang_cool
2424
#
25+
# 1.0 : add compatibility with WeeChat >= 3.2 (XDG directories)
2526
# 0.9 : add eval_expression() for format options
2627
# 0.8 : escape special characters in hotlist (arza)
2728
# 0.7 : using %h for weechat-dir instead of hardcoded path in script (flashcode)
@@ -36,7 +37,7 @@
3637

3738
use strict;
3839
my $SCRIPT_NAME = "hotlist2extern";
39-
my $SCRIPT_VERSION = "0.9";
40+
my $SCRIPT_VERSION = "1.0";
4041
my $SCRIPT_DESC = "Give hotlist to an external file/program/screen title";
4142
my $SCRIPT_AUTHOR = "Nils Görs <weechatter\@arcor.de>";
4243

@@ -206,7 +207,7 @@ sub toggle_config_by_set{
206207
"",
207208
"This script allows you to export the hotlist to a file or screen title.\n".
208209
"use the following intern variables for the hotlist_format:\n".
209-
" %h = weechat-dir (~/.weechat), better use \${info:weechat_dir}\n".
210+
" %h = weechat_data_dir, better use \${weechat_data_dir} (or \${info:weechat_dir} with WeeChat < 3.2) \n".
210211
" %H = replaces with highlight_char, if a highlight message was received. For example: *\n".
211212
" %N = replaces with buffer number: 1 2 3 ....\n".
212213
" %S = replaces with short name of channel: #weechat\n".
@@ -228,6 +229,7 @@ sub toggle_config_by_set{
228229

229230

230231
init_config(); # /set
231-
$weechat_dir = weechat::info_get("weechat_dir", "");
232+
$weechat_dir = weechat::info_get("weechat_data_dir", "");
233+
$weechat_dir = weechat::info_get("weechat_dir", "") if (!$weechat_dir);
232234
weechat::hook_signal("hotlist_changed", "hotlist_changed", "");
233235
weechat::hook_config( "plugins.var.perl.$SCRIPT_NAME.*", "toggle_config_by_set", "" );

0 commit comments

Comments
 (0)