]> WeeChat 0.1.8-cvs - User guide Fast, light and extensible IRC client Sébastien Helleu flashcode AT flashtux.org 2006 Sébastien Helleu This manual 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 2 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, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA This manual documents WeeChat IRC client, it is part of WeeChat. Latest version of this document can be found on this page: http://weechat.flashtux.org/doc.php Introduction This chapter describes WeeChat and pre-requisites for its installation.
Description WeeChat (Wee Enhanced Environment for Chat) is a free IRC client, fast and light, designed for many operating systems. Main features are: multi-servers connection (with SSL, IPv6, proxy) many GUI: Curses, wxWidgets, Gtk and Qt small, fast and light customizable and extensible with plugins and scripts compliant with RFCs 1459, 2810, 2811, 2812 and 2813 multi-platform (GNU/Linux, *BSD, MacOS X, Windows and other) 100% GPL, free software WeeChat homepage is here: http://weechat.flashtux.org
Pre-requisites In order to install WeeChat, you need: a running GNU/Linux system (with compiler tools for source package) "root" privileges (to install WeeChat) according to GUI, one of the following libraries: Curses: ncurses library Gtk: *** GUI not developed *** WxWidgets: *** GUI not developed *** Qt: *** GUI not developed ***
Installation This chapter explains how to install WeeChat.
Binary packages Binary packages are available for these distributions: Debian (or any Debian compatible distribution): apt-get install weechat Mandriva/RedHat (or any RPM compatible distribution): rpm -i /chemin/weechat-x.y.z-1.i386.rpm Gentoo : emerge weechat For other distributions, please look at your manual for installation instructions.
Source package All you have to do is to run in a console or a terminal: $ ./configure $ make Then get root privileges and install WeeChat: $ su (enter root password) # make install
CVS sources Warning: CVS sources are for advanced users: it may not compile or not be stable. You're warned! To get CVS sources, issue this command: $ cvs -z3 -d:pserver:anonymous@cvs.savannah.nongnu.org:/sources/weechat co weechat Execute this script: ./autogen.sh Then follow instructions for source package (see )
Usage This chapter explains how to run WeeChat, the default key bindings used, internal and IRC commands, setup file, and FIFO pipe use.
Running WeeChat Command line arguments: Parameter Description -a, --no-connect Disable auto-connect to servers at startup -c, --config Display config help (list of options) -d, --dir <path> Set path as home for WeeChat (used for configuration files, logs, user plugins and scripts). Default value is "~/.weechat". Please note that directory is created if not found by WeeChat. -f, --key-functions Display WeeChat internal functions for keys -h, --help Display help -i, --irc-commands Display IRC commands list -k, --keys Display WeeChat default keys -l, --license Display WeeChat license -p, --no-plugin Disable plugins auto-load -v, --version Display WeeChat version -w, --weechat-commands Display WeeChat commands list It is also possible to give URL for one or many IRC servers, as follow: irc[6][s]://[pseudo[:mot_passe]@]irc.example.org[:port][/channel][,channel[...] Example to join #weechat and #toto on "irc.freenode.net" server, default port (6667), with "nono" nick: $ weechat-curses irc://nono@irc.freenode.net/#weechat,#toto To start WeeChat, issue this command: for Curses GUI: weechat-curses for Gtk GUI: weechat-gtk for wxWidgets GUI: weechat-wxwidgets for Qt GUI: weechat-qt When you run WeeChat for the first time, a default configuration file is created, with default options. The default configuration file is: "~/.weechat/weechat.rc" You can edit this file at your convenience to configure WeeChat (ONLY if WeeChat is not running), or you can set parameters with "/set" command in WeeChat (see )
Key bindings Key Action Left arrow Go to previous char in command line Right arrow Go to next char in command line Ctrl + left arrow Go to previous word in command line Ctrl + right arrow Go to next word in command line Home / Ctrl + A Go to the beginning of command line End / Ctrl + E Go to the end of command line Ctrl + K Delete from cursor until end of command line Ctrl + L Redraw whole window Ctrl + U Delete from cursor until beginning of command line Ctrl + W Delete previous word of command line Backspace Delete previous char in command line Delete Delete next char in command line Tab Complete command or nick (Tab again: find next completion) Any char Insert char at cursor position in command line Enter Execute command or send message Up arrow / Down arrow Call again last commands/messages Ctrl + up arrow / Ctrl + down arrow Call again last commands/messages in global history (common for all buffers) PageUp / PageDown Scroll up / down one page in buffer history Alt + PageUp / Alt + PageDown Scroll up / down a few lines in buffer history F5 / Alt + left arrow Switch to previous buffer F6 / Alt + right arrow Switch to next buffer F7 Switch to previous window F8 Switch to next window F10 Remove last infobar message F11 / F12 Scroll nicklist Alt + Home / Alt + End Go to the beginning / the end of nicklist Alt + A Switch to next buffer with activity (with priority: highlight, message, other) Alt + B Go to previous word in command line Alt + D Delete next word in command line Alt + F Go to next word in command line Alt + H Clear hotlist (activity notification on other buffers) Alt + J then Alt + D Display DCC buffer Alt + J then Alt + L Switch to last buffer Alt + J then Alt + S Switch to server buffer Alt + J then Alt + X Switch to first channel of next buffer (or server buffer if no channel is opened) Alt + digit (0-9) Switch to buffer by number (0 = 10) Alt + J then number (01-99) Switch to buffer by number Alt + K Grab a key and insert its code in command line Alt + N Scroll to next highlight Alt + P Scroll to previous highlight Alt + R Delete entire command line Alt + S Switch servers on servers buffer (if option "look_one_server_buffer" is enabled) Alt + U Scroll to first unread line in buffer Alt + W then Alt + arrow Switch to window with direction
Command line WeeChat command line (at the bottom of window) lets you send text on channels and execute WeeChat or IRC commands (see ). Commands begin with "/" char, followed by name of command. For example, to initiate a private chat with "toto": /query toto Text sent to a channel is any text that does not begin with "/" char. For example, to send text "hello" on current channel: hello However, it is possible to start with "/" char, by adding another. For example, to send text "/query toto" on current channel: //query toto If option for sending IRC colors ("irc_colors_send") is enabled, you can use color codes and attributes, as follow: Code Description %B bold text %Cxx text color "xx" (see colors table below) %Cxx,yy text color "xx" and background "yy" (see colors table below) %O disable color and attributes %R reverse video (revert text color with background) %U underlined text %% display one "%" Note: the same code (without number for %C) may be used to stop the attribute. Color codes for %C are: Code Color 00 white 01 black 02 dark blue 03 dark green 04 light red 05 dark red 06 magenta 07 orange 08 yellow 09 light green 10 cyan 11 light cyan 12 light blue 13 light magenta 14 gray 15 light gray (white) Example: display of "hello everybody!" with "hello" in light blue bold, and "everybody" in light red underlined: %C12%Bhello%B%C04%U everybody%U%C!
WeeChat / IRC commands This chapter lists all WeeChat and IRC commands.
WeeChat commands &weechat_commands.xml;
Key functions Function Description &key_functions.xml;
IRC commands &irc_commands.xml;
Configuration file List of options for config file: Option Type Values Default Description &config.xml; Colors for Curses GUI are: Keyword Color default default color (transparent for background) black black red dark red lightred light red green dark green lightgreen light green brown brown yellow yellow blue dark blue lightblue light blue magenta dark magenta lightmagenta light magenta cyan dark cyan lightcyan light cyan white white
FIFO pipe You can remote control WeeChat, by sending commands or text to a FIFO pipe (you have to enable option "irc_fifo_pipe", it is disabled by default). The FIFO pipe is located in "~/.weechat/" and is called "weechat_fifo_xxxxx" (where xxxxx is the process ID (PID) of running WeeChat). So if many WeeChat are running, you have many FIFO pipes, one for each session. The syntax for the FIFO pipe commands/text is: server,channel *text or command here where server and channel are optional, but if channel is here, server should be too. Some examples: nick change on freenode to "mynick|out" : $ echo "freenode */nick mynick|out" >~/.weechat/weechat_fifo_12345 display text on #weechat channel: $ echo "freenode,#weechat *hello everybody!" >~/.weechat/weechat_fifo_12345 display text on current channel (buffer displayed by WeeChat): $ echo "*hello!" >~/.weechat/weechat_fifo_12345 Warning: this is dangerous and you should not do that except if you know what you do! send two commands to unload/reload Perl scripts (you have to separate them with "\n"): $ echo -e "freenode */perl unload\nfreenode */perl autoload" >~/.weechat/weechat_fifo_12345 You can write a script to send command to all running WeeChat at same time, for example: #!/bin/sh if [ $# -eq 1 ]; then for fifo in $(/bin/ls ~/.weechat/weechat_fifo_* 2>/dev/null); do echo -e "$1" >$fifo done fi If the script is called "auto_weechat_command", you can run it with: $ ./auto_weechat_command "freenode,#weechat *hello"
Plugins This chapter describes WeeChat plugins interface (API) and the default scripts plugins (Perl, Python, Ruby, Lua), provided with WeeChat.
Plugins in WeeChat A plugin is a C program which can call WeeChat functions defined in an interface. This C program does not need WeeChat sources to compile and can be dynamically loaded into WeeChat with command /plugin. The plugin has to be a dynamic library, for dynamic loading by operating system. Under GNU/Linux, the file has ".so" extension, ".dll" under Windows.
Write a plugin The plugin has to include "weechat-plugin.h" file (available in WeeChat source code). This file defines structures and types used to communicate with WeeChat. The plugin must have some variables and functions (mandatory, without them the plugin can't load): Variable Description char plugin_name[] plugin name char plugin_version[] plugin version char plugin_description[] short description of plugin Function Description int weechat_plugin_init (t_weechat_plugin *plugin) function called when plugin is loaded, must return PLUGIN_RC_OK if successful, PLUGIN_RC_KO if error (if error, plugin will NOT be loaded) void weechat_plugin_end (t_weechat_plugin *plugin) function called when plugin is unloaded
API functions
ascii_strcasecmp Prototype: int ascii_strcasecmp (t_weechat_plugin *plugin, char *string1, char *string2) Locale and case independent string comparison. Arguments: : pointer to plugin structure : first string for comparison : second string for comparison Return value: difference between two strings: negative if string1 < string2, zero if string1 == string2, positive if string1 > string2 Example: if (plugin->ascii_strcasecmp (plugin, "abc", "def") != 0) ...
ascii_strncasecmp Prototype: int ascii_strncasecmp (t_weechat_plugin *plugin, char *string1, char *string2, int max) Locale and case independent string comparison, for "max" chars. Arguments: : pointer to plugin struct : first string for comparison : second string for comparison : max number of chars for comparison Return value: difference between two strings: negative if string1 < string2, zero if string1 == string2, positive if string1 > string2 Example: if (plugin->ascii_strncasecmp (plugin, "abc", "def", 2) != 0) ...
explode_string Prototype: char **explode_string (t_weechat_plugin *plugin, char *string, char *separators, int num_items_max, int *num_items) Explode a string according to one or more delimiter(s). Arguments: : pointer to plugin struct : string to explode : delimiters used for explosion : maximum number of items created (0 = no limit) : pointer to int which will contain number of items created Return value: array of strings, NULL if problem. Note: result has to be free by a call to "free_exloded_string" after use. Example: char **argv; int argc; argv = plugin->explode_string (plugin, string, " ", 0, &argc); ... if (argv != NULL) plugin->free_exploded_string (plugin, argv);
free_exploded_string Prototype: char **free_exploded_string (t_weechat_plugin *plugin, char **string) Free memory used by a string explosion. Arguments: : pointer to plugin structure : string exploded by "explode_string" function Return value: none. Example: char *argv; int argc; argv = plugin->explode_string (plugin, string, " ", 0, &argc); ... if (argv != NULL) plugin->free_exploded_string (plugin, argv);
exec_on_files Prototype: void exec_on_files (t_weechat_plugin *plugin, char *repertoire, int (*callback)(t_weechat_plugin *, char *)) Execute a function on all files of a directory. Arguments: : pointer to plugin structure : directory for searching files : function called for each file found Return value: none. Example: int callback (t_weechat_plugin *plugin, char *file) { plugin->print_server (plugin, "file: %s", file); return 1; } ... plugin->exec_on_files (plugin, "/tmp", &callback);
print Prototype: void print (t_weechat_plugin *plugin, char *server, char *channel, char *message, ...) Display a message on a WeeChat buffer, identified by server and channel (both may be NULL for current buffer). Arguments: : pointer to plugin structure : internal name of server to find buffer for message display (may be NULL) : name of channel to find buffer for message display (may be NULL) : message Return value: none. Examples: plugin->print (plugin, NULL, NULL, "hello"); plugin->print (plugin, NULL, "#weechat", "hello"); plugin->print (plugin, "freenode", "#weechat", "hello");
print_server Prototype: void print_server (t_weechat_plugin *plugin, char *message, ...) Display a message on current server buffer. Arguments: : pointer to plugin structure : message Return value: none. Example: plugin->print_server (plugin, "hello");
print_infobar Prototype: void print_infobar (t_weechat_plugin *plugin, int time, char *message, ...) Display a message in infobar for a specified time. Arguments: : pointer to plugin structure : time (in seconds) for displaying message (0 = never erased) Return value: none. Example: plugin->print_infobar (plugin, 5, "hello");
log Prototype: void log (t_weechat_plugin *plugin, char *server, char *channel, char *message, ...) Write a message in log file for a server or a channel. Arguments: : pointer to plugin structure : internal name of server to find buffer for log (may be NULL) : name of channel to find buffer for log (may be NULL) : message Return value: none. Example: plugin->log (plugin, "freenode", "#weechat", "test");
msg_handler_add Prototype: t_plugin_handler *msg_handler_add (t_weechat_plugin *plugin, char *message, t_plugin_handler_func *function, char *handler_args, void *handler_pointer) Add an IRC message handler, called when an IRC message is received. Arguments: : pointer to plugin structure : name of IRC message. To know list of IRC messages, please consult RFCs 1459 and 2812 : function called when message is received : arguments given to function when called : pointer given to function when called Return value: pointer to new message handler. Note: function called when message is received has to return one of following values: PLUGIN_RC_KO: function failed PLUGIN_RC_OK: function successfully completed PLUGIN_RC_OK_IGNORE_WEECHAT: message will not be sent to WeeChat PLUGIN_RC_OK_IGNORE_PLUGINS: message will not be sent to other plugins PLUGIN_RC_OK_IGNORE_ALL: message will not be sent to WeeChat neither other plugins Example: int msg_kick (t_weechat_plugin *plugin, char *server, char *command, char *arguments, char *handler_args, void *handler_pointer) { plugin->print (plugin, server, NULL, "KICK received"); return PLUGIN_RC_OK; } ... plugin->msg_handler_add (plugin, "KICK", &msg_kick, NULL, NULL);
cmd_handler_add Prototype: t_plugin_handler *cmd_handler_add (t_weechat_plugin *plugin, char *command, char *description, char *arguments, char *arguments_description, char *completion_template, t_plugin_handler_func *fonction, char *handler_args, void *handler_pointer) Add a WeeChat command handler, called when user uses command (for example /command). Arguments: : pointer to plugin structure : the new command name, which may be an existing command (be careful, replaced command will not be available until plugin is unloaded) : short command description (displayed by /help command) : short description of command arguments (displayed by /help command) : long description of command arguments (displayed by /help command) : template for completion, like "abc|%w def|%i" which means "abc" or a WeeChat command for first argument, "def" or IRC command for second. An empty string lets WeeChat complete any argument with a nick from current channel, NULL disable completion for all command arguments. Following codes can be used: Code Description %- no completion for argument %a alias %A alias and commands (WeeChat, IRC and plugins) %c current channel %C channels of current server %h plugins commands %i IRC commands (sent) %I IRC commands (received) %k key functions %n nicks of current channel %o setup options %p default "part" message %q default "quit" message %s current server name %S all servers names %t topic of current channel %v setup option value %w WeeChat commands : function called when command is executed : arguments given to function when called : pointer given to function when called Return value: pointer to new command handler. Note: function called when command is executed has to return one of following values: PLUGIN_RC_KO: function failed PLUGIN_RC_OK: function successfully completed Example: int cmd_test (t_weechat_plugin *plugin, char *server, char *command, char *arguments, char *handler_args, void *handler_pointer) { plugin->print (plugin, server, NULL, "test command, nick: %s", (arguments) ? arguments : "none"); return PLUGIN_RC_OK; } ... plugin->cmd_handler_add (plugin, "test", "Test command", "[nick]", "nick: nick of channel", "%n", &cmd_test, NULL, NULL);
timer_handler_add Prototype: t_plugin_handler *timer_handler_add (t_weechat_plugin *plugin, int interval, t_plugin_handler_func *function, char *handler_args, void *handler_pointer) Add a timer handler which periodically calls a function. Arguments: : pointer to plugin structure : interval (in seconds) between two calls of function. : function called : arguments given to function when called : pointer given to function when called Return value: pointer to new message handler. Note: function called has to return one of following values: PLUGIN_RC_KO: function failed PLUGIN_RC_OK: function successfully completed Example: int my_timer (t_weechat_plugin *plugin, char *server, char *command, char *arguments, char *handler_args, void *handler_pointer) { plugin->print (plugin, NULL, NULL, "my timer"); return PLUGIN_RC_OK; } ... plugin->timer_handler_add (plugin, 60, &my_timer);
handler_remove Prototype: void handler_remove (t_weechat_plugin *plugin, t_plugin_handler *handler) Remove a handler. Arguments: : pointer to plugin structure : handler to remove Return value: none. Example: plugin->handler_remove (plugin, my_handler);
handler_remove_all Prototype: void handler_remove_all (t_weechat_plugin *plugin) Remove all handlers for a plugin. Arguments: : pointer to plugin structure Return value: none. Example: plugin->handler_remove_all (plugin);
exec_command Prototype: void exec_command (t_weechat_plugin *plugin, char *server, char *channel, char *command) Execute a WeeChat command (or send a message to a channel). Arguments: : pointer to plugin structure : internal name of server for executing command (may be NULL) : name of channel for executing command (may be NULL) : command Return value: none. Examples: plugin->exec_command (plugin, NULL, NULL, "/help nick"); plugin->exec_command (plugin, "freenode", "#weechat", "hello");
get_info Prototype: char *get_info (t_weechat_plugin *plugin, char *info, char *server) Return an info about WeeChat or a channel. Arguments: : pointer to plugin structure : name of info to read: Info Description version WeeChat's version nick nick channel name of channel (NULL for a server or private) server name of server away "away" flag weechat_dir WeeChat home directory (by default: ~/.weechat/) weechat_libdir WeeChat system lib directory weechat_sharedir WeeChat system share directory : internal name of server for reading info (if needed) Return value: information asked, NULL if not found. Note: result has to be free by a call to "free" function after use. Examples: char *version = plugin->get_info (plugin, "version", NULL); char *nick = plugin->get_info (plugin, "nick", "freenode");
get_dcc_info Prototype: t_plugin_info_dcc *get_dcc_info (t_weechat_plugin *plugin) Return list of DCC currently active or finished. Arguments: : pointer to plugin structure Return value: linked list of DCC. Type Field Description char * server IRC server char * channel IRC channel int type DCC type: 0 = chat received, 1 = chat sent, 2 = file received, 3 = file sent int* status DCC status: 0 = waiting, 1 = connecting, 2 = active, 3 = finished, 4 = failed, 5 = interrupted by user time_t start_time date/time of DCC creation time_t start_transfer date/time of DCC transfer start unsigned long addr IP address of remote user int port port used for DCC char * nick remote nick char * filename file name char * local_filename local file name int filename_suffix suffix if renaming file unsigned long size file size unsigned long pos position in file unsigned long start_resume start position after interruption unsigned long bytes_per_sec number of bytes per second since transfer start t_plugin_dcc_info * prev_dcc pointer to previous DCC info t_plugin_dcc_info * next_dcc pointer to next DCC info Note: result has to be free by a call to "free_dcc_info" function after use. Examples: t_plugin_dcc_info *dcc_info = plugin->get_dcc_info (plugin); for (ptr_dcc = dcc_info; ptr_dcc; ptr_dcc = ptr_dcc->next_dcc) { plugin->print_server (plugin, "DCC type=%d, with: %s", ptr_dcc->type, ptr_dcc->nick); } if (dcc_info) plugin->free_dcc_info (plugin, dcc_info);
free_dcc_info Prototype: void free_dcc_info (t_weechat_plugin *plugin, t_plugin_dcc_info *dcc_info) Free memory used by a DCC list. Arguments: : pointer to plugin structure : pointer to DCC list returned by "get_dcc_info" function Return value: none. Example: plugin->free_dcc_info (plugin, dcc_info);
get_server_info Prototype: t_plugin_server_info *get_server_info (t_weechat_plugin *plugin) Return list of IRC servers (connected or not). Arguments: : pointer to plugin structure Return value: linked list of IRC servers. Type Field Description char * name server internal name int autoconnect 1 if autoconnect at start-up, 0 otherwise int autoreconnect 1 if autoreconnect when disconnected, 0 otherwise int autoreconnect_delay delay before trying again connection int command_line 1 if server was on command line (so it is temporary), 0 otherwise char * address server address (host or IP) int port port int ipv6 IPv6 connection int ssl SSL connection char * password server password char * nick1 first nickname char * nick2 alternate nickname char * nick3 second alternate nickname char * username user name char * real name real name char * command command run once connected int command_delay delay after execution of command char * autojoin channels joined automatically int autorejoin 1 if channels are rejoined when kicked, 0 otherwise char * notify_levels channels notify levels char * charset_decode_iso channels charsets for decoding ISO char * charset_decode_utf channels charsets for decoding UTF char * charset_encode channels charsets for encoding messages int is_connected 1 if connected to server, 0 otherwise int ssl_connected 1 if connected with SSL, 0 otherwise char * nick current nickname int is_away 1 if away, 0 otherwise time_t away_time time when user is marking as away int lag lag (in milliseconds) t_plugin_server_info * prev_server pointer to previous server info t_plugin_server_info * next_server pointer to next server info Note: result has to be free by a call to "free_server_info" function after use. Example: t_plugin_server_info *server_info, *ptr_server_info; server_info = plugin->get_server_info (plugin); if (server_info) { for (ptr_server_info = server_info; ptr_server_info; ptr_server_info = ptr_server_info->next_server) { plugin->print (plugin, NULL, NULL, "server: %s, address: %s, port: %d %s", ptr_server_info->name, ptr_server_info->address, ptr_server_info->port, (ptr_server_info->is_connected) ? "(connected)" : ""); } plugin->free_server_info (plugin, server_info); }
free_server_info Prototype: void free_server_info (t_weechat_plugin *plugin, t_plugin_server_info *server_info) Free memory used by server info list. Arguments: : pointer to plugin structure : pointer to server list returned by "get_server_info" function Return value: none. Example: plugin->free_server_info (plugin, server_info);
get_channel_info Prototype: t_plugin_channel_info *get_channel_info (t_weechat_plugin *plugin, char *server) Return list of IRC channels for a server. Arguments: : pointer to plugin structure : internal server name Return value: linked list of IRC channels for server. Type Field Description int type 0 for a channel, 1 for a private char * name name of channel char * topic topic of channel char * modes channel modes int limit user limit char * key channel key int nicks_count number of nicks on channel t_plugin_channel_info * prev_channel pointer to previous channel info t_plugin_channel_info * next_channel pointer to next channel info Note: result has to be free by a call to "free_channel_info" function after use. Example: t_plugin_channel_info *channel_info, *ptr_chan_info; channel_info = plugin->get_channel_info (plugin, "freenode"); if (channel_info) { for (ptr_chan_info = channel_info; ptr_chan_info; ptr_chan_info = ptr_chan_info->next_channel) { plugin->print (plugin, NULL, NULL, " %s (type %d)", ptr_chan_info->name, ptr_chan_info->type); } plugin->free_channel_info (plugin, channel_info); }
free_channel_info Prototype: void free_channel_info (t_weechat_plugin *plugin, t_plugin_channel_info *channel_info) Free memory used by channel info list. Arguments: : pointer to plugin structure : pointer to channel info list returned by "get_channel_info" function Return value: none. Example: plugin->free_channel_info (plugin, channel_info);
get_nick_info Prototype: t_plugin_nick_info *get_nick_info (t_weechat_plugin *plugin, char *server, char *channel) Return list of nicks for a channel. Arguments: : pointer to plugin structure : internal server name : channel name Return value: linked list of nicks on channel. Type Field Description char * nick nick name int flags nick flags, binary "or" between values (1 = channel owner, 2 = channel admin, 4 = op, 8 = halfop, 16 = voice, 32 = away) t_plugin_nick_info * prev_nick pointer to previous nick info t_plugin_nick_info * next_nick pointer to next nick info Note: result has to be free by a call to "free_nick_info" function after use. Example: t_plugin_nick_info *nick_info, *ptr_nick_info; nick_info = plugin->get_nick_info (plugin, "freenode", "#weechat"); if (nick_info) { for (ptr_nick_info = nick_info; ptr_nick_info; ptr_nick_info = ptr_nick_info->next_nick) { plugin->print (plugin, NULL, NULL, " %s (flags: %d)", ptr_nick_info->nick, ptr_nick_info->flags); } plugin->free_nick_info (plugin, nick_info); }
free_nick_info Prototype: void free_nick_info (t_weechat_plugin *plugin, t_plugin_nick_info *nick_info) Free memory used by nick info list. Arguments: : pointer to plugin structure : pointer to nick info list returned by "get_nick_info" function Return value: none. Example: plugin->free_nick_info (plugin, nick_info);
get_config Prototype: char *get_config (t_weechat_plugin *plugin, char *option) Return value of a WeeChat config option. Arguments: : pointer to plugin structure : name of option to read Return value: option value, NULL if not found. Note: result has to be free by a call to "free" function after use. Examples: char *value1 = plugin->get_config (plugin, "look_set_title"); char *value2 = plugin->get_config (plugin, "freenode.server_autojoin");
set_config Prototype: int set_config (t_weechat_plugin *plugin, char *option, char *value) Update value of a WeeChat config option. Arguments: : pointer to plugin structure : name of option to update : new value for option Return value: 1 if option was successfully updated, 0 if an error occurred. Example: plugin->set_config (plugin, "look_nicklist", "off");
get_plugin_config Prototype: char *get_plugin_config (t_weechat_plugin *plugin, char *option) Return value of a plugin option. Option is read from file "~/.weechat/plugins.rc" and is like: "plugin.option=value" (note: plugin name is automatically added). Arguments: : pointer to plugin structure : name of option to read Return value: option value, NULL if not found. Note: result has to be free by a call to "free" function after use. Example: char *value = plugin->get_plugin_config (plugin, "my_var");
set_plugin_config Prototype: int set_plugin_config (t_weechat_plugin *plugin, char *option, char *value) Update value of a plugin option. Option is written in file "~/.weechat/plugins.rc" and is like: "plugin.option=value" (note: plugin name is automatically added). Arguments: : pointer to plugin structure : name of option to update : new value for option Return value: 1 if option was successfully updated, 0 if an error occurred. Example : plugin->set_plugin_config (plugin, "my_var", "value");
Compile plugin Compile does not need WeeChat sources, only file "weechat-plugin.h". To compile a plugin which has one file "toto.c" (under GNU/Linux): $ gcc -fPIC -Wall -c toto.c $ gcc -shared -fPIC -o libtoto.so toto.o
Load plugin into WeeChat Copy "libtoto.so" file into system plugins directory (for example "/usr/local/lib/weechat/plugins") or into user's plugins directory (for example "/home/xxxxx/.weechat/plugins"). Under WeeChat: /plugin load toto
Plugin example Full example of plugin, which adds a /double command, which displays two times arguments on current channel (ok that's not very useful, but that's just an example!): #include <stdlib.h> #include "weechat-plugin.h" char plugin_name[] = "Double"; char plugin_version[] = "0.1"; char plugin_description[] = "Test plugin for WeeChat"; /* "/double" command manager */ int double_cmd (t_weechat_plugin *plugin, char *server, char *command, char *arguments, char *handler_args, void *handler_pointer) { if (arguments && arguments[0] && (arguments[0] != '/')) { plugin->exec_command (plugin, NULL, NULL, arguments); plugin->exec_command (plugin, NULL, NULL, arguments); } return PLUGIN_RC_OK; } int weechat_plugin_init (t_weechat_plugin *plugin) { plugin->cmd_handler_add (plugin, "double", "Display two times a message", "msg", "msg: message to display two times", NULL, &double_cmd, NULL, NULL); return PLUGIN_RC_OK; } void weechat_plugin_end (t_weechat_plugin *plugin) { /* nothing done here */ }
Scripts plugins Four plugins are provided with WeeChat to use script languages: Perl, Python, Ruby and Lua.
Load / unload scripts Scripts are loaded and unloaded with /perl, /python, /ruby and /lua commands (type /help in WeeChat for help about commands). Examples: Load a Perl script: /perl load /tmp/test.pl List all loaded Perl scripts: /perl Load a Python script: /python load /tmp/test.py List all loaded Python scripts: /python Load a Ruby script: /ruby load /tmp/test.rb List all loaded Ruby scripts: /ruby Load a Lua script: /lua load /tmp/test.lua List all loaded Lua scripts: /lua
Syntax by language
Perl In a WeeChat Perl script, all API functions and variables are prefixed by "weechat::". Example: weechat::register("test", "1.0", "end_test", "WeeChat perl script");
Python A WeeChat Python script has to start by importing weechat: import weechat All API functions and variables are prefixed by "weechat.". Example: weechat.register("test", "1.0", "end_test", "WeeChat python script")
Ruby In a WeeChat Ruby script, all code has to be in functions. So for main code, you have to define a "weechat_init" function, which is automatically called when script is loaded by WeeChat. Example: def weechat_init Weechat.register("test", "1.0", "end_test", "WeeChat ruby script") Weechat.add_command_handler("command", "my_command") return Weechat::PLUGIN_RC_OK end def my_command(server, args) Weechat.print("my command") return Weechat::PLUGIN_RC_OK end All API functions are prefixed by "Weechat." and variables by "Weechat::".
Lua In a WeeChat Lua script, all API functions are prefixed by "weechat.". Variables are prefixed by "weechat." and suffixed by "()". Example: function message_handler(server, args) weechat.print("I am a message handler") return weechat.PLUGIN_RC_OK() end
WeeChat / scripts API
register Perl prototype: weechat::register(name, version, end_function, description); Python prototype: weechat.register(name, version, end_function, description) Ruby prototype: Weechat.register(name, version, end_function, description) Lua prototype: weechat.register(name, version, end_function, description) This is first function to call in script. All WeeChat scripts have to call this function. Arguments: : unique name to identify script (each script must have unique name) : script version : function called when script is unloaded (optional parameter, empty string means nothing is called at the end) : short description of script Return value: 1 if script was registered, 0 if an error occured. Examples: # perl weechat::register("test", "1.0", "end_test", "Test script!"); # python weechat.register("test", "1.0", "end_test", "Test script!") # ruby Weechat.register("test", "1.0", "end_test", "Test script!") -- lua weechat.register("test", "1.0", "end_test", "Test script!")
print Perl prototype: weechat::print(message, [channel, [server]]) Python prototype: weechat.prnt(message, [channel, [server]]) Ruby prototype: Weechat.print(message, [channel, [server]]) Lua prototype: weechat.print(message, [channel, [server]]) Display a message on a WeeChat buffer, identified by server and channel. Arguments: : message : name of channel to find buffer for message display : internal name of server to find buffer for message display Return value: 1 if success, 0 if an error occurred. Examples: # perl weechat::print("message"); weechat::print("message", "#weechat"); weechat::print("message", "#weechat", "freenode"); # python weechat.prnt("message") weechat.prnt("message", "#weechat") weechat.prnt("message", "#weechat", "freenode") # ruby Weechat.print("message") Weechat.print("message", "#weechat") Weechat.print("message", "#weechat", "freenode") -- lua weechat.print("message") weechat.print("message", "#weechat") weechat.print("message", "#weechat", "freenode")
print_infobar Perl prototype: weechat::print_infobar(time, message); Python prototype: weechat.print_infobar(time, message) Ruby prototype: Weechat.print_infobar(time, message) Lua prototype: weechat.print_infobar(time, message) Display a message in infobar for a specified time. Arguments: : time (in seconds) for displaying message (0 = never erased) : message Return value: 1 if success, 0 if an error occurred. Examples: # perl weechat::print_infobar(5, "message"); # python weechat.print_infobar(5, "message") # ruby Weechat.print_infobar(5, "message") -- lua weechat.print_infobar(5, "message")
remove_infobar Perl prototype: weechat::remove_infobar([count]); Python prototype: weechat.remove_infobar([count]) Ruby prototype: Weechat.remove_infobar([count]) Lua prototype: weechat.remove_infobar([count]) Remove one or more messages in infobar stack. Arguments: : number of messages to remove (if argument not given or <= 0, then all messages are removed) Return value: 1 if success, 0 if an error occurred. Examples: # perl weechat::remove_infobar(1); weechat::remove_infobar(); # python weechat.remove_infobar(1) weechat.remove_infobar() # ruby Weechat.remove_infobar(1) Weechat.remove_infobar() -- lua weechat.remove_infobar(1) weechat.remove_infobar()
log Perl prototype: weechat::log(message, [channel, [server]]); Python prototype: weechat.log(message, [channel, [server]]) Ruby prototype: Weechat.log(message, [channel, [server]]) Lua prototype: weechat.log(message, [channel, [server]]) Write a message in log file for a server or a channel. Arguments: : message : name of channel to find buffer for log : internal name of server to find buffer for log Return value: 1 if success, 0 if an error occurred. Examples: # perl weechat::log("message", "#weechat", "freenode"); # python weechat.log("message", "#weechat", "freenode") # ruby Weechat.log("message", "#weechat", "freenode") -- lua weechat.log("message", "#weechat", "freenode")
add_message_handler Perl prototype: weechat::add_message_handler(message, function); Python prototype: weechat.add_message_handler(message, function) Ruby prototype: Weechat.add_message_handler(message, function) Lua prototype: weechat.add_message_handler(message, function) Add an IRC message handler, called when an IRC message is received. Arguments: : name of IRC message. To know list of IRC messages, please consult RFCs 1459 and 2812 : function called when message is received Return value: 1 if success, 0 if an error occurred. Examples: # perl weechat::add_message_handler ("privmsg", "my_function"); sub my_function { weechat::print("server=$_[0]"); ($null, $channel, $message) = split ":",$_[1],3; ($mask, $null, $channel) = split " ", $channel; weechat::print("mask=$mask, channel=$channel, msg=$message"); return weechat::PLUGIN_RC_OK; } # python weechat.add_message_handler ("privmsg", "my_function") def my_function(server, args): weechat.prnt("server="+server) null, channel, message = string.split(args, ":", 2) masque, null, channel = string.split(string.strip(channel), " ", 2) weechat.prnt("mask="+mask+", canal="+channel+", message="+message) return weechat.PLUGIN_RC_OK # ruby Weechat.add_message_handler("privmsg", "my_function") def my_function(server, args) Weechat.print("server=#{server}, args=#{args}") return Weechat::PLUGIN_RC_OK end -- lua weechat.add_message_handler ("privmsg", "my_function") function my_function(server, args) weechat.print("server=" .. server .. ", args=" .. args) return weechat.PLUGIN_RC_OK() end Note: function called when message is received has to return one of following values: PLUGIN_RC_KO: function failed PLUGIN_RC_OK: function successfully completed PLUGIN_RC_OK_IGNORE_WEECHAT: message will not be sent to WeeChat PLUGIN_RC_OK_IGNORE_PLUGINS: message will not be sent to other plugins PLUGIN_RC_OK_IGNORE_ALL: message will not be sent to WeeChat neither other plugins
add_command_handler Perl prototype: weechat::add_command_handler(command, function, [description, arguments, arguments_description, completion_template]); Python prototype: weechat.add_command_handler(command, function, [description, arguments, arguments_description, completion_template]) Ruby prototype: Weechat.add_command_handler(command, function, [description, arguments, arguments_description, completion_template]) Lua prototype: weechat.add_command_handler(command, function, [description, arguments, arguments_description, completion_template]) Add a WeeChat command handler, called when user uses command (for example /command). Arguments: : the new command name, which may be an existing command (be careful, replaced command will not be available until script is unloaded) : function called when command is executed : short description of command arguments (displayed by /help command) : long description of command arguments (displayed by /help command) : template for completion, like "abc|%w def|%i" which means "abc" or a WeeChat command for first argument, "def" or IRC command for second. (see ) Return value: 1 if success, 0 if an error occurred. Examples: # perl weechat::add_command_handler("command", "my_command"); sub my_command { weechat::print("server= $_[0], args: $_[1]"); return weechat::PLUGIN_RC_OK; } # python weechat.add_command_handler("command", "my_command") def my_command(server, args): weechat.prnt("server="+server+", args="+args) return weechat.PLUGIN_RC_OK # ruby Weechat.add_command_handler("command", "my_command") def my_command(server, args) Weechat.print("server=#{server}, args=#{args}") return Weechat::PLUGIN_RC_OK end -- lua weechat.add_command_handler("command", "my_command") def my_command(server, args) weechat.print("server="..server..", args="..args) return weechat.PLUGIN_RC_OK() end Notes: function called when command is executed has to return one of following values: PLUGIN_RC_KO : function failed PLUGIN_RC_OK : function successfully completed
add_timer_handler Perl prototype: weechat::add_timer_handler(message, function); Python prototype: weechat.add_timer_handler(message, function) Ruby prototype: Weechat.add_timer_handler(message, function) Lua prototype: weechat.add_timer_handler(message, function) Add a timer handler which periodically calls a function. Arguments: : interval (in seconds) between two calls of function. : function called Return value: 1 if success, 0 if an error occurred. Examples: # perl weechat::add_timer_handler(60, "my_timer"); sub my_timer { weechat::print("this is timer handler"); return weechat::PLUGIN_RC_OK; } # python weechat.add_timer_handler(60, "my_timer") def my_timer(server, args): weechat.prnt("this is timer handler") return weechat.PLUGIN_RC_OK # ruby Weechat.add_timer_handler(60, "my_timer") def my_timer(server, args) Weechat.print("this is timer handler") return Weechat::PLUGIN_RC_OK end -- lua weechat.add_timer_handler(60, "my_timer") function my_timer(server, args) weechat.print("this is timer handler) return weechat.PLUGIN_RC_OK() end Note: function called has to return one of following values: PLUGIN_RC_KO: function failed PLUGIN_RC_OK: function successfully completed
remove_handler Perl prototype: weechat::remove_handler(name, function); Python prototype: weechat.remove_handler(name, function) Ruby prototype: Weechat.remove_handler(name, function) Lua prototype: weechat.remove_handler(name, function) Remove a message or command handler. Arguments: : name of IRC message or command : function Return value: 1 if success, 0 if an error occurred. Examples: # perl weechat::remove_handler("command", "my_command"); # python weechat.remove_handler("command", "my_command") # ruby Weechat.remove_handler("command", "my_command") -- lua weechat.remove_handler("command", "my_command")
remove_timer_handler Perl prototype: weechat::remove_timer_handler(function); Python prototype: weechat.remove_timer_handler(function) Ruby prototype: Weechat.remove_timer_handler(function) Lua prototype: weechat.remove_timer_handler(function) Remove a timer handler. Arguments: : function Return value: 1 if success, 0 if an error occurred. Examples: # perl weechat::remove_timer_handler("my_timer"); # python weechat.remove_timer_handler("my_timer") # ruby Weechat.remove_timer_handler("my_timer") -- lua weechat.remove_timer_handler("my_timer")
command Perl prototype: weechat::command(command, [channel, [server]]); Python prototype: weechat.command(command, [channel, [server]]) Ruby prototype: Weechat.command(command, [channel, [server]]) Lua prototype: weechat.command(command, [channel, [server]]) Execute a WeeChat command (or send a message to a channel). Arguments: : command : name of channel for executing command : internal name of server for executing command Return value: 1 if success, 0 if an error occurred. Examples: # perl weechat::command("hello everybody!"); weechat::command("/kick toto please leave this channel", "#weechat"); weechat::command("/nick newnick", "", "freenode"); # python weechat.command("hello everybody!") weechat.command("/kick toto please leave this channel", "#weechat") weechat.command("/nick newnick", "", "freenode") # ruby Weechat.command("hello everybody!") Weechat.command("/kick toto please leave this channel", "#weechat") Weechat.command("/nick newnick", "", "freenode") -- lua weechat.command("hello everybody!") weechat.command("/kick toto please leave this channel", "#weechat") weechat.command("/nick newnick", "", "freenode")
get_info Perl prototype: weechat::get_info(name, [server]); Python prototype: weechat.get_info(name, [server]) Ruby prototype: Weechat.get_info(name, [server]) Lua prototype: weechat.get_info(name, [server]) Return an info about WeeChat or a channel. Arguments: : name of info to read (see ) : internal name of server for reading info (if needed) Return value: information asked, empty string if an error occurred. Examples: # perl $version = get_info("version"); $nick = get_info("nick", "freenode"); # python version = weechat.get_info("version") nick = weechat.get_info("nick", "freenode") # ruby version = Weechat.get_info("version") nick = Weechat.get_info("nick", "freenode") -- lua version = weechat.get_info("version") nick = weechat.get_info("nick", "freenode")
get_dcc_info Perl prototype: weechat::get_dcc_info(); Python prototype: weechat.get_dcc_info() Ruby prototype: Weechat.get_dcc_info() Lua prototype: weechat.get_dcc_info() Return list of DCC currently active or finished. Return value: list of DCC (see ). Examples: # perl my @dccs = weechat::get_dcc_info(); if (@dccs) { foreach my $dcc (@dccs) { while (my ($key, $value) = each %$dcc) { weechat::print("$key = '$value'"); } } } else { weechat::print("no DCC"); } # python dccs = weechat.get_dcc_info() if dccs != None: if dccs == []: weechat.prnt("no DCC") else: for d in dccs: for b in d.keys(): weechat.prnt("%s = '%s'" %(b, d[b])) else: weechat.prnt("error while getting DCC") # ruby dccs = Weechat.get_dcc_info() if dccs != nil if dccs == [] Weechat.print("no DCC") else dccs.each do |m| m.each do |key, value| Weechat.print("#{key} = '#{value}'") end end end else Weechat.print("error while getting DCC") end -- lua dccs = weechat.get_dcc_info() if dccs ~= nil then if dccs then dcc, dccinfos = next (dccs, nil) while (dcc) do key, value = next (dccinfos, nil) while (key) do weechat.print(key.." = '"..value.."'") key, value = next (dccinfos, key) end dcc, dccinfos = next (dccs, dcc) end else weechat.print("no DCC") end else weechat.print("error while getting DCC") end
get_server_info Perl prototype: weechat::get_server_info(); Python prototype: weechat.get_server_info() Ruby prototype: Weechat.get_server_info() Lua prototype: weechat.get_server_info() Return list of IRC servers (connected or not). Return value: list of servers (see ). Examples: # perl my $servers = weechat::get_server_info(); if ($servers) { while (my ($srvname, $srvinfos) = each %$servers) { while ( my ($key, $value) = each %$srvinfos) { weechat::print("$srvname -> $key = '$value'"); } } } else { weechat::print("no server"); } # python servers = weechat.get_server_info() if servers != None: if servers == {}: weechat.prnt("no server") else: for s in servers: for i in servers[s]: weechat.prnt("%s -> %s = '%s'" % (s, i, str(servers[s][i]))) else: weechat.prnt("error while getting servers") # ruby servers = Weechat.get_server_info() if servers != nil if servers == [] Weechat.print("no server") else servers.each do |n, s| s.each do |key, value| Weechat.print("#{n} -> #{key} = '#{value}'") end end end else Weechat.print("error while getting servers") end -- lua servers = weechat.get_server_info() if servers ~= nil then if servers then srv, srvinfos = next (servers, nil) while (srv) do key, value = next (srvinfos, nil) while (key) do weechat.print(srv.." -> "..key.." = '"..value.."'") key, value = next (srvinfos, key) end srv, srvinfos = next (servers, srv) end else weechat.print("no server") end else weechat.print("error while getting servers") end
get_channel_info Perl prototype: weechat::get_channel_info(server); Python prototype: weechat.get_channel_info(server) Ruby prototype: Weechat.get_channel_info(server) Lua prototype: weechat.get_channel_info(server) Return list of IRC channels for a server. Return value: list of IRC channels for server (see ). Examples: # perl my $channels = weechat::get_channel_info(weechat::get_info("server")); if ($channels) { while (my ($channame, $chaninfos) = each %$channels) { while (my ($key, $value) = each %$chaninfos) { weechat::print("$channame -> $key = '$value'"); } } } else { weechat::print("no channel"); } # python chans = weechat.get_channel_info(weechat.get_info("server")) if chans != None: if chans == {}: weechat.prnt("no channel") else: for s in chans: for i in chans[s]: weechat.prnt("%s -> %s = '%s'" % (s, i, str(chans[s][i]))) else: weechat.prnt("error while getting channels") # ruby channels = Weechat.get_channel_info(Weechat.get_info("server")) if channels != nil if channels == {} Weechat.print("no channel") else channels.each do |n, c| c.each do |key, value| Weechat.print("#{n} -> #{key} = '#{value}'") end end end else Weechat.print("error while getting channels") end -- lua chans = weechat.get_channel_info(weechat.get_info("server")) if chans ~= nil then if chans then chan, chaninfos = next (chans, nil) while (chan) do key, value = next (chaninfos, nil) while (key) do weechat.print(chan.." -> "..key.." = '"..value.."'") key, value = next (chaninfos, key) end chan, chaninfos = next (chans, chan) end else weechat.print("no channel") end else weechat.print("error while getting channels") end
get_nick_info Perl prototype: weechat::get_nick_info(server, channel); Python prototype: weechat.get_nick_info(server, channel) Ruby prototype: Weechat.get_nick_info(server, channel) Lua prototype: weechat.get_nick_info(server, channel) Return list of nicks for a channel. Return value: list of nicks on channel (see ). Examples: # perl my $nicks = weechat::get_nick_info("freenode", "#weechat"); if ($nicks) { while (my ($nickname, $nickinfos) = each %$nicks) { while ( my ($key, $value) = each %$nickinfos) { weechat::print("$nickname -> $key = '$value'"); } } } else { weechat::print("no nick"); } # python nicks = weechat.get_nick_info("freenode", "#weechat") if nicks != None: if nicks == {}: weechat.prnt("no nick") else: for n in nicks: for f in nicks[n]: weechat.prnt("%s -> %s = '%s'" % (n, f, str(nicks[n][f]))) else: weechat.prnt("error while getting nicks") # ruby nicks = Weechat.get_nick_info("freenode", "#weechat") if nicks != nil if nicks == {} Weechat.print("no nick") else nicks.each do |nk, nattr| nattr.each do |key, value| Weechat.print("#{nk} -> #{key} = '#{value}'") end end end else Weechat.print("error while getting nicks") end -- lua nicks = weechat.get_nick_info("freenode", "#weechat") if nicks ~= nil then if nicks then nick, nickinfos = next (nicks, nil) while (nick) do key, value = next (nickinfos, nil) while (key) do weechat.print(nick.." -> "..key.." = '"..value.."'") key, value = next (nickinfos, key) end nick, nickinfos = next (nicks, nick) end else weechat.print("no nick") end else weechat.print("error while getting nicks") end
get_config Perl prototype: weechat::get_config(option); Python prototype: weechat.get_config(option) Ruby prototype: Weechat.get_config(option) Lua prototype: weechat.get_config(option) Return value of a WeeChat config option. Arguments: : name of option to read Return value: option value, empty string if not found. Examples: # perl $value1 = weechat::get_config("look_nicklist"); $value2 = weechat::get_config("freenode.server_autojoin"); # python value1 = weechat.get_config("look_nicklist") value2 = weechat.get_config("freenode.server_autojoin") # ruby value1 = Weechat.get_config("look_nicklist") value2 = Weechat.get_config("freenode.server_autojoin") -- lua value1 = weechat.get_config("look_nicklist") value2 = weechat.get_config("freenode.server_autojoin")
set_config Perl prototype: weechat::set_config(option, value); Python prototype: weechat.set_config(option, value) Ruby prototype: Weechat.set_config(option, value) Lua prototype: weechat.set_config(option, value) Update value of a WeeChat config option. Arguments: : name of option to update : new value for option Return value: 1 if option was successfully updated, 0 if an error occurred. Examples: # perl weechat::set_config("look_nicklist", "off"); weechat::set_config("freenode.server_autojoin, "#weechat"); # python weechat.set_config("look_nicklist", "off") weechat.set_config("freenode.server_autojoin, "#weechat") # ruby Weechat.set_config("look_nicklist", "off") Weechat.set_config("freenode.server_autojoin, "#weechat") -- lua weechat.set_config("look_nicklist", "off") weechat.set_config("freenode.server_autojoin, "#weechat")
get_plugin_config Perl prototype: weechat::get_plugin_config(option); Python prototype: weechat.get_plugin_config(option) Ruby prototype: Weechat.get_plugin_config(option) Lua prototype: weechat.get_plugin_config(option) Return value of a plugin option. Option is read from file "~/.weechat/plugins.rc" and is like: "plugin.option=value" (note: plugin name is automatically added). Arguments: : name of option to read Return value: value of option, empty string if not found. Examples : # perl $value = weechat::get_plugin_config("my_var"); # python value = weechat.get_plugin_config("my_var") # ruby value = Weechat.get_plugin_config("my_var") -- lua value = weechat.get_plugin_config("my_var")
set_plugin_config Perl prototype: weechat::set_plugin_config(option, value); Python prototype: weechat.set_plugin_config(option, value) Ruby prototype: Weechat.set_plugin_config(option, value) Lua prototype: weechat.set_plugin_config(option, value) Update value of a plugin option. Option is written in file "~/.weechat/plugins.rc" and is like: "plugin.option=value" (note: plugin name is automatically added). Arguments: : name of option to update : new value for option Return value: 1 if option was successfully updated, 0 if an error occurred. Examples: # perl weechat::set_plugin_config("my_var", "value"); # python weechat.set_plugin_config("my_var", "value") # ruby Weechat.set_plugin_config("my_var", "value") -- lua weechat.set_plugin_config("my_var", "value")
Authors / Support This chapter lists authors and contributors for WeeChat, and shows ways to get support.
Authors WeeChat is developed by: FlashCode (Sébastien Helleu) flashcode AT flashtux.org - main developer Kolter kolter AT free.fr - developer Ptitlouis ptitlouis AT sysif.net - Debian packager
Contributors Following people contributed to WeeChat: Jiri Golembiovsky - czech translation, patches Rudolf Polzer - patches Jim Ramsay - patches Odin - SuSE RPM Pistos - patches Gwenn - patches voroskoi - hungarian translation
Get support Before asking for support, be sure you've read documentation and FAQ provided with WeeChat (documentation is this document, if you don't read all lines until this sentence, you can start again!) IRC: server "irc.freenode.net", channel "#weechat" WeeChat forum: http://forums.flashtux.org Mailing list: To subscribe: http://mail.nongnu.org/mailman/listinfo/weechat-support To send a mail on mailing list: weechat-support@nongnu.org Mailing list archives are available here: http://mail.nongnu.org/archive/html/weechat-support