summaryrefslogtreecommitdiffstats
authorRaghavendra D Prabhu <[email protected]>2010-11-28 19:58:42 (GMT)
committer Raghavendra D Prabhu <[email protected]>2010-11-28 19:58:42 (GMT)
commit801fd8811f8cb41e21691b47061c274f4191e839 (patch) (side-by-side diff)
treef2487bd44e965abe3fb0dd159d4ef35a3b9c4e99
parent9dacbb1960add439f6d2b8a3a587b0613d4798f9 (diff)
downloadweescripts-801fd8811f8cb41e21691b47061c274f4191e839.zip
weescripts-801fd8811f8cb41e21691b47061c274f4191e839.tar.gz
weescripts-801fd8811f8cb41e21691b47061c274f4191e839.tar.bz2
script updatesHEADmaster
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--buffers.pl5
-rw-r--r--notify.py151
-rw-r--r--rainbow_text.pl369
3 files changed, 439 insertions, 86 deletions
diff --git a/buffers.pl b/buffers.pl
index 155bf62..8cfcc10 100644
--- a/buffers.pl
+++ b/buffers.pl
@@ -302,11 +302,12 @@ sub build_buffers
$str .= weechat::color($color);
if ($options{"short_names"} eq "on")
{
- $str .= substr($buffer->{"short_name"},0,$options{"max_length"});
+ # @{[split /_/,$x]}[1]
+ $str .= substr(@{[split /_/,$buffer->{"short_name"}]}[0],0,$options{"max_length"});
}
else
{
- $str .= substr($buffer->{"name"},0,$options{"max_length"});
+ $str .= substr(@{[split /_/,$buffer->{"name"}]}[0],0,$options{"max_length"});
}
$str .= "\n";
$old_number = $buffer->{"number"};
diff --git a/notify.py b/notify.py
index c8b91e9..5193aaf 100644
--- a/notify.py
+++ b/notify.py
@@ -1,116 +1,99 @@
-# Author: lavaramano <lavaramano AT gmail DOT com>
-# Improved by: BaSh - <bash.lnx AT gmail DOT com>
-# Ported to Weechat 0.3.0 by: Sharn - <sharntehnub AT gmail DOT com)
-# This Plugin Calls the libnotify bindings via python when somebody says your nickname, sends you a query, etc.
-# To make it work, you may need to download: python-notify (and libnotify - libgtk)
-# Requires Weechat 0.3.0
-# Released under GNU GPL v2
-#
-# 2010-09-22, Raghavendra Prabhu
-# Added some stuff.
-# 2010-02-20, Aron Griffis <[email protected]>
-# version 0.0.5: Add nick_separator, don't call show_notification twice on
-# privmsg, fix spelling s/nofify/notify/, use nick as "summary" for privmsg
-# notification, fit in 80 columns, tweak vim modeline.
-# 2010-01-24, David Rubin <[email protected]>
-# version 0.0.4.2 Fixed issue with self notifications when used with out "smart_notification"
-# 2010-01-19, Didier Roche <[email protected]>
-# version 0.0.4.1: add private message sender name
-# 2010-01-19, Didier Roche <[email protected]>
-# version 0.0.4: add smart notification:
-# be notified only if you're not in the current channel/pv window (off by default)
-# 2009-06-16, kba <[email protected]>:
-# version 0.0.3: added config options for icon and urgency
-# 2009-05-02, FlashCode <[email protected]>:
-# version 0.0.2.1: sync with last API changes
-
-import weechat, pynotify, string
-weechat.register("notify", "lavaramano", "0.0.5", "GPL", "notify: A real time notification system for weechat", "", "")
+
+import weechat
+import os, datetime, subprocess, re, sys, shlex
+weechat.register("notify", "lavaramano", "0.0.5", "GPL",
+"notify: A real time notification system for weechat", "", "")
# script options
settings = {
- "show_hilights" : "on",
- "show_priv_msg" : "on",
- "nick_separator" : ": ",
- "icon" : "/usr/share/pixmaps/weechat.xpm",
- "path" : "~/logs/me.log",
- "urgency" : "normal",
- "smart_notification" : "off",
+ "show_hilights" : "on",
+ "show_priv_msg" : "on",
+ "nick_separator" : ": ",
+ "icon" : "/usr/share/pixmaps/weechat.xpm",
+ "path" : "~/logs/me.log",
+ "urgency" : "normal",
+ "smart_notification" : "off",
}
-urgencies = {
- "low" : pynotify.URGENCY_LOW,
- "critical" : pynotify.URGENCY_CRITICAL,
- "normal" : pynotify.URGENCY_NORMAL,
-}
# Init everything
-for option, default_value in settings.items():
+for option, default_value in settings.items():
if weechat.config_get_plugin(option) == "":
- weechat.config_set_plugin(option, default_value)
+ weechat.config_set_plugin(option, default_value)
# Hook privmsg/hilights
-weechat.hook_print("", "irc_privmsg", "", 1, "notify_show", "")
+weechat.hook_print("", "irc_privmsg", "", 1, "notify_show", "")
# Functions
-def notify_show(data, bufferp, uber_empty, tagsn, isdisplayed,
- ishilight, prefix, message):
+def notify_show(data, bufferp, uber_empty, tagsn, isdisplayed,
+ ishilight, prefix, message):
"""Sends highlighted message to be printed on notification"""
try:
- if (weechat.config_get_plugin('smart_notification') == "on" and
- bufferp == weechat.current_buffer() and focussed()):
- pass
+# if (weechat.config_get_plugin('smart_notification') == "on" and
+# bufferp == weechat.current_buffer()):
+ #bufferp == weechat.current_buffer() and focussed()):
+# pass
- elif (weechat.buffer_get_string(bufferp, "localvar_type") == "private" and
- weechat.config_get_plugin('show_priv_msg') == "on"):
- show_notification(prefix, message)
+ if (weechat.buffer_get_string(bufferp, "localvar_type") == "private"
+ and weechat.config_get_plugin('show_priv_msg') == "on"):
+ show_notification(prefix, message)
elif (ishilight == "1" and
weechat.config_get_plugin('show_hilights') == "on"):
- buffer = (weechat.buffer_get_string(bufferp, "short_name") or
- weechat.buffer_get_string(bufferp, "name"))
- show_notification(buffer, prefix +
+ obuffer = (weechat.buffer_get_string(bufferp, "short_name") or
+ weechat.buffer_get_string(bufferp, "name"))
+ show_notification(obuffer, prefix +
weechat.config_get_plugin('nick_separator') + message)
- except ex:
- writetofile(weechat.config_get_plugin('path'),prefix,message,str(ex))
+ except:
+ write_to_file(weechat.config_get_plugin('path'), prefix,
+ 'FAILED:'+message, sys.exc_info()[0])
return weechat.WEECHAT_RC_OK
-def show_notification(chan,message):
- print('\a')
- pynotify.init("wee-notifier")
- writetofile(weechat.config_get_plugin('path'),chan,message)
- wn = pynotify.Notification(chan, message, weechat.config_get_plugin('icon'))
- wn.set_urgency(urgencies[weechat.config_get_plugin('urgency')] or
- pynotify.URGENCY_NORMAL)
- wn.show()
-
-def writetofile(path,chan,message,exception=""):
- import os
- import datetime
+def show_notification(chan, message):
+ """
+ To show notifications with custom notify-send.
+ """
+ chan = "Weechat: "+chan
+ message = "~ "+message+" ~"
+ command=shlex.split("notify-send " + chan + message)
+ try:
+ subprocess.Popen(command)
+ except Exception:
+ pass
+ finally:
+ write_to_file(weechat.config_get_plugin('path'), chan, message)
+
+
+def write_to_file(path, chan, message, exception=""):
+ """
+ Logging the notifications/exceptions to file.
+ """
fullpath = os.path.expanduser(path)
- file = open(fullpath,"a")
- file.writelines(str(datetime.datetime.now().ctime()))
+ xfile = open(fullpath, "a")
+ xfile.writelines(str(datetime.datetime.now().ctime()))
if exception:
- file.writelines("\n\n --------> "+exception+"<------------\n")
- file.writelines(" \n\nWeechat priv:==============>\n")
- file.writelines(str(chan+" : "+message+"\n"))
- file.writelines("<==============\n\n")
- file.close()
+ xfile.writelines("\n\n EXCEPTION: --------> "+str(exception)+"<------------\n")
+ xfile.writelines(" \n\nWeechat priv:==============>\n")
+ xfile.writelines(str(chan+" : "+message+"\n"))
+ xfile.writelines("<==============\n\n")
+ xfile.close()
def focussed():
- import subprocess
- import re
+ """
+ To determine whether notification be sent based on tmux window and current workspace.
+ """
+
# tmux display-message -p and xdotool getactivewindow getwindowpid
- x,y=subprocess.Popen("\
- [[ `xdotool getactivewindow getwindowpid` == `pidof urxvtd` ]];\
- echo -n $?",shell=True,stdout=subprocess.PIPE).communicate()
- if(x == 0):
- current,discard = subprocess.Popen("tmux display-message -p",shell=True\
- ,stdout=subprocess.PIPE).communicate()
- if re.match(".*weechat.*",current):
+ same_workspace, _ = subprocess.Popen("\
+ [[ $(xdotool getactivewindow getwindowpid 2>/dev/null) == $(pidof urxvtd 2>/dev/null) ]];\
+ echo -n $?", shell=True, stdout=subprocess.PIPE).communicate()
+ if(same_workspace == 0):
+ current, _ = subprocess.Popen("tmux display-message -p",
+ shell=True, stdout=subprocess.PIPE).communicate()
+ if re.match(".*weechat.*", current):
return True
return False
diff --git a/rainbow_text.pl b/rainbow_text.pl
new file mode 100644
index 0000000..26c237c
--- a/dev/null
+++ b/rainbow_text.pl
@@ -0,0 +1,369 @@
+#
+# Copyright (c) 2010 by Nils Görs <[email protected]>
+#
+# colours the channel text with nick colour and also highlight the whole text
+# now 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 <http://www.gnu.org/licenses/>.
+#
+# settings see help page
+#
+# history:
+# 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 = "rainbow_text";
+my $version = "0.3";
+my $description = "colours the channel text with according nick colour. Highlight messages will be fully highlighted";
+# default values
+my $var_highlight = "on";
+my $var_chat = "on";
+my $var_shuffle = "off";
+my $var_buffer_autoset = "off";
+my $prefix_action = "";
+my $blacklist_channels = "";
+#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");
+my %colours = (0 => "lightgray", 1 => "lightred", 2 => "lightred", 3 => "lightgreen",
+ 4 => "lightgreen", 5 => "lightbrown", 6 => "lightgreen", 7 => "lightblue",
+ 8 => "lightblue", 9 => "lightmagenta", 10 => "lightmagenta", 11 => "lightcyan",
+ 12 => "lightcyan", 13 => "lightwhite");
+
+my $zahl = 0;
+my $nick_mode = "";
+
+# 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 ($var_highlight eq "off" and $var_chat eq "off"){ # all options OFF
+ return $string;
+}
+
+$modifier_data =~ (m/irc;(.+?)\.(.+?)\;/);
+my $servername = $1;
+my $channel_name = $2;
+if (index($blacklist_channels,$channel_name) >= 0) { # check 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;
+my $line = $2; # get written text
+
+# i wrote the message
+ if ($nick =~ m/(\w.*$my_nick.*)/){ # i wrote the message
+ if ($var_chat eq "on"){
+ my $nick_color = weechat::config_color(weechat::config_get("weechat.color.chat_nick_self")); # get my nick colour
+ $nick_color = weechat::color($nick_color);
+ $line = colorize_nicks($nick_color,$modifier_data,$line);
+ $line = $nick . "\t" . $nick_color . $line . weechat::color('reset');
+ return $line;
+ }else{
+ return $string;
+ }
+ }
+
+# check if look.nickmode is ON and no prefix and no query buffer
+my $nick_mode = "";
+if ( weechat::config_boolean(weechat::config_get("weechat.look.nickmode")) == 1 and (weechat::string_remove_color($nick,"") ne $prefix_action) and (index($modifier_data,"notify_private")) == -1){
+ if (weechat::string_remove_color($nick,"") =~ m/^\@|^\%|^\+|^\~|^\*|^\&|^\!|^\-/) { # check for nick modes (@%+~*&!-) without colour
+ $nick_mode = substr($nick,0,5); # get nick_mode with colour codes
+ $nick = substr($nick,5,length($nick)-1); # get nick name
+ }
+}
+
+# get nick colour
+$nick = weechat::string_remove_color($nick,""); # remove colour-codes from nick
+my $nick_color = weechat::info_get('irc_nick_color', $nick); # get nick-colour
+
+# check for /me text
+if ($prefix_action eq $nick){ # nick is a prefix!!!
+ $line = weechat::string_remove_color($line,""); # remove colour-codes from line
+ $nick_color = weechat::info_get('irc_nick_color', $line =~ (m/(.+?) /)); # and get real nick-colour from line
+}
+
+# highlight message received?
+ if ($var_highlight eq "on"){ # highlight_mode on?
+ if ($var_buffer_autoset eq "on"){ # buffer_autoset "on"?
+ my $highlight_words_add = weechat::config_string(weechat::config_get("buffer_autoset.buffer.irc.".$servername.".".$channel_name.".highlight_words_add"));
+ foreach ( split( /,+/, $highlight_words_add ) ) { # check for highlight_words_add
+ 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 ($prefix_action eq $nick){ # highlight in /me text?
+# $line = weechat::string_remove_color($line,""); # remove colour-codes from line
+ $line = colorize_nicks($nick_color,$modifier_data,$line);
+ $line = $nick_mode . $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 . "\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 ($prefix_action eq $nick){ # prefix used (for example using /me)
+
+ if (weechat::string_remove_color($line,"") =~ m/^$my_nick/) { # check for own nick
+ $nick_color = weechat::config_color(weechat::config_get("weechat.color.chat_nick_self"));# get my nick colour
+ $nick_color = weechat::color($nick_color);
+ $line = colorize_nicks($nick_color,$modifier_data,$line);
+ $line = $nick_mode . $nick . "\t" . $nick_color . $line . weechat::color('reset');# print line
+ return $line;
+ }
+ # $prefix_action ne $nick
+ $line = colorize_nicks($high_color,$modifier_data,$line);
+ $line = $nick_mode . $nick . "\t" . $high_color . $line . weechat::color('reset');
+ return $line;
+ }
+
+# highlight whole line
+ $line = colorize_nicks($high_color,$modifier_data,$line);
+ $line = $nick_mode . $high_color . $nick . "\t" . $high_color . $line . weechat::color('reset');
+ return $line;
+ }
+ } # highlight area finished
+
+# simple channel message
+ if ($var_chat eq "on"){ # chat_mode on?
+ if ($var_shuffle eq "on"){ # colour_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 ( $zahl == ($zahl2 = int(rand(14))) or ($colours{$zahl2} eq $my_color) ); # latest colour nor own nick colour
+ $zahl = $zahl2;
+ }
+ $nick_color = weechat::color($colours{$zahl}); # get new random colour
+ }
+ if ($prefix_action eq $nick){ # prefix used (for example using /me)
+ $line = colorize_nicks($nick_color,$modifier_data,$line);
+ $line = $nick_mode . $nick . "\t" . $nick_color . $line . weechat::color('reset');
+ return $line;
+ }
+
+ $line = colorize_nicks($nick_color,$modifier_data,$line);
+ $line = $nick_mode . $nick_color . $nick . "\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;
+}
+
+sub get_nick_mode{
+my ( $word ) = @_;
+
+ if ($word =~ m/^\@|^\%|^\+|^\~|^\*|^\&|^\!|^\-/) { # check for nick modes (@%+~*&!-)
+ $nick_mode = substr($word,0,1);
+ my $nick = substr($word,1,length($word)-1);
+ return $nick;
+ }else{
+ return "",$word;
+ }
+}
+
+# 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::string_remove_color($line,""); # remove colour-codes from line first
+ $line = weechat::hook_modifier_exec( "colorize_nicks",$mf_data,$line); # call colorize_nicks function and color the nick
+ 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?
+sub toggle_config_by_set{
+my ( $pointer, $name, $value ) = @_;
+
+ if ($name eq "plugins.var.perl.$prgname.highlight"){
+ $var_highlight = $value;
+ return weechat::WEECHAT_RC_OK;
+ }
+ if ($name eq "plugins.var.perl.$prgname.buffer_autoset"){
+ $var_buffer_autoset = $value;
+ return weechat::WEECHAT_RC_OK;
+ }
+ if ($name eq "plugins.var.perl.$prgname.chat"){
+ $var_chat = $value;
+ return weechat::WEECHAT_RC_OK;
+ }
+ if ($name eq "plugins.var.perl.$prgname.shuffle"){
+ $var_shuffle = $value;
+ return weechat::WEECHAT_RC_OK;
+ }
+ if ($name eq "plugins.var.perl.$prgname.blacklist_channels"){
+ $blacklist_channels = $value;
+ return weechat::WEECHAT_RC_OK;
+ }
+
+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 ($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 "buffer_autoset"){
+ if ($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 "chat"){
+ if ($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 ($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 <weechatter\@arcor.de>", $version,
+ "GPL3", $description, "", "");
+
+ if (!weechat::config_is_set_plugin("highlight")){
+ weechat::config_set_plugin("highlight", $var_highlight);
+ }else{
+ $var_highlight = weechat::config_get_plugin("highlight");
+ }
+ if (!weechat::config_is_set_plugin("buffer_autoset")){
+ weechat::config_set_plugin("buffer_autoset", $var_buffer_autoset);
+ }else{
+ $var_buffer_autoset = weechat::config_get_plugin("buffer_autoset");
+ }
+ if (!weechat::config_is_set_plugin("chat")){
+ weechat::config_set_plugin("chat", $var_chat);
+ }else{
+ $var_chat = weechat::config_get_plugin("chat");
+ }
+ if (!weechat::config_is_set_plugin("shuffle")){
+ weechat::config_set_plugin("shuffle", $var_shuffle);
+ }else{
+ $var_shuffle = weechat::config_get_plugin("shuffle");
+ }
+ if (!weechat::config_is_set_plugin("blacklist_channels")){
+ weechat::config_set_plugin("blacklist_channels", $blacklist_channels);
+ }else{
+ $blacklist_channels = weechat::config_get_plugin("blacklist_channels");
+ }
+
+$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", "");
+
+weechat::hook_command($prgname, $description,
+
+ "<highlight> <chat> <shuffle> <autoset>",
+
+ "<highlight> toggle highlight colour text on/off\n".
+ "<chat> toggle chat colour text on/off\n".
+ "<shuffle> toggle shuffle colour mode on/off\n".
+ "<autoset> toggle highlight colour mode for buffer_autoset on/off\n\n".
+ "Options (script):\n".
+ "'plugins.var.perl.$prgname.highlight' : toggle highlight colour in text on/off\n".
+ "'plugins.var.perl.$prgname.buffer_autoset' : toggle highlight colour in text for buffer_autoset on/off\n".
+ "'plugins.var.perl.$prgname.chat' : toggle coloured text for chats on/off\n".
+ "'plugins.var.perl.$prgname.shuffle' : toggle shuffle colour mode for chats on/off\n".
+ "'plugins.var.perl.$prgname.blacklist_channels' : comma separated list with channelname (e.g.: #weechat,#weechat-fr)\n\n".
+ "Options (global):\n".
+ "'weechat.color.chat_highlight' : highlight colour\n".
+ "'weechat.color.chat_highlight_bg' : highlight background colour\n".
+ "'weechat.color.chat_nick*' : colours for nicks\n\n".
+ "To use the autoset highlight option install buffer_autoset script from: http://www.weechat.org/scripts/\n",
+ "highlight|chat|shuffle|autoset", "change_settings", "");
+
+weechat::hook_config( "plugins.var.perl.$prgname.*", "toggle_config_by_set", "" );