WeeChat DevCenter

Tag - hook

Entries feed

Monday, February 10 2014

Trigger plugin

A new plugin called "trigger" has been added.

This plugin can hook many things:

  • signal
  • hsignal
  • modifier
  • print
  • command
  • command_run
  • timer
  • config
  • focus

When the callback is called, trigger can:

  • check some conditions (to execute the trigger or not), which are evaluated (see /help eval)
  • replace some text using regular expression(s)
  • execute command(s)
  • have a custom return code.

Example of things you can do with trigger:

  • notification, for example beep on highlight/private message (it can replace script beep.pl or other scripts)
  • hide passwords in commands/messages (it will replace rmodifier plugin)
  • change content of messages displayed
  • change things displayed (nicklist, ...) when terminal becomes small
  • regularly save config files (with a timer)
  • ...

Help is available with /help trigger.

Some examples of triggers can be found on GitHub WeeChat wiki.