WeeChat DevCenter

Friday, January 1 2010

Target buffer for IRC messages

New options have been added to choose target buffer for IRC messages.

More info and examples in documentation: https://weechat.org/doc/devel/user#irc_target_buffer

Monday, December 7 2009

SSL certificates

New options have been added to check SSL certificates when connecting to IRC servers, thanks to kolter's patch:

  • weechat.network.gnutls_ca_file: path to file with certificate authorities (by default: "%h/ssl/CAs.pem")
  • irc.server.xxx.ssl_cert: ssl certificate file used to automatically identify your nick (CertFP on oftc for example, see below)
  • irc.server.xxx.ssl_dhkey_size: replaces old option weechat.network.gnutls_dh_prime_bitsmax_lines, new default value is 2048 (safer than old default value which was 512)
  • irc.server.xxx.ssl_verify: check that the ssl connection is fully trusted (on by default)

Please note that ssl_verify is on by default, so verification is now stricter, and may fail even if it was ok with previous versions of WeeChat.

First example: connect to oftc and check certificate:

  • import certificate:
    • mkdir ~/.weechat/ssl
    • wget -O ~/.weechat/ssl/CAs.pem http://www.spi-inc.org/ca/spi-cacert.crt
  • in weechat:
    • /connect oftc

Note: it is possible to concatenate many CAs in file CAs.pem.

Second example: connect to oftc using CertFP (certificate to auto identify your nick):

  • create certificate:
    • openssl req -nodes -newkey rsa:2048 -keyout nick.key -x509 -days 365 -out nick.cer
    • cat nick.cer nick.key > ~/.weechat/ssl/nick.pem
  • in weechat:
    • /set irc.server.oftc.ssl_cert "%h/ssl/nick.pem"
    • /connect oftc
    • /msg nickserv cert add

For more information, please look at https://www.oftc.net/NickServ/CertFP.

Thursday, October 15 2009

Script translate.py

A new script translate.py is now available. It can translate words with a command or in input (whole input or last word).

Base and target languages can be customized and given as argument of command, or at beginning of input if you're using a key calling command.

Example of keys you can bind to use script:

  • translate input with Alt+t, Alt+t (using default from_to): /key bind meta-tmeta-t /translate
  • translate input with Alt+t, Alt+r (reverse of from_to): /key bind meta-tmeta-r /translate !
  • translate last word in input with Alt+t, Alt+w (using default from_to): /key bind meta-tmeta-w /translate +
  • restore input as it was before last translation with Alt+t, Alt+u: /key bind meta-tmeta-u /translate <

Other examples:

  • reverse languages (english to french by default): /translate ! this is a test
  • english to italian: /translate en_it I want this string in italian

Recommended alias:

/alias tr /translate

You can get more help with /help translate.

Monday, October 5 2009

Script hlpvitem.py

A new script hlpvitem.py is now available. It displays item in a bar (like status) with highlight or private message, from an hidden buffer. So you will see content of message before switching to that buffer.

You must add item in a bar, like status, with this command:

/set weechat.bar.status.items

then press "Tab" and complete string by adding for example (without quotes): ",[hlpv]"

Screenshot: WeeChat hlpvitem

You can setup some options with /set:

  • /set plugins.var.python.hlpvitem.showallbuffers on/off (default: off)
  • /set plugins.var.python.hlpvitem.buffer_number on/off (default: on)
  • /set plugins.var.python.hlpvitem.buffershortname on/off (default: on)
  • /set plugins.var.python.hlpvitem.highlight on/off (default: on)
  • /set plugins.var.python.hlpvitem.private on/off (default: on)
  • /set plugins.var.python.hlpvitem.string_highlight "string" (default: empty)
  • /set plugins.var.python.hlpvitem.string_private "string" (default: empty)
  • /set plugins.var.python.hlpvitem.string_delimiter "string" (default: " > ")
  • /set plugins.var.python.hlpvitem.colorstringhighlight color (default: empty)
  • /set plugins.var.python.hlpvitem.colorstringprivate color (default: empty)
  • /set plugins.var.python.hlpvitem.colorbuffernumber color (default: empty)
  • /set plugins.var.python.hlpvitem.colorbuffername color (default: "default")
  • /set plugins.var.python.hlpvitem.color_prefix color (default: "white")
  • /set plugins.var.python.hlpvitem.color_delimiter color (default: "cyan")
  • /set plugins.var.python.hlpvitem.color_message color (default: "default")
  • /set plugins.var.python.hlpvitem.visible_seconds N (default: 7)

Tuesday, September 15 2009

IRC CTCP replies

It is now possible to customize CTCP replies, or block some CTCP queries (do not reply).

For example, to customize reply to CTCP "VERSION", use following command:

/set irc.ctcp.version "I'm running WeeChat $version, it rocks!"

If you want to block CTCP "VERSION" (do not reply to a query), then set empty string:

/set irc.ctcp.version ""

Even unknown CTCP can be customized, for example you can reply to CTCP "BLABLA":

/set irc.ctcp.blabla "This is my answer to CTCP BLABLA"

It is possible to customize CTCP for one server only, using its internal name before CTCP name:

/set irc.ctcp.freenode.version "WeeChat $version (for freenode)"

If you want to restore standard CTCP reply, then remove option:

/unset irc.ctcp.version

Some codes are automatically expanded by WeeChat when replying to CTCP, please read documentation for more information (User's guide, chapter: Plugins / IRC plugin / CTCP replies).

Sunday, September 6 2009

Version 0.3.0

Version 0.3.0 is released, after 2 years of work and more than 1000 commits!

This is a major upgrade since last stable, please read files UPGRADE_0.3 and ChangeLog for list of changes: configuration files and plugin API are not compatible with previous versions.

For this important release, site has moved to weechat.org, with a new look!

Enjoy WeeChat!

Wednesday, June 10 2009

Merge of buffers

It is now possible to merge buffers with command /buffer merge (or unmerge). IRC plugin uses that feature to merge server buffers, with the new option irc.look.server_buffer (merge_with_core, merge_without_core, independent).

When a buffer is merged to one or more other buffers, they will have same number, and chat area will display mixed lines (short name of buffer is displayed on each line, to know to which buffer line belongs). Bars still display content for current selected buffer.

New key Ctrl+x has been added to swtich current active buffer when many buffers are merged (old key Alt+s has been removed).

For devel users: it's not possible to upgrade from previous versions to this one, and you should do /key missing to add missing key.

Saturday, May 2 2009

Data for callbacks in script API

Major changes were done in script API: data string was added to all callbacks. C plugin API is already ok (there is data pointer for callbacks).
Therefore, all scripts for development version are incompatible with this new version. All official scripts have been updated on plugins page.

This data string must be added after each callback function in arguments of functions. For example in python :

weechat.hook_command("go", "Quick jump to buffers", "", "", "", "go_cmd")
(...)
def go_cmd(buffer, args):

becomes:

weechat.hook_command("go", "Quick jump to buffers", "", "", "", "go_cmd", "")
(...)
def go_cmd(data, buffer, args):

Friday, April 24 2009

Easy switch between two buffers

A new feature has been added recently to easily switch to another buffer, then come back to current one.
For example if you are on buffer #2, you press Alt+1 twice: you'll come back to buffer #2.

This new feature can be disabled, if you think old behaviour was better (really?):

/set weechat.look.jump_current_to_previous_buffer off

Saturday, April 11 2009

Completion improved for command arguments

Completion has been improved for command arguments. Now many templates are allowed for one command, and WeeChat will automatically choose and use the better template according to arguments you give on command line.

Let's take an example: the /proxy command. Completion template is this string:

add %(proxies_names) http|socks4|socks5 || del %(proxies_names) || set %(proxies_names) %(proxies_options) || list

The single pipe is still used to add many possible items for one argument. Now a double pipe has been added to separate many templates. WeeChat will choose template according to arguments you give before completion location in command line.
Example 1: if you enter: "/proxy add [+tab]", then WeeChat will use first template ("add %(proxies_names) http|socks4|socks5").
Example 2: if you enter: "/proxy set [+tab]", WeeChat will used third template ("set %(proxies_names) %(proxies_options)").

Now, you'll ask: but how to complete first argument of command? WeeChat can't know which template to use!
Hey, good question! I was sure you would ask that ;)
The answer is very simple: for first argument, WeeChat will make a "or" between first argument of each template (so it will use a fictive template which is: "add|del|set").

It's recommended to use plain words for first argument of each template (when using many templates). If you use many words (separated by single pipe), or items (%(xxx)), then WeeChat will not know which template to use, and may not complete at all.

Another thing you should know, default completion items (defined by WeeChat core) have been renamed. Old name was something like "%x", new name is"%(xxx)". For example %n has been renamed to %(nicks). Some new completions have been added too. Please read doc for new names (and now that includes names of completion items defined by plugins).

If you are using old development version, nick completion will be broken, so you'll have to issue following command: /unset weechat.completion.default_template

Happy completion party!

Tuesday, April 7 2009

Script weeget.py, a script manager!

A new script weeget.py is now available. It is a scripts manager: you can install, remove, upgrade your scripts using command /weeget.

Following actions are available :

  • update local cache (list of scripts, which automatically expires after one hour by default),
  • show detailed info about scripts,
  • install scripts,
  • remove scripts,
  • upgrade all obsolete scripts,
  • check status of local scripts.

Weeget uses its own configuration file, called wg.conf.

You can setup some options with /set:

  • /set wg.color.installed color (default: yellow)
  • /set wg.color.language color (default: lightblue)
  • /set wg.color.obsolete color (default: lightmagenta)
  • /set wg.color.running color (default: lightgreen)
  • /set wg.color.script color (default: cyan)
  • /set wg.color.unknown color (default: lightred)
  • /set wg.scripts.cache_expire time (default: 60)
  • /set wg.scripts.dir directory (default: %h/weeget)
  • /set wg.scripts.url url (default: http://www.weechat.org/files/plugins.xml.gz)

Updated on 2012-09-29: since version 0.3.9, weeget.py has been replaced by a C plugin called "script" (command /script), see Scripts manager.

Screenshot: WeeChat weeget

Sunday, March 8 2009

Script vdm.py

A new script vdm.py is now available. With that script, you can read fmylife.com and viedemerde.fr websites in WeeChat, using command /vdm.
Help is available with /help vdm when script is loaded.

You can setup some options with /set:

  • /set plugins.var.python.vdm.auto_switch on/off (default: on)
  • /set plugins.var.python.vdm.blank_line on/off (default: on)
  • /set plugins.var.python.vdm.color_number color (default: cyan)
  • /set plugins.var.python.vdm.colors color1;color2;... (default: default;green;brown)
  • /set plugins.var.python.vdm.lang fr/en (default: en)
  • /set plugins.var.python.vdm.numberasprefix on/off (default: on)
  • /set plugins.var.python.vdm.reverse on/off (default: off)
  • /set plugins.var.python.vdm.url url (default: http://api.betacie.com/view/%s?key=readonly&language=%s)

Screenshot: WeeChat vdm

Friday, March 6 2009

New hook "process"

New hook type "process" has been added to WeeChat. You can use it in C plugins, and all scripts languages (perl, python, ruby, lua and tcl).

It runs a command with fork, and send you result (return code, stdout and stderr) via a callback, when command has ended, or if WeeChat output buffer is full (then it will be partial result of command). There is optional timeout (in milliseconds), to kill process if it's still running after given time.

The script shell.py has been updated to use that new hook.

Sunday, February 8 2009

Script go.py

A new script go.py is now available. With that script, you can quickly jump to other buffers, by typing some letters. You can use Tab and shift-Tab keys to select next/previous buffer in list.
Help is available with /help go when script is loaded.

Screenshot: WeeChat go

Sunday, January 4 2009

New version of script iset.pl

Script iset.pl has been improved. Now you can setup colors for option names, types and values. And null values are displayed with different color (for IRC server options). There's new config options, you can set with /set command:

  • /set plugins.var.perl.iset.colorbgselected color
  • /set plugins.var.perl.iset.color_option color
  • /set plugins.var.perl.iset.coloroptionselected color
  • /set plugins.var.perl.iset.color_type color
  • /set plugins.var.perl.iset.colortypeselected color
  • /set plugins.var.perl.iset.color_value color
  • /set plugins.var.perl.iset.colorvalueselected color
  • /set plugins.var.perl.iset.colorvalueundef color
  • /set plugins.var.perl.iset.colorvalueundef_selected color

A screenshot is better than long speech: weechat_iset_2009-01-04.png

Updated on 2017-06-26: the script is now obsolete, replaced by the builtin fset plugin.

Wednesday, December 17 2008

New bar filling options

Two new bar filling options have been added: columns_horizontal and columns_vertical. It is used to display bar items in columns, with vertical or horizontal sort.

Screenshot, with 2 nicklists, one on top, one on the right, with columns_vertical filling:

weechat_bar_filling_columns.png

Wednesday, November 26 2008

New plugin DC

A new plugin has been added: DC. It is used to transfer files using DC file-sharing protocol.

It's available as a separate plugin, and must be compiled and installed with WeeChat development version.
Documentation and screenshots are available on this wiki page: http://wiki.flashtux.org/wiki/WeeChat/dc

Sunday, November 23 2008

Support for many proxies

Support for many proxies has been added. It's now possible to create many proxies, and assign different proxy (or no proxy) for each IRC server.

To create, delete, list proxies, use new /proxy command. New IRC option for each server is irc.server.xxx.proxy = name, where name is the name of proxy to use for connection.

For example, to define a http proxy and use it only on freenode server:

/proxy add myproxy http sample.host.org 8888
/set irc.server.freenode.proxy "myproxy"

Thursday, November 13 2008

Script mastermind.pl

A new script mastermind.pl is now available!

Screenshot: Mastermind

Keys are displayed on buffer displayed by /mastermind, enjoy!

Friday, October 31 2008

New logger features

Logger plugin has been improved with many new features:

  • command /logger (to see log status for open buffers, and set/disable log level on a buffer)
  • custom level by buffer (or group of buffers)
  • custom log filename mask by buffer (or group of buffers).

Set one directory by IRC server and a file by channel inside:

Do that: /set logger.mask.irc irc/$server/$channel.weechatlog

You'll have a tree like that:

~/.weechat/
    |- logs/
        |- irc/
            |--- freenode/
            |       freenode.weechatlog
            |       #weechat.weechatlog
            |       #mychan.weechatlog
            |--- oftc/
            |       oftc.weechatlog
            |       #chan1.weechatlog
            |       #chan2.weechatlog

Log all messages on IRC buffers but not join/part/quit messages:

  • for all IRC buffers: /set logger.level.irc 3
  • for a server and its channels: /set logger.level.irc.freenode 3
  • for a specific channel: /set logger.level.irc.freenode.#weechat 3

Sunday, October 26 2008

Git branch protocols merged to master

Git branch "protocols" has been merged to "master".

If you're using protocols branch, you should switch back to master branch now, using following commands:

git checkout master
git pull
git remote prune origin

Saturday, October 25 2008

Smart IRC join/part/quit message filter

A new smart filter for IRC join/part/quit message has been added. It is disabled by default (so you'll see all join/part/quit by default).

To enable it, use following commands:

/set irc.look.smart_filter on
/filter add irc_smart * irc_smart_filter *

You can setup delay: /set irc.look.smart_filter_delay 5

How does it work?

When a nick spoke on channel during past X minutes (where X is delay irc.look.smart_filter_delay), its join/part/quit will be displayed by default. Otherwise, if nick did not speak for a long time, all join/part/quit messages will be tagged with "irc_smart_filter". So you have to define a filter on this tag to hide join/part/quit from users that are not speaking on channel (see command above).

Saturday, October 18 2008

Aspell plugin is born again

New aspell plugin is available!

Plugin as now its own configuration file, called aspell.conf. Options can be set with /set command. List of options with default value:

  • aspell.look.color = lightred
  • aspell.check.commands = "ame,amsg,away,command,cycle,kick,kickban,me,msg,notice,part,query,quit,topic"
  • aspell.check.default_dict = ""
  • aspell.check.word_min_length = 2

You can enable aspell for all buffers with default dictionary (or list of dictionaries), with command: /set aspell.check.default_dict "en,fr"

To enable a specific language on a buffer, use: /aspell enable fr
If you speak both english and german (often english, less german), use: /aspell enable en,de

Monday, October 6 2008

New plugin Tcl

A new plugin Tcl has been added (thanks to Dmitry Kobylin). Some minor changes will be done about compiling (with autotools and cmake), but plugin should be ok today as-is.

Script samples using new API, including Tcl language, will be published soon.

Thursday, October 2 2008

Save and restore layout

New command /layout has been added and a new option weechat.look.save_layout_on_exit. WeeChat now saves layout (windows layout and order of buffers). With /layout command, you can show saved layout, apply layout, and save layout for windows and/or buffers.

Windows layout is position of windows (including size), and buffer displayed in windows (plugin and buffer name).
Buffers layout is order of buffers, ie numbers assigned to buffers.

Thursday, September 4 2008

Ignore command, reloaded!

The new /ignore command is now available. You can ignore nicks (or hostnames), using regex.

Note: this command will be improved in near future with more options.

Some exemples (you can find them with /help ignore):

  • ignore nick "toto" everywhere: /ignore add toto
  • ignore host "toto@domain.com" on freenode server: /ignore add toto@domain.com freenode
  • ignore host "toto*@*.domain.com" on freenode/#weechat: /ignore add toto*@*.domain.com freenode #weechat

Tuesday, September 2 2008

New version of script buffers.pl

Script buffers.pl has been improved. Now you can hide categories, and there's color for lines according to hotlist (activity on buffers). There's new config options, you can set with /set command:

Hide categories:

  • /set plugins.var.perl.buffers.show_category off

Change colors (replace "color" by your color, which may be "fg" or "fg,bg"):

  • /set plugins.var.perl.buffers.color_number color
  • /set plugins.var.perl.buffers.color_slash color
  • /set plugins.var.perl.buffers.color_hotlist_low color
  • /set plugins.var.perl.buffers.color_hotlist_message color
  • /set plugins.var.perl.buffers.color_hotlist_private color
  • /set plugins.var.perl.buffers.color_hotlist_highlight color

A screenshot is better than long speech: weechat_bar_buffers_2008-09-02.png

Updated on 2017-05-13: the script is now obsolete, replaced by the builtin buflist plugin, introduced in version 1.8.

Wednesday, August 20 2008

Upgrade command is back!

New version of /upgrade command is now available. Today it's working for core and IRC plugin. Almost all code has been rewritten, so maybe there are new bugs ;)

Known bugs/limits today:

  • IRC plugin: not working if WeeChat is currently reconnecting to server
  • IRC plugin: all messages queued (anti-fllood when sending to server) are lost during upgrade
  • upgrade does not work for xfer plugin

Tuesday, May 6 2008

Xfer plugin

A new "xfer" plugin has been added. It replaces old IRC DCC code.
This plugin is called by IRC plugin to initiate direct chat and file transfer (still by /dcc command). In future, it may be used by other plugins. Moreover, new protocols can be easily added to xfer plugin, if other plugins need that.

Saturday, April 19 2008

Script iset.pl

A new script iset.pl is now available. With that script, you can change WeeChat options with better interface than /set.
Help is available with /help iset when script is loaded.

Screenshot: WeeChat iset

Updated on 2017-06-26: the script is now obsolete, replaced by the builtin fset plugin.

Saturday, March 29 2008

Script weetris.pl

A new script weetris.pl is now available! You can now play to your favorite game inside WeeChat :)

Screenshot: WeeTris

Short instructions:

  • keys are:
    • Left/Right/Bottom: move
    • Up: rotate
    • Alt+n: start a new game
  • number of lines are displayed

Incoming features:

  • pause key
  • view of next form
  • save/resume game
  • network game: vs other players (over IRC or other network protocol)

Updated on 2019-09-29: the script has been rewritten in Python: weetris.py.

Saturday, March 22 2008

Filters and tags

Filters have been added. This feature replaces old /ignore command for IRC, but is more powerful and is not specific to IRC, it applies on buffer content. With new /filter command, you can ask WeeChat to filter lines displayed, by tags and/or regular expression on content of line. Unlike old /ignore command, the /filter command only hides lines, they are not removed, and you can see them when you want.

To understand filters, you should know what are tags. Each line displayed in a (formated) buffer may have optional tags, which are one or more words for this line. Number of tags is not limited, but should be reasonable (4 or 5 max). Tags are not visible (not displayed in buffer), they are used to filter content of buffers.

IRC plugin uses tags for all messages displayed if they're issued from an IRC server. Tags are: "irc_xxx" where "xxx" is the command received. For example if someone joins IRC channel, line with "--> nick has joined #channel" will have tag "irc_join". For IRC numeric command, tag is "irc_cmd_xxx" where "xxx" is number (3 digits), and second tag is "irc_numeric".

Some examples of filters:

  • filter IRC join/part/quit messages (if you find them boring!): /filter add joinquit * irc_join,irc_part,irc_quit *
  • filter lines containing word "spam": /filter add spamfilter * * spam
  • filter lines containing "weechat sucks" on channel #weechat: /filter add sucks irc.freenode.#weechat * weechat sucks


You can enable/disable filters by /filter command (look at /help filter) or with shortcut key meta + "=".

In a later version, you'll be able to see indicator in status bar, to know if filters are enabled or not, and if something is filtered on current buffer (lines hidden). This will be possible with new bars.

Saturday, March 15 2008

Bars

Bars have been added to WeeChat. They are used to display informations around chat area. In near future, some existing items will become real bars (like title, nicklist, status, input).
Plugin and script API is now ready for using these bars. Following screenshot is a demo of scripts buffers.pl and uptime.pl:

Updated on 2008-10-12: new bars are now used: title, nicklist, status, input.

weechat_bars_buffers_uptime.png

page 4 of 4 -