trigger: add hook "info_hashtable"
parent
8bc06ea101
commit
30768d4d24
|
@ -30,7 +30,7 @@ New features::
|
|||
* relay: add option relay.weechat.commands (issue #928)
|
||||
* script: use SHA-512 instead of MD5 for script checksum
|
||||
* spell: rename aspell plugin to spell (issue #1299)
|
||||
* trigger: add hook "info"
|
||||
* trigger: add hooks "info" and "info_hashtable"
|
||||
* xfer: rename option xfer.network.speed_limit to xfer.network.speed_limit_send, add option xfer.network.speed_limit_recv (issue #269)
|
||||
|
||||
Bug fixes::
|
||||
|
|
|
@ -20,67 +20,69 @@
|
|||
default -yes
|
||||
monitor [<filter>]
|
||||
|
||||
list: zeigt eine Liste aller Trigger (ohne Angabe von Argumente wird diese Liste standardmäßig ausgegeben)
|
||||
listfull: zeigt eine detaillierte Liste, mit zusätzlichen Informationen, aller Trigger an
|
||||
listdefault: zeigt die standardmäßig genutzten Trigger an
|
||||
add: fügt einen Trigger hinzu
|
||||
addoff: fügt einen Trigger hinzu (deaktiviert)
|
||||
addreplace: erzeugt neuen Trigger oder ersetzt einen schon existierenden Trigger
|
||||
name: Name des Trigger
|
||||
hook: signal, hsignal, modifier, print, command, command_run, timer, config, focus
|
||||
arguments: Argumente für den Hook, abhängig vom genutzten Hook (getrennt durch Semikolon):
|
||||
signal: Name(en) des signals (erforderlich)
|
||||
hsignal: Name(en) des hsignal (erforderlich)
|
||||
modifier: Name(en) des modifier (erforderlich)
|
||||
line: Buffertyp ("formatted", "free" oder "*"), Liste von Buffermasken, Tags
|
||||
list: list triggers (without argument, this list is displayed)
|
||||
listfull: list triggers with detailed info for each trigger
|
||||
listdefault: list default triggers
|
||||
add: add a trigger
|
||||
addoff: add a trigger (disabled)
|
||||
addreplace: add or replace an existing trigger
|
||||
name: name of trigger
|
||||
hook: signal, hsignal, modifier, line, print, command, command_run, timer, config, focus, info, info_hashtable
|
||||
arguments: arguments for the hook, depending on hook (separated by semicolons):
|
||||
signal: name(s) of signal (required)
|
||||
hsignal: name(s) of hsignal (required)
|
||||
modifier: name(s) of modifier (required)
|
||||
line: buffer type ("formatted", "free" or "*"), list of buffer masks, tags
|
||||
print: buffer, tags, message, strip colors
|
||||
command: Befehl (erforderlich), Beschreibung, Argumente, Beschreibung der Argumente, Vervollständigung
|
||||
command_run: Befehl(e) (erforderlich)
|
||||
timer: Intervall (erforderlich), Anpassung an Sekunden (erforderlich), maximale Anzahl an Aufrufen
|
||||
config: Name der Einstellung (erforderlich)
|
||||
focus: Name(n) für sichtbaren Bereich (erforderlich) (z.B. "chat" für Chatbereich)
|
||||
conditions: evaluierte Bedingungen für den Trigger
|
||||
regex: einer oder mehrere reguläre Ausdrücke um Zeichenketten in Variablen zu ersetzen
|
||||
command: Befehl welcher ausgeführt werden soll (mehrere Befehle müssen durch ";" voneinander getrennt werden)
|
||||
return_code: Rückgabewert für Callback (ok (standard), ok_eat, error)
|
||||
post_action: Aktion welche nach der Abarbeitung des Triggers ausgeführt werden soll (none (Standardwert), disable, delete)
|
||||
addinput: erstellt einen Trigger mit einer standardmäßigen Mustervorlage
|
||||
input: kopiert den kompletten Trigger-Befehl in die Eingabezeile
|
||||
output: schickt den Trigger-Befehl als Text in den Buffer
|
||||
recreate: wie "input", allerdings wird die Einstellung "addreplace" anstelle von "add" genutzt
|
||||
set: definiert, innerhalb eines Triggers, eine Einstellung neu
|
||||
option: Name einer Einstellung: name, hook, arguments, conditions, regex, command, return_code
|
||||
(um Hilfe über eine Einstellung zu erhalten: /help trigger.trigger.<name>.<option>)
|
||||
value: neuer Wert für Einstellung
|
||||
rename: benennt einen Trigger um
|
||||
copy: kopiert einen Trigger
|
||||
enable: aktiviert Trigger (ohne Angabe von Argumenten: aktiviert alle Trigger)
|
||||
disable: deaktiviert Trigger (ohne Angabe von Argumenten: deaktiviert alle Trigger)
|
||||
toggle: de-/aktiviert Trigger (ohne Angabe von Argumenten: de-/aktiviert alle Trigger)
|
||||
restart: startet Trigger neu (Hook(s) werden neu erstellt)
|
||||
show: zeigt detaillierte Informationen zu einem Trigger (inklusive einer kleinen Statistik)
|
||||
del: entfernt einen Trigger
|
||||
-all: führt eine Aktion aus, die alle Trigger beinhaltet
|
||||
restore: stellt Trigger mit Standardwerten wieder her (funktioniert nur bei vorgegebenen Triggern)
|
||||
default: stellt die standardmäßigen Trigger wieder her
|
||||
monitor: öffnet den Trigger Monitor-Buffer, mit optionaler Filterfunktion:
|
||||
Filter: zeigt Hooks/Trigger an (ein Hook muss mit "@" beginnen, zum Beispiel "@signal"), mehrere Filter können durch Kommata voneinander getrennt werden; Platzhalter "*" kann im Namen des Trigger verwendet werden
|
||||
command: command (required), description, arguments, description of arguments, completion
|
||||
command_run: command(s) (required)
|
||||
timer: interval (required), align on second, max calls
|
||||
config: name(s) of option (required)
|
||||
focus: name(s) of area (required)
|
||||
info: name(s) of info (required)
|
||||
info_hashtable: name(s) of info (required)
|
||||
conditions: evaluated conditions for the trigger
|
||||
regex: one or more regular expressions to replace strings in variables
|
||||
command: command to execute (many commands can be separated by ";")
|
||||
return_code: return code in callback (ok (default), ok_eat, error)
|
||||
post_action: action to take after execution (none (default), disable, delete)
|
||||
addinput: set input with default arguments to create a trigger
|
||||
input: set input with the command used to create the trigger
|
||||
output: send the command to create the trigger on the buffer
|
||||
recreate: same as "input", with option "addreplace" instead of "add"
|
||||
set: set an option in a trigger
|
||||
option: name of option: name, hook, arguments, conditions, regex, command, return_code
|
||||
(for help on option, you can type: /help trigger.trigger.<name>.<option>)
|
||||
value: new value for the option
|
||||
rename: rename a trigger
|
||||
copy: copy a trigger
|
||||
enable: enable trigger(s) (without arguments: enable triggers globally)
|
||||
disable: disable trigger(s) (without arguments: disable triggers globally)
|
||||
toggle: toggle trigger(s) (without arguments: toggle triggers globally)
|
||||
restart: restart trigger(s) (recreate the hooks)
|
||||
show: show detailed info on a trigger (with some stats)
|
||||
del: delete a trigger
|
||||
-all: do action on all triggers
|
||||
restore: restore trigger(s) with the default values (works only for default triggers)
|
||||
default: delete all triggers and restore default ones
|
||||
monitor: open the trigger monitor buffer, with optional filter:
|
||||
filter: filter hooks/triggers to display (a hook must start with "@", for example "@signal"), many filters can be separated by commas; wildcard "*" is allowed in each trigger name
|
||||
|
||||
Wenn ein Trigger-Callback aufgerufen wird, dann wird folgende Befehlskette ausgeführt:
|
||||
1. Überprüfung von Bedingungen; falls unwahr, beenden
|
||||
2. ersetze Text mittels einem oder mehreren erweiterten regulären POSIX Ausdrücken (sofern im Trigger definiert)
|
||||
3. ein oder mehrere Befehle werden ausgeführt (sofern im Trigger definiert)
|
||||
4. Beendigung mit einem Rückgabewert (ausgenommen sind modifiers, line und focus)
|
||||
5. Aktion welche nach der Abarbeitung des Triggers ausgeführt werden soll
|
||||
When a trigger callback is called, following actions are performed, in this order:
|
||||
1. check conditions; if false, exit
|
||||
2. replace text using POSIX extended regular expression(s) (if defined in trigger)
|
||||
3. execute command(s) (if defined in trigger)
|
||||
4. exit with a return code (except for modifier, line, focus, info and info_hashtable)
|
||||
5. perform post action
|
||||
|
||||
Beispiele (die standardmäßig, eingebauten Trigger kann man sich mit "/trigger listdefault" anzeigen lassen):
|
||||
fügt einer Nachricht die Textattribute *fett*, _unterstrichen_ und /kursiv/ hinzu:
|
||||
Examples (you can also look at default triggers with /trigger listdefault):
|
||||
add text attributes *bold*, _underline_ and /italic/ (only in user messages):
|
||||
/trigger add effects modifier weechat_print "${tg_tag_nick}" "==\*([^ ]+)\*==*${color:bold}${re:1}${color:-bold}*== ==_([^ ]+)_==_${color:underline}${re:1}${color:-underline}_== ==/([^ ]+)/==/${color:italic}${re:1}${color:-italic}/"
|
||||
verbirgt die Nicklist auf kleineren Terminals:
|
||||
hide nicklist bar on small terminals:
|
||||
/trigger add resize_small signal signal_sigwinch "${info:term_width} < 100" "" "/bar hide nicklist"
|
||||
/trigger add resize_big signal signal_sigwinch "${info:term_width} >= 100" "" "/bar show nicklist"
|
||||
speichert die Konfiguration jede Stunde ab:
|
||||
silently save config each hour:
|
||||
/trigger add cfgsave timer 3600000;0;0 "" "" "/mute /save"
|
||||
öffnet den Trigger Monitor und zeigt ausschließlich modifier und Trigger an, die mit "resize" im Namen beginnen:
|
||||
open trigger monitor and show only modifiers and triggers whose name starts with "resize":
|
||||
/trigger monitor @modifier,resize*
|
||||
----
|
||||
|
|
|
@ -3667,7 +3667,7 @@ Ein Trigger hat folgende Optionen (Benennung ist
|
|||
Wenn die Option auf `off` gesetzt ist, dann ist der Trigger deaktiviert und die Ausführung ist gestoppt.
|
||||
|
||||
| hook | `signal`, `hsignal`, `modifier`, `line`, `print`, `command`,
|
||||
`command_run`, `timer`, `config`, `focus`, `info` |
|
||||
`command_run`, `timer`, `config`, `focus`, `info`, `info_hashtable` |
|
||||
Der hook welcher durch Trigger genutzt werden soll. Für weitere Informationen siehe
|
||||
link:weechat_plugin_api.en.html#hooks[Anleitung für API Erweiterung / Hooks] (Englisch).
|
||||
|
||||
|
@ -3721,7 +3721,7 @@ abgearbeitet:
|
|||
. ersetze Text mittels erweitertem regulärer POSIX Ausdruck (sofern im Trigger definiert)
|
||||
. ein oder mehrere Befehle werden ausgeführt (sofern im Trigger definiert)
|
||||
. Beendigung mit einem Rückgabewert (ausgenommen sind die Hooks _modifier_,
|
||||
_line_, _focus_ und _info_)
|
||||
_line_, _focus_, _info_ und _info_hashtable_)
|
||||
. Aktion welche nach der Abarbeitung des Triggers ausgeführt werden soll (falls der Wert abweichend von `none` sein sollte).
|
||||
|
||||
[[trigger_hook_arguments]]
|
||||
|
@ -3826,6 +3826,14 @@ ein Semikolon getrennt.
|
|||
3. ... |
|
||||
`+my_info+` |
|
||||
link:weechat_plugin_api.en.html#_hook_info[hook_info] (Englisch)
|
||||
|
||||
// TRANSLATION MISSING
|
||||
| info_hashtable |
|
||||
1. info name (Priorität erlaubt) (erforderlich) +
|
||||
2. info name (Priorität erlaubt) +
|
||||
3. ... |
|
||||
`+my_info+` |
|
||||
link:weechat_plugin_api.en.html#_hook_info_hashtable[hook_info_hashtable] (Englisch)
|
||||
|===
|
||||
|
||||
[[trigger_conditions]]
|
||||
|
@ -3862,18 +3870,20 @@ welche abhängig von dem genutzten Hook ist:
|
|||
|
||||
[width="100%",cols="2,3,7",options="header"]
|
||||
|===
|
||||
| Hook | Standard-Variable | Update allowed ^(1)^
|
||||
| signal | tg_signal_data |
|
||||
| hsignal | |
|
||||
| modifier | tg_string | tg_string
|
||||
| line | message | buffer, buffer_name, y, date, date_printed, str_time, tags, notify_level, highlight, prefix, message
|
||||
| print | tg_message |
|
||||
| command | tg_argv_eol1 |
|
||||
| command_run | tg_command |
|
||||
| timer | tg_remaining_calls |
|
||||
| config | tg_value |
|
||||
| focus | |
|
||||
| info | tg_info | tg_info
|
||||
| Hook | Standard-Variable | Update allowed ^(1)^
|
||||
| signal | tg_signal_data |
|
||||
| hsignal | |
|
||||
| modifier | tg_string | tg_string
|
||||
| line | message | buffer, buffer_name, y, date, date_printed, str_time, tags, notify_level, highlight, prefix, message
|
||||
| print | tg_message |
|
||||
| command | tg_argv_eol1 |
|
||||
| command_run | tg_command |
|
||||
| timer | tg_remaining_calls |
|
||||
| config | tg_value |
|
||||
| focus | |
|
||||
| info | tg_info | tg_info
|
||||
// TRANSLATION MISSING
|
||||
| info_hashtable | | all variables received in hashtable
|
||||
|===
|
||||
|
||||
[NOTE]
|
||||
|
@ -4189,6 +4199,20 @@ Der Callback von "info" legt folgende Variablen in der Hashtable an:
|
|||
| tg_info | string | Empty string (the info to return).
|
||||
|===
|
||||
|
||||
// TRANSLATION MISSING
|
||||
[[trigger_data_info_hashtable]]
|
||||
===== Info_hashtable
|
||||
|
||||
Der Callback von "info_hashtable" legt folgende Variablen in der Hashtable an:
|
||||
|
||||
[width="100%",cols="3m,2,14",options="header"]
|
||||
|===
|
||||
| Variable | Typ | Beschreibung
|
||||
| tg_info_name | string | Name of info.
|
||||
|===
|
||||
|
||||
Das Hashtable enthält alle Schlüssel/Werte (Typ: string/string).
|
||||
|
||||
[[trigger_examples]]
|
||||
==== Beispiele
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ listdefault: list default triggers
|
|||
addoff: add a trigger (disabled)
|
||||
addreplace: add or replace an existing trigger
|
||||
name: name of trigger
|
||||
hook: signal, hsignal, modifier, line, print, command, command_run, timer, config, focus
|
||||
hook: signal, hsignal, modifier, line, print, command, command_run, timer, config, focus, info, info_hashtable
|
||||
arguments: arguments for the hook, depending on hook (separated by semicolons):
|
||||
signal: name(s) of signal (required)
|
||||
hsignal: name(s) of hsignal (required)
|
||||
|
@ -39,6 +39,8 @@ listdefault: list default triggers
|
|||
timer: interval (required), align on second, max calls
|
||||
config: name(s) of option (required)
|
||||
focus: name(s) of area (required)
|
||||
info: name(s) of info (required)
|
||||
info_hashtable: name(s) of info (required)
|
||||
conditions: evaluated conditions for the trigger
|
||||
regex: one or more regular expressions to replace strings in variables
|
||||
command: command to execute (many commands can be separated by ";")
|
||||
|
@ -70,7 +72,7 @@ When a trigger callback is called, following actions are performed, in this orde
|
|||
1. check conditions; if false, exit
|
||||
2. replace text using POSIX extended regular expression(s) (if defined in trigger)
|
||||
3. execute command(s) (if defined in trigger)
|
||||
4. exit with a return code (except for modifier, line and focus)
|
||||
4. exit with a return code (except for modifier, line, focus, info and info_hashtable)
|
||||
5. perform post action
|
||||
|
||||
Examples (you can also look at default triggers with /trigger listdefault):
|
||||
|
|
|
@ -3587,7 +3587,7 @@ A trigger has the following options (names are
|
|||
any more.
|
||||
|
||||
| hook | `signal`, `hsignal`, `modifier`, `line`, `print`, `command`,
|
||||
`command_run`, `timer`, `config`, `focus`, `info` |
|
||||
`command_run`, `timer`, `config`, `focus`, `info`, `info_hashtable` |
|
||||
The hook used in trigger. For more information, see
|
||||
link:weechat_plugin_api.en.html#hooks[WeeChat plugin API reference / Hooks].
|
||||
|
||||
|
@ -3638,8 +3638,8 @@ order, if triggers are globally enabled and if the trigger itself is enabled:
|
|||
. check trigger conditions: if false, exit
|
||||
. replace text in trigger using regular expression(s)
|
||||
. execute command(s)
|
||||
. exit with a return code (except for hooks _modifier_, _line_, _focus_ and
|
||||
_info_)
|
||||
. exit with a return code (except for hooks _modifier_, _line_, _focus_,
|
||||
_info_ and _info_hashtable_)
|
||||
. perform post action (if different from `none`).
|
||||
|
||||
[[trigger_hook_arguments]]
|
||||
|
@ -3742,6 +3742,13 @@ The arguments depend on the hook used. They are separated by semicolons.
|
|||
3. ... |
|
||||
`+my_info+` |
|
||||
link:weechat_plugin_api.en.html#_hook_info[hook_info]
|
||||
|
||||
| info_hashtable |
|
||||
1. info name (priority allowed) (required) +
|
||||
2. info name (priority allowed) +
|
||||
3. ... |
|
||||
`+my_info+` |
|
||||
link:weechat_plugin_api.en.html#_hook_info_hashtable[hook_info_hashtable]
|
||||
|===
|
||||
|
||||
[[trigger_conditions]]
|
||||
|
@ -3776,18 +3783,19 @@ type:
|
|||
|
||||
[width="100%",cols="2,3,7",options="header"]
|
||||
|===
|
||||
| Hook | Default variable | Update allowed ^(1)^
|
||||
| signal | tg_signal_data |
|
||||
| hsignal | |
|
||||
| modifier | tg_string | tg_string
|
||||
| line | message | buffer, buffer_name, y, date, date_printed, str_time, tags, notify_level, highlight, prefix, message
|
||||
| print | tg_message |
|
||||
| command | tg_argv_eol1 |
|
||||
| command_run | tg_command |
|
||||
| timer | tg_remaining_calls |
|
||||
| config | tg_value |
|
||||
| focus | |
|
||||
| info | tg_info | tg_info
|
||||
| Hook | Default variable | Update allowed ^(1)^
|
||||
| signal | tg_signal_data |
|
||||
| hsignal | |
|
||||
| modifier | tg_string | tg_string
|
||||
| line | message | buffer, buffer_name, y, date, date_printed, str_time, tags, notify_level, highlight, prefix, message
|
||||
| print | tg_message |
|
||||
| command | tg_argv_eol1 |
|
||||
| command_run | tg_command |
|
||||
| timer | tg_remaining_calls |
|
||||
| config | tg_value |
|
||||
| focus | |
|
||||
| info | tg_info | tg_info
|
||||
| info_hashtable | | all variables received in hashtable
|
||||
|===
|
||||
|
||||
[NOTE]
|
||||
|
@ -4097,6 +4105,20 @@ The "info" callback sets following variables in hashtable:
|
|||
| tg_info | string | Empty string (the info to return).
|
||||
|===
|
||||
|
||||
[[trigger_data_info_hashtable]]
|
||||
===== Info_hashtable
|
||||
|
||||
The "info_hashtable" callback sets following variables in hashtable:
|
||||
|
||||
[width="100%",cols="3m,2,14",options="header"]
|
||||
|===
|
||||
| Variable | Type | Description
|
||||
| tg_info_name | string | Name of info.
|
||||
|===
|
||||
|
||||
The hashtable contains all keys/values from hashtable received (type:
|
||||
string/string).
|
||||
|
||||
[[trigger_examples]]
|
||||
==== Examples
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ listdefault : lister les triggers par défaut
|
|||
addoff : ajouter un trigger (désactivé)
|
||||
addreplace : ajouter ou remplacer un trigger existant
|
||||
nom : nom du trigger
|
||||
hook : signal, hsignal, modifier, line, print, command, command_run, timer, config, focus
|
||||
hook : signal, hsignal, modifier, line, print, command, command_run, timer, config, focus, info, info_hashtable
|
||||
paramètres : paramètres pour le hook, dépendant du hook (séparés par des points-virgules) :
|
||||
signal : nom(s) de signal (obligatoire)
|
||||
hsignal : nom(s) de signal (obligatoire)
|
||||
|
@ -39,6 +39,8 @@ listdefault : lister les triggers par défaut
|
|||
timer : intervalle (obligatoire), alignement sur la seconde, nombre max d'appels
|
||||
config : nom(s) de l'option (obligatoire)
|
||||
focus : nom(s) de la zone (obligatoire)
|
||||
info : nom(s) de l'info (obligatoire)
|
||||
info_hashtable : nom(s) de l'info (obligatoire)
|
||||
conditions : conditions évaluées pour le trigger
|
||||
regex : une ou plusieurs expressions régulières pour remplacer des chaînes dans les variables
|
||||
commande : commande à exécuter (plusieurs commandes peuvent être séparées par ";")
|
||||
|
@ -70,7 +72,7 @@ Lorsqu'une fonction de rappel de trigger est appelée, les actions suivantes son
|
|||
1. vérifier les conditions ; si faux, sortir
|
||||
2. remplacer le texte en utilisant une/des expression(s)s régulière(s)s POSIX étendue(s)s (si définie(s) dans le trigger)
|
||||
3. exécuter le(s) commande(s) (si définie(s) dans le trigger)
|
||||
4. sortir avec le code retour (sauf pour les modificateurs, line et focus)
|
||||
4. sortir avec le code retour (sauf pour les modificateurs, line, focus, info et info_hashtable)
|
||||
5. effectuer l'action "post"
|
||||
|
||||
Exemples (vous pouvez aussi regarder les triggers par défaut avec /trigger listdefault) :
|
||||
|
|
|
@ -3701,7 +3701,7 @@ Un trigger a les options suivantes (les noms sont
|
|||
plus exécutées.
|
||||
|
||||
| hook | `signal`, `hsignal`, `modifier`, `line`, `print`, `command`,
|
||||
`command_run`, `timer`, `config`, `focus`, `info` |
|
||||
`command_run`, `timer`, `config`, `focus`, `info`, `info_hashtable` |
|
||||
Le "hook" utilisé dans le trigger. Pour plus d'information, voir la
|
||||
link:weechat_plugin_api.fr.html#hooks[Référence API extension WeeChat / Hooks].
|
||||
|
||||
|
@ -3757,7 +3757,7 @@ le trigger lui-même est activé :
|
|||
. remplacer du texte dans le trigger en utilisant des expressions régulières
|
||||
. exécuter la/les commande(s)
|
||||
. sortir avec un code retour (sauf pour les "hooks" _modifier_, _line_,
|
||||
_focus_ et _info_)
|
||||
_focus_, _info_ et _info_hashtable_)
|
||||
. effectuer l'action "post" (si différente de `none`).
|
||||
|
||||
[[trigger_hook_arguments]]
|
||||
|
@ -3861,6 +3861,13 @@ points-virgules.
|
|||
3. ... |
|
||||
`+mon_info+` |
|
||||
link:weechat_plugin_api.fr.html#_hook_info[hook_info]
|
||||
|
||||
| info_hashtable |
|
||||
1. nom de l'info (priorité autorisée) (obligatoire) +
|
||||
2. nom de l'info (priorité autorisée) +
|
||||
3. ... |
|
||||
`+mon_info+` |
|
||||
link:weechat_plugin_api.fr.html#_hook_info_hashtable[hook_info_hashtable]
|
||||
|===
|
||||
|
||||
[[trigger_conditions]]
|
||||
|
@ -3898,18 +3905,19 @@ du type de hook :
|
|||
|
||||
[width="100%",cols="2,3,7",options="header"]
|
||||
|===
|
||||
| Hook | Variable par défaut | Mise à jour autorisée ^(1)^
|
||||
| signal | tg_signal_data |
|
||||
| hsignal | |
|
||||
| modifier | tg_string | tg_string
|
||||
| line | message | buffer, buffer_name, y, date, date_printed, str_time, tags, notify_level, highlight, prefix, message
|
||||
| print | tg_message |
|
||||
| command | tg_argv_eol1 |
|
||||
| command_run | tg_command |
|
||||
| timer | tg_remaining_calls |
|
||||
| config | tg_value |
|
||||
| focus | |
|
||||
| info | tg_info | tg_info
|
||||
| Hook | Variable par défaut | Mise à jour autorisée ^(1)^
|
||||
| signal | tg_signal_data |
|
||||
| hsignal | |
|
||||
| modifier | tg_string | tg_string
|
||||
| line | message | buffer, buffer_name, y, date, date_printed, str_time, tags, notify_level, highlight, prefix, message
|
||||
| print | tg_message |
|
||||
| command | tg_argv_eol1 |
|
||||
| command_run | tg_command |
|
||||
| timer | tg_remaining_calls |
|
||||
| config | tg_value |
|
||||
| focus | |
|
||||
| info | tg_info | tg_info
|
||||
| info_hashtable | | toutes les variables reçues dans la table de hachage
|
||||
|===
|
||||
|
||||
[NOTE]
|
||||
|
@ -4238,6 +4246,21 @@ hachage :
|
|||
| tg_info | string | Chaîne vide (l'info à renvoyer).
|
||||
|===
|
||||
|
||||
[[trigger_data_info_hashtable]]
|
||||
===== Info_hashtable
|
||||
|
||||
La fonction de rappel "info_hashtable" définit les variables suivantes dans la
|
||||
table de hachage :
|
||||
|
||||
[width="100%",cols="3m,2,14",options="header"]
|
||||
|===
|
||||
| Variable | Type | Description
|
||||
| tg_info_name | string | Nom de l'info.
|
||||
|===
|
||||
|
||||
La table de hachage contient toutes les clés/valeurs de la table de hachage
|
||||
reçue (type : chaîne/chaîne).
|
||||
|
||||
[[trigger_examples]]
|
||||
==== Exemples
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ listdefault: list default triggers
|
|||
addoff: add a trigger (disabled)
|
||||
addreplace: add or replace an existing trigger
|
||||
name: name of trigger
|
||||
hook: signal, hsignal, modifier, line, print, command, command_run, timer, config, focus
|
||||
hook: signal, hsignal, modifier, line, print, command, command_run, timer, config, focus, info, info_hashtable
|
||||
arguments: arguments for the hook, depending on hook (separated by semicolons):
|
||||
signal: name(s) of signal (required)
|
||||
hsignal: name(s) of hsignal (required)
|
||||
|
@ -39,6 +39,8 @@ listdefault: list default triggers
|
|||
timer: interval (required), align on second, max calls
|
||||
config: name(s) of option (required)
|
||||
focus: name(s) of area (required)
|
||||
info: name(s) of info (required)
|
||||
info_hashtable: name(s) of info (required)
|
||||
conditions: evaluated conditions for the trigger
|
||||
regex: one or more regular expressions to replace strings in variables
|
||||
command: command to execute (many commands can be separated by ";")
|
||||
|
@ -70,7 +72,7 @@ When a trigger callback is called, following actions are performed, in this orde
|
|||
1. check conditions; if false, exit
|
||||
2. replace text using POSIX extended regular expression(s) (if defined in trigger)
|
||||
3. execute command(s) (if defined in trigger)
|
||||
4. exit with a return code (except for modifier, line and focus)
|
||||
4. exit with a return code (except for modifier, line, focus, info and info_hashtable)
|
||||
5. perform post action
|
||||
|
||||
Examples (you can also look at default triggers with /trigger listdefault):
|
||||
|
|
|
@ -3851,7 +3851,7 @@ A trigger has the following options (names are
|
|||
any more.
|
||||
|
||||
| hook | `signal`, `hsignal`, `modifier`, `line`, `print`, `command`,
|
||||
`command_run`, `timer`, `config`, `focus`, `info` |
|
||||
`command_run`, `timer`, `config`, `focus`, `info`, `info_hashtable` |
|
||||
The hook used in trigger. For more information, see
|
||||
link:weechat_plugin_api.it.html#hooks[WeeChat plugin API reference / Hooks].
|
||||
|
||||
|
@ -3902,8 +3902,8 @@ order, if triggers are globally enabled and if the trigger itself is enabled:
|
|||
. check trigger conditions: if false, exit
|
||||
. replace text in trigger using regular expression(s)
|
||||
. execute command(s)
|
||||
. exit with a return code (except for hooks _modifier_, _line_, _focus_ and
|
||||
_info_)
|
||||
. exit with a return code (except for hooks _modifier_, _line_, _focus_,
|
||||
_info_ and _info_hashtable_)
|
||||
. perform post action (if different from `none`).
|
||||
|
||||
[[trigger_hook_arguments]]
|
||||
|
@ -4005,7 +4005,14 @@ The arguments depend on the hook used. They are separated by semicolons.
|
|||
2. info name (priority allowed) +
|
||||
3. ... |
|
||||
`+my_info+` |
|
||||
link:weechat_plugin_api.en.html#_hook_info[hook_info]
|
||||
link:weechat_plugin_api.it.html#_hook_info[hook_info]
|
||||
|
||||
| info_hashtable |
|
||||
1. info name (priority allowed) (required) +
|
||||
2. info name (priority allowed) +
|
||||
3. ... |
|
||||
`+my_info+` |
|
||||
link:weechat_plugin_api.it.html#_hook_info_hashtable[hook_info_hashtable]
|
||||
|===
|
||||
|
||||
[[trigger_conditions]]
|
||||
|
@ -4041,18 +4048,19 @@ type:
|
|||
|
||||
[width="100%",cols="2,3,7",options="header"]
|
||||
|===
|
||||
| Hook | Default variable | Update allowed ^(1)^
|
||||
| signal | tg_signal_data |
|
||||
| hsignal | |
|
||||
| modifier | tg_string | tg_string
|
||||
| line | message | buffer, buffer_name, y, date, date_printed, str_time, tags, notify_level, highlight, prefix, message
|
||||
| print | tg_message |
|
||||
| command | tg_argv_eol1 |
|
||||
| command_run | tg_command |
|
||||
| timer | tg_remaining_calls |
|
||||
| config | tg_value |
|
||||
| focus | |
|
||||
| info | tg_info | tg_info
|
||||
| Hook | Default variable | Update allowed ^(1)^
|
||||
| signal | tg_signal_data |
|
||||
| hsignal | |
|
||||
| modifier | tg_string | tg_string
|
||||
| line | message | buffer, buffer_name, y, date, date_printed, str_time, tags, notify_level, highlight, prefix, message
|
||||
| print | tg_message |
|
||||
| command | tg_argv_eol1 |
|
||||
| command_run | tg_command |
|
||||
| timer | tg_remaining_calls |
|
||||
| config | tg_value |
|
||||
| focus | |
|
||||
| info | tg_info | tg_info
|
||||
| info_hashtable | | all variables received in hashtable
|
||||
|===
|
||||
|
||||
[NOTE]
|
||||
|
@ -4362,6 +4370,20 @@ The "info" callback sets following variables in hashtable:
|
|||
| tg_info | string | Empty string (the info to return).
|
||||
|===
|
||||
|
||||
[[trigger_data_info_hashtable]]
|
||||
===== Info_hashtable
|
||||
|
||||
The "info_hashtable" callback sets following variables in hashtable:
|
||||
|
||||
[width="100%",cols="3m,2,14",options="header"]
|
||||
|===
|
||||
| Variable | Type | Description
|
||||
| tg_info_name | string | Name of info.
|
||||
|===
|
||||
|
||||
The hashtable contains all keys/values from hashtable received (type:
|
||||
string/string).
|
||||
|
||||
[[trigger_examples]]
|
||||
==== Examples
|
||||
|
||||
|
|
|
@ -20,67 +20,69 @@
|
|||
default -yes
|
||||
monitor [<filter>]
|
||||
|
||||
list: トリガをリストアップ (引数なしの場合、このリストを表示します)
|
||||
listfull: 各トリガに関する詳細な情報を付けてトリガをリストアップ
|
||||
listdefault: デフォルトトリガをリストアップ
|
||||
add: トリガを追加
|
||||
addoff: トリガを追加 (無効状態で)
|
||||
addreplace: 追加または存在するトリガを置換
|
||||
name: トリガの名前
|
||||
hook: signal、hsignal、modifier、line、print、command、command_run、timer、config、focus
|
||||
arguments: フックの引数、フックの種類に依存 (セミコロンで区切る):
|
||||
signal: シグナルの名前 (必須)
|
||||
hsignal: hsignal の名前 (必須)
|
||||
modifier: modifier の名前 (必須)
|
||||
line: バッファ型 ("formatted"、"free"、"*")、バッファマスクおよびタグのリスト
|
||||
print: バッファ、タグ、メッセージ、色の削除
|
||||
command: コマンド (必須)、説明、引数、引数の説明、補完
|
||||
command_run: コマンド (必須)
|
||||
timer: インターバル (必須)、秒の調節、最大呼び出し回数
|
||||
config: オプションの名前 (必須)
|
||||
focus: エリアの名前 (必須)
|
||||
conditions: トリガの実行条件
|
||||
regex: 変数内の文字列を置換する 1 つ以上の正規表現
|
||||
command: 実行するコマンド (複数のコマンドは ";" で区切ってください)
|
||||
return_code: コールバック内のリターンコード (ok (デフォルト)、ok_eat、error)
|
||||
post_action: トリガ実行後の処遇 (none (デフォルト、何もしない)、disable (無効化)、delete (削除))
|
||||
addinput: 入力にトリガを作る際のデフォルト引数を設定
|
||||
input: 入力にトリガを作る際に使われるコマンドを設定
|
||||
output: バッファでトリガを作る際のコマンドを送信
|
||||
recreate: "add" の代わりに "addreplace" オプションを使うことを除いて "input" と同じ
|
||||
set: トリガにオプションを設定
|
||||
option: オプションの名前: name、hook、arguments、conditions、regex、command、return_code
|
||||
(オプションに関するヘルプを見るには: /help trigger.trigger.<name>.<option>)
|
||||
value: オプションの新しい値
|
||||
rename: トリガの名前を変更
|
||||
copy: トリガをコピー
|
||||
enable: トリガを有効化 (引数なしの場合: 大域的にトリガを有効化)
|
||||
disable: トリガを無効化 (引数なしの場合: 大域的にトリガを無効化)
|
||||
toggle: トリガの有効無効を切り替え (引数なしの場合: 大域的にトリガの有効無効を切り替え)
|
||||
restart: トリガの再開 (フックを再作成)
|
||||
show: トリガに関する情報を表示 (状態を含めて)
|
||||
del: トリガを削除
|
||||
-all: 全てのトリガに関するアクションを実行
|
||||
restore: デフォルトの値でトリガを復元 (これができるのはデフォルトトリガに限ります)
|
||||
default: 全てのトリガを削除してデフォルトのトリガを復元
|
||||
monitor: 任意でフィルタを付けてトリガ監視バッファを開く:
|
||||
filter: フックおよびトリガをフィルタして表示 (フックは必ず "@" で始めてください、たとえば "@signal")、複数のフィルタをかける場合はそれぞれをコンマで区切ってください; 各トリガ名にワイルドカード "*" を使うことができます。
|
||||
list: list triggers (without argument, this list is displayed)
|
||||
listfull: list triggers with detailed info for each trigger
|
||||
listdefault: list default triggers
|
||||
add: add a trigger
|
||||
addoff: add a trigger (disabled)
|
||||
addreplace: add or replace an existing trigger
|
||||
name: name of trigger
|
||||
hook: signal, hsignal, modifier, line, print, command, command_run, timer, config, focus, info, info_hashtable
|
||||
arguments: arguments for the hook, depending on hook (separated by semicolons):
|
||||
signal: name(s) of signal (required)
|
||||
hsignal: name(s) of hsignal (required)
|
||||
modifier: name(s) of modifier (required)
|
||||
line: buffer type ("formatted", "free" or "*"), list of buffer masks, tags
|
||||
print: buffer, tags, message, strip colors
|
||||
command: command (required), description, arguments, description of arguments, completion
|
||||
command_run: command(s) (required)
|
||||
timer: interval (required), align on second, max calls
|
||||
config: name(s) of option (required)
|
||||
focus: name(s) of area (required)
|
||||
info: name(s) of info (required)
|
||||
info_hashtable: name(s) of info (required)
|
||||
conditions: evaluated conditions for the trigger
|
||||
regex: one or more regular expressions to replace strings in variables
|
||||
command: command to execute (many commands can be separated by ";")
|
||||
return_code: return code in callback (ok (default), ok_eat, error)
|
||||
post_action: action to take after execution (none (default), disable, delete)
|
||||
addinput: set input with default arguments to create a trigger
|
||||
input: set input with the command used to create the trigger
|
||||
output: send the command to create the trigger on the buffer
|
||||
recreate: same as "input", with option "addreplace" instead of "add"
|
||||
set: set an option in a trigger
|
||||
option: name of option: name, hook, arguments, conditions, regex, command, return_code
|
||||
(for help on option, you can type: /help trigger.trigger.<name>.<option>)
|
||||
value: new value for the option
|
||||
rename: rename a trigger
|
||||
copy: copy a trigger
|
||||
enable: enable trigger(s) (without arguments: enable triggers globally)
|
||||
disable: disable trigger(s) (without arguments: disable triggers globally)
|
||||
toggle: toggle trigger(s) (without arguments: toggle triggers globally)
|
||||
restart: restart trigger(s) (recreate the hooks)
|
||||
show: show detailed info on a trigger (with some stats)
|
||||
del: delete a trigger
|
||||
-all: do action on all triggers
|
||||
restore: restore trigger(s) with the default values (works only for default triggers)
|
||||
default: delete all triggers and restore default ones
|
||||
monitor: open the trigger monitor buffer, with optional filter:
|
||||
filter: filter hooks/triggers to display (a hook must start with "@", for example "@signal"), many filters can be separated by commas; wildcard "*" is allowed in each trigger name
|
||||
|
||||
トリガコールバックを呼び出す際には、以下の順番通りにアクションを実行します:
|
||||
1. 条件を確認; 偽の場合、終了
|
||||
2. POSIX 拡張正規表現を使ってテキストを置換 (トリガに定義されている場合)
|
||||
3. コマンドを実行 (トリガに定義されている場合)
|
||||
4. リターンコードを返して終了 (modifier、line、focus を除く)
|
||||
5. トリガ実行後の処遇を適用
|
||||
When a trigger callback is called, following actions are performed, in this order:
|
||||
1. check conditions; if false, exit
|
||||
2. replace text using POSIX extended regular expression(s) (if defined in trigger)
|
||||
3. execute command(s) (if defined in trigger)
|
||||
4. exit with a return code (except for modifier, line, focus, info and info_hashtable)
|
||||
5. perform post action
|
||||
|
||||
例 (/trigger listdefault でデフォルトトリガを見ることができます):
|
||||
テキスト属性 *太字*、_下線_、/イタリック/ を追加 (ユーザメッセージのみ):
|
||||
Examples (you can also look at default triggers with /trigger listdefault):
|
||||
add text attributes *bold*, _underline_ and /italic/ (only in user messages):
|
||||
/trigger add effects modifier weechat_print "${tg_tag_nick}" "==\*([^ ]+)\*==*${color:bold}${re:1}${color:-bold}*== ==_([^ ]+)_==_${color:underline}${re:1}${color:-underline}_== ==/([^ ]+)/==/${color:italic}${re:1}${color:-italic}/"
|
||||
狭い端末ではニックネームリストバーを隠す:
|
||||
hide nicklist bar on small terminals:
|
||||
/trigger add resize_small signal signal_sigwinch "${info:term_width} < 100" "" "/bar hide nicklist"
|
||||
/trigger add resize_big signal signal_sigwinch "${info:term_width} >= 100" "" "/bar show nicklist"
|
||||
設定を 1 時間毎に黙々と保存:
|
||||
silently save config each hour:
|
||||
/trigger add cfgsave timer 3600000;0;0 "" "" "/mute /save"
|
||||
トリガモニタを開き、修飾子と名前が "resize" から始まるトリガだけを表示:
|
||||
open trigger monitor and show only modifiers and triggers whose name starts with "resize":
|
||||
/trigger monitor @modifier,resize*
|
||||
----
|
||||
|
|
|
@ -3585,7 +3585,7 @@ WeeChat はデフォルトで 5
|
|||
の場合、トリガは無効化され、アクションは実行されません。
|
||||
|
||||
| hook | `signal`、`hsignal`、`modifier`、`line`, `print`、`command`、
|
||||
`command_run`、`timer`、`config`、`focus`、`info` |
|
||||
`command_run`、`timer`、`config`、`focus`、`info`、`info_hashtable` |
|
||||
トリガの中で使われるフック。より詳しい情報は
|
||||
link:weechat_plugin_api.ja.html#hooks[WeeChat プラグイン API リファレンス / フック]を参照してください。
|
||||
|
||||
|
@ -3636,8 +3636,8 @@ trigger.trigger.beep.post_action = none
|
|||
. 正規表現を使ってトリガ内でテキスト置換
|
||||
. コマンドを実行
|
||||
// TRANSLATION MISSING
|
||||
. exit with a return code (except for hooks _modifier_, _line_, _focus_ and
|
||||
_info_)
|
||||
. exit with a return code (except for hooks _modifier_, _line_, _focus_,
|
||||
_info_ and _info_hashtable_)
|
||||
. トリガ実行後の処遇を適用 (`none` 以外の場合)。
|
||||
|
||||
[[trigger_hook_arguments]]
|
||||
|
@ -3741,6 +3741,14 @@ trigger.trigger.beep.post_action = none
|
|||
3. ... |
|
||||
`+my_info+` |
|
||||
link:weechat_plugin_api.ja.html#_hook_info[hook_info]
|
||||
|
||||
// TRANSLATION MISSING
|
||||
| info_hashtable |
|
||||
1. info name (優先度の指定も可) (必須) +
|
||||
2. info name (優先度の指定も可) +
|
||||
3. ... |
|
||||
`+my_info+` |
|
||||
link:weechat_plugin_api.ja.html#_hook_info_hashtable[hook_info_hashtable]
|
||||
|===
|
||||
|
||||
[[trigger_conditions]]
|
||||
|
@ -3775,18 +3783,20 @@ _var_
|
|||
|
||||
[width="100%",cols="2,3,7",options="header"]
|
||||
|===
|
||||
| フック | デフォルト変数 | 更新が許可Update allowed ^(1)^
|
||||
| signal | tg_signal_data |
|
||||
| hsignal | |
|
||||
| modifier | tg_string | tg_string
|
||||
| line | message | buffer、buffer_name、y、date、date_printed、str_time、tags、notify_level、highlight、prefix、message
|
||||
| print | tg_message |
|
||||
| command | tg_argv_eol1 |
|
||||
| command_run | tg_command |
|
||||
| timer | tg_remaining_calls |
|
||||
| config | tg_value |
|
||||
| focus | |
|
||||
| info | tg_info | tg_info
|
||||
| フック | デフォルト変数 | 更新が許可Update allowed ^(1)^
|
||||
| signal | tg_signal_data |
|
||||
| hsignal | |
|
||||
| modifier | tg_string | tg_string
|
||||
| line | message | buffer、buffer_name、y、date、date_printed、str_time、tags、notify_level、highlight、prefix、message
|
||||
| print | tg_message |
|
||||
| command | tg_argv_eol1 |
|
||||
| command_run | tg_command |
|
||||
| timer | tg_remaining_calls |
|
||||
| config | tg_value |
|
||||
| focus | |
|
||||
| info | tg_info | tg_info
|
||||
// TRANSLATION MISSING
|
||||
| info_hashtable | | all variables received in hashtable
|
||||
|===
|
||||
|
||||
[NOTE]
|
||||
|
@ -4095,6 +4105,21 @@ string/string) が含まれています。
|
|||
| tg_info | string | Empty string (the info to return).
|
||||
|===
|
||||
|
||||
// TRANSLATION MISSING
|
||||
[[trigger_data_info_hashtable]]
|
||||
===== Info_hashtable
|
||||
|
||||
"info_hashtable" コールバックは以下の変数をハッシュテーブルに格納します:
|
||||
|
||||
[width="100%",cols="3m,2,14",options="header"]
|
||||
|===
|
||||
| 変数 | 型 | 説明
|
||||
| tg_info_name | string | Name of info.
|
||||
|===
|
||||
|
||||
ハッシュテーブルには受け取ったハッシュテーブルに含まれる全てのキーおよび値 (型:
|
||||
string/string) が含まれています。
|
||||
|
||||
[[trigger_examples]]
|
||||
==== 例
|
||||
|
||||
|
|
|
@ -20,67 +20,69 @@
|
|||
default -yes
|
||||
monitor [<filtr>]
|
||||
|
||||
list: lista triggerów (jeśli nie podano argumentu, wyświetli się ta lista)
|
||||
listfull: lista triggerów ze szczegółowymi informacjami
|
||||
listdefault: lista domyślnych triggerów
|
||||
add: dodaje trigger
|
||||
addoff: dodaje trigger (wyłączony)
|
||||
addreplace: dodaje lub zastępuje istniejący trigger
|
||||
nazwa: nazwa triggera
|
||||
hook: signal, hsignal, modifier, line, print, command, command_run, timer, config, focus
|
||||
argumenty: argumenty dla uchwytu, w zależności od jego typu (oddzielone średnikami):
|
||||
signal: nazwa(-y) signal (wymagane)
|
||||
hsignal: nazwa(-y) hsignal (wymagane)
|
||||
modifier: nazwa(-y) modifier (wymagane)
|
||||
line: typ bufora("formatted", "free" lub "*"), lista mask buforów, tagów
|
||||
print: bufor, tagi, wiadomość, pomiń kolory
|
||||
command: komenda (wymagane), opis, argumenty, opis argumentów, dopełnienie
|
||||
command_run: komenda(-y) (wymagane)
|
||||
timer: interwał (wymagane), wyrównanie sekund, ilość wywołań
|
||||
config: nazwa(-y) opcji (wymagane)
|
||||
focus: nazwa(-y) obszarów (wymagane)
|
||||
warunki: przetwarzane warunki dla triggera
|
||||
regex: jedno lub więcej wyrażeń regularnych do zastępowania ciągów w zmiennych
|
||||
komenda: komenda do wykonania (wiele komend można oddzielić ";")
|
||||
zwracany_kod: kod zwracany w callbacku (ok (domyślne), ok_eat, error)
|
||||
post_action: akcja do wykonania po zakończeniu (none (domyślne), disable, delete)
|
||||
addinput: ustawia wejście z domyślnymi argumentami do stworzenia triggera
|
||||
input: ustawia wejście z komendą użytą do stworzenia triggera
|
||||
output: wysyła komendę do stworzenia triggera do buforu
|
||||
recreate: tak samo jak "input", z opcją "addreplace" zamiast "add"
|
||||
set: ustawia opcje triggera
|
||||
opcja: nazwa opcji: name, hook, arguments, conditions, regex, command, return_code
|
||||
(aby uzyskać pomoc na temat opcji możesz wpisać: /help trigger.trigger.<nazwa>.<opcja>)
|
||||
wartość: nowa wartość dla opcji
|
||||
rename: zmienia nazwę triggera
|
||||
copy: kopiuje trigger
|
||||
enable: włącza trigger(y) (bez argumentów: włącza triggery globalnie)
|
||||
disable: wyłącza trigger(y) (bez argumentów: wyłącza triggery globalnie)
|
||||
toggle: zmienia stan triggera(-ów) (bez argumentów: zmienia stan triggerów globalnie)
|
||||
restart: restartuje trigger(y) (tworzy na nowo uchwyty)
|
||||
show: pokazuje szczegółowe informacje o triggerze (z niektórymi statystykami)
|
||||
del: usuwa trigger
|
||||
-all: wykonaj akcję na wszystkich triggerach
|
||||
restore: przywraca trigger(y) z domyślnymi wartościami (działa tylko dla domyślnych triggerów)
|
||||
default: przywraca domyślne triggery
|
||||
monitor: otwiera bufor monitorowania triggerów, z opcjonalnym filtrem:
|
||||
filtr: filtruje uchwyty/triggery do wyświetlenia (uchwyt musi się zaczynać od "@", na przykład "@signal"), wiele filtrów może być oddzielonych przecinkiem; dzika karta "*" jest dozwolona w nazwie każdego triggera
|
||||
list: list triggers (without argument, this list is displayed)
|
||||
listfull: list triggers with detailed info for each trigger
|
||||
listdefault: list default triggers
|
||||
add: add a trigger
|
||||
addoff: add a trigger (disabled)
|
||||
addreplace: add or replace an existing trigger
|
||||
name: name of trigger
|
||||
hook: signal, hsignal, modifier, line, print, command, command_run, timer, config, focus, info, info_hashtable
|
||||
arguments: arguments for the hook, depending on hook (separated by semicolons):
|
||||
signal: name(s) of signal (required)
|
||||
hsignal: name(s) of hsignal (required)
|
||||
modifier: name(s) of modifier (required)
|
||||
line: buffer type ("formatted", "free" or "*"), list of buffer masks, tags
|
||||
print: buffer, tags, message, strip colors
|
||||
command: command (required), description, arguments, description of arguments, completion
|
||||
command_run: command(s) (required)
|
||||
timer: interval (required), align on second, max calls
|
||||
config: name(s) of option (required)
|
||||
focus: name(s) of area (required)
|
||||
info: name(s) of info (required)
|
||||
info_hashtable: name(s) of info (required)
|
||||
conditions: evaluated conditions for the trigger
|
||||
regex: one or more regular expressions to replace strings in variables
|
||||
command: command to execute (many commands can be separated by ";")
|
||||
return_code: return code in callback (ok (default), ok_eat, error)
|
||||
post_action: action to take after execution (none (default), disable, delete)
|
||||
addinput: set input with default arguments to create a trigger
|
||||
input: set input with the command used to create the trigger
|
||||
output: send the command to create the trigger on the buffer
|
||||
recreate: same as "input", with option "addreplace" instead of "add"
|
||||
set: set an option in a trigger
|
||||
option: name of option: name, hook, arguments, conditions, regex, command, return_code
|
||||
(for help on option, you can type: /help trigger.trigger.<name>.<option>)
|
||||
value: new value for the option
|
||||
rename: rename a trigger
|
||||
copy: copy a trigger
|
||||
enable: enable trigger(s) (without arguments: enable triggers globally)
|
||||
disable: disable trigger(s) (without arguments: disable triggers globally)
|
||||
toggle: toggle trigger(s) (without arguments: toggle triggers globally)
|
||||
restart: restart trigger(s) (recreate the hooks)
|
||||
show: show detailed info on a trigger (with some stats)
|
||||
del: delete a trigger
|
||||
-all: do action on all triggers
|
||||
restore: restore trigger(s) with the default values (works only for default triggers)
|
||||
default: delete all triggers and restore default ones
|
||||
monitor: open the trigger monitor buffer, with optional filter:
|
||||
filter: filter hooks/triggers to display (a hook must start with "@", for example "@signal"), many filters can be separated by commas; wildcard "*" is allowed in each trigger name
|
||||
|
||||
Kiedy callback triggera jest wywoływany, wykonywane są następujące akcje, w kolejności:
|
||||
1. sprawdzenie warunków; jeśli nie są spełnione, wyjście
|
||||
2. zastąpienie tekstu za pomocą rozszerzonych wyrażeń regularnych POSIX (jeśli zdefiniowane)
|
||||
3. wykonanie komend(y) (jeśli zdefiniowane)
|
||||
4. wyjście z kodem wyjścia (poza modifiers i focus)
|
||||
5. wykonanie akcji kończącej
|
||||
When a trigger callback is called, following actions are performed, in this order:
|
||||
1. check conditions; if false, exit
|
||||
2. replace text using POSIX extended regular expression(s) (if defined in trigger)
|
||||
3. execute command(s) (if defined in trigger)
|
||||
4. exit with a return code (except for modifier, line, focus, info and info_hashtable)
|
||||
5. perform post action
|
||||
|
||||
Przykłady (możesz też spojrzeć na domyślne triggery za pomocą /trigger listdefault):
|
||||
dodaje atrybuty tekstu *bold*, _underline_ i /italic/ (tylko w wiadomościach użytkowników):
|
||||
Examples (you can also look at default triggers with /trigger listdefault):
|
||||
add text attributes *bold*, _underline_ and /italic/ (only in user messages):
|
||||
/trigger add effects modifier weechat_print "${tg_tag_nick}" "==\*([^ ]+)\*==*${color:bold}${re:1}${color:-bold}*== ==_([^ ]+)_==_${color:underline}${re:1}${color:-underline}_== ==/([^ ]+)/==/${color:italic}${re:1}${color:-italic}/"
|
||||
ukrywa pasek z nickami na małych terminalach:
|
||||
hide nicklist bar on small terminals:
|
||||
/trigger add resize_small signal signal_sigwinch "${info:term_width} < 100" "" "/bar hide nicklist"
|
||||
/trigger add resize_big signal signal_sigwinch "${info:term_width} >= 100" "" "/bar show nicklist"
|
||||
cichy zapis plików konfiguracyjnych co każdą godzinę:
|
||||
silently save config each hour:
|
||||
/trigger add cfgsave timer 3600000;0;0 "" "" "/mute /save"
|
||||
otwiera monitor triggerów i pokazuje tylko modifiers i triggery, których nazwa zaczyna się od "resize":
|
||||
open trigger monitor and show only modifiers and triggers whose name starts with "resize":
|
||||
/trigger monitor @modifier,resize*
|
||||
----
|
||||
|
|
|
@ -3621,7 +3621,7 @@ Trigger posiada następujące opcje (nazwy to `trigger.trigger.<nazwa>.<opcja>`)
|
|||
więcej wykonywane.
|
||||
|
||||
| hook | `signal`, `hsignal`, `modifier`, `line`, `print`, `command`,
|
||||
`command_run`, `timer`, `config`, `focus`, `info` |
|
||||
`command_run`, `timer`, `config`, `focus`, `info`, `info_hashtable` |
|
||||
Zdarzenia używane przez trigger. Więcej informacji można znaleźć w
|
||||
link:weechat_plugin_api.en.html#hooks[WeeChat Plugin API Reference / Hooks] (Angielski).
|
||||
|
||||
|
@ -3673,8 +3673,8 @@ kolejności, jeśli triggery są globalnie włączone i jeśli sam trigger jest
|
|||
. zastępowanie tekstu w triggerze za pomocą wyrażenia
|
||||
. wykonanie komend(-y)
|
||||
// TRANSLATION MISSING
|
||||
. exit with a return code (except for hooks _modifier_, _line_, _focus_ and
|
||||
_info_)
|
||||
. exit with a return code (except for hooks _modifier_, _line_, _focus_,
|
||||
_info_ and _info_hashtable_)
|
||||
. wykonanie akcji kończącej (jeśli inna niż `none`).
|
||||
|
||||
[[trigger_hook_arguments]]
|
||||
|
@ -3778,6 +3778,14 @@ Argumenty zależą od rodzaju uchwytu. Są oddzielane średnikami.
|
|||
3. ... |
|
||||
`+my_info+` |
|
||||
link:weechat_plugin_api.en.html#_hook_info[hook_info] (Angielski)
|
||||
|
||||
// TRANSLATION MISSING
|
||||
| info_hashtable |
|
||||
1. info name (dozwolony priorytet) (wymagane) +
|
||||
2. info name (dozwolony priorytet) +
|
||||
3. ... |
|
||||
`+my_info+` |
|
||||
link:weechat_plugin_api.en.html#_hook_info_hashtable[hook_info_hashtable] (Angielski)
|
||||
|===
|
||||
|
||||
[[trigger_conditions]]
|
||||
|
@ -3813,18 +3821,20 @@ od typu uchwytu:
|
|||
|
||||
[width="100%",cols="2,3,7",options="header"]
|
||||
|===
|
||||
| Uchwyt | Domyślna zmienna | Dozwolona aktualizacja ^(1)^
|
||||
| signal | tg_signal_data |
|
||||
| hsignal | |
|
||||
| modifier | tg_string | tg_string
|
||||
| line | message | buffer, buffer_name, y, date, date_printed, str_time, tags, notify_level, highlight, prefix, message
|
||||
| print | tg_message |
|
||||
| command | tg_argv_eol1 |
|
||||
| command_run | tg_command |
|
||||
| timer | tg_remaining_calls |
|
||||
| config | tg_value |
|
||||
| focus | |
|
||||
| info | tg_info | tg_info
|
||||
| Uchwyt | Domyślna zmienna | Dozwolona aktualizacja ^(1)^
|
||||
| signal | tg_signal_data |
|
||||
| hsignal | |
|
||||
| modifier | tg_string | tg_string
|
||||
| line | message | buffer, buffer_name, y, date, date_printed, str_time, tags, notify_level, highlight, prefix, message
|
||||
| print | tg_message |
|
||||
| command | tg_argv_eol1 |
|
||||
| command_run | tg_command |
|
||||
| timer | tg_remaining_calls |
|
||||
| config | tg_value |
|
||||
| focus | |
|
||||
| info | tg_info | tg_info
|
||||
// TRANSLATION MISSING
|
||||
| info_hashtable | | all variables received in hashtable
|
||||
|===
|
||||
|
||||
[NOTE]
|
||||
|
@ -4133,6 +4143,21 @@ Callback "info" ustawia następujące zmienne w tablicy hashy:
|
|||
| tg_info | string | Empty string (the info to return).
|
||||
|===
|
||||
|
||||
// TRANSLATION MISSING
|
||||
[[trigger_data_info_hashtable]]
|
||||
===== Info_hashtable
|
||||
|
||||
Callback "info_hashtable" ustawia następujące zmienne w tablicy hashy:
|
||||
|
||||
[width="100%",cols="3m,2,14",options="header"]
|
||||
|===
|
||||
| Zmienna | Typ | Opis
|
||||
| tg_info_name | string | Name of info.
|
||||
|===
|
||||
|
||||
Tablica zawiera wszystkie klucze/wartości z otrzymanej tablicy hashy (typ:
|
||||
ciąg/ciąg).
|
||||
|
||||
[[trigger_examples]]
|
||||
==== Przykłady
|
||||
|
||||
|
|
8
po/cs.po
8
po/cs.po
|
@ -21,7 +21,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: WeeChat\n"
|
||||
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
|
||||
"POT-Creation-Date: 2019-04-13 08:46+0200\n"
|
||||
"POT-Creation-Date: 2019-04-13 13:45+0200\n"
|
||||
"PO-Revision-Date: 2019-03-17 18:32+0100\n"
|
||||
"Last-Translator: Ondřej Súkup <mimi.vx@gmail.com>\n"
|
||||
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
|
||||
|
@ -12060,7 +12060,7 @@ msgid ""
|
|||
" addreplace: add or replace an existing trigger\n"
|
||||
" name: name of trigger\n"
|
||||
" hook: signal, hsignal, modifier, line, print, command, command_run, "
|
||||
"timer, config, focus, info\n"
|
||||
"timer, config, focus, info, info_hashtable\n"
|
||||
" arguments: arguments for the hook, depending on hook (separated by "
|
||||
"semicolons):\n"
|
||||
" signal: name(s) of signal (required)\n"
|
||||
|
@ -12076,6 +12076,7 @@ msgid ""
|
|||
" config: name(s) of option (required)\n"
|
||||
" focus: name(s) of area (required)\n"
|
||||
" info: name(s) of info (required)\n"
|
||||
" info_hashtable: name(s) of info (required)\n"
|
||||
" conditions: evaluated conditions for the trigger\n"
|
||||
" regex: one or more regular expressions to replace strings in "
|
||||
"variables\n"
|
||||
|
@ -12120,7 +12121,8 @@ msgid ""
|
|||
" 2. replace text using POSIX extended regular expression(s) (if defined in "
|
||||
"trigger)\n"
|
||||
" 3. execute command(s) (if defined in trigger)\n"
|
||||
" 4. exit with a return code (except for modifier, line, focus and info)\n"
|
||||
" 4. exit with a return code (except for modifier, line, focus, info and "
|
||||
"info_hashtable)\n"
|
||||
" 5. perform post action\n"
|
||||
"\n"
|
||||
"Examples (you can also look at default triggers with /trigger listdefault):\n"
|
||||
|
|
8
po/de.po
8
po/de.po
|
@ -24,7 +24,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: WeeChat\n"
|
||||
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
|
||||
"POT-Creation-Date: 2019-04-13 08:46+0200\n"
|
||||
"POT-Creation-Date: 2019-04-13 13:45+0200\n"
|
||||
"PO-Revision-Date: 2019-04-06 22:14+0200\n"
|
||||
"Last-Translator: Nils Görs <weechatter@arcor.de>\n"
|
||||
"Language-Team: German <kde-i18n-de@kde.org>\n"
|
||||
|
@ -14074,7 +14074,7 @@ msgid ""
|
|||
" addreplace: add or replace an existing trigger\n"
|
||||
" name: name of trigger\n"
|
||||
" hook: signal, hsignal, modifier, line, print, command, command_run, "
|
||||
"timer, config, focus, info\n"
|
||||
"timer, config, focus, info, info_hashtable\n"
|
||||
" arguments: arguments for the hook, depending on hook (separated by "
|
||||
"semicolons):\n"
|
||||
" signal: name(s) of signal (required)\n"
|
||||
|
@ -14090,6 +14090,7 @@ msgid ""
|
|||
" config: name(s) of option (required)\n"
|
||||
" focus: name(s) of area (required)\n"
|
||||
" info: name(s) of info (required)\n"
|
||||
" info_hashtable: name(s) of info (required)\n"
|
||||
" conditions: evaluated conditions for the trigger\n"
|
||||
" regex: one or more regular expressions to replace strings in "
|
||||
"variables\n"
|
||||
|
@ -14134,7 +14135,8 @@ msgid ""
|
|||
" 2. replace text using POSIX extended regular expression(s) (if defined in "
|
||||
"trigger)\n"
|
||||
" 3. execute command(s) (if defined in trigger)\n"
|
||||
" 4. exit with a return code (except for modifier, line, focus and info)\n"
|
||||
" 4. exit with a return code (except for modifier, line, focus, info and "
|
||||
"info_hashtable)\n"
|
||||
" 5. perform post action\n"
|
||||
"\n"
|
||||
"Examples (you can also look at default triggers with /trigger listdefault):\n"
|
||||
|
|
8
po/es.po
8
po/es.po
|
@ -22,7 +22,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: WeeChat\n"
|
||||
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
|
||||
"POT-Creation-Date: 2019-04-13 08:46+0200\n"
|
||||
"POT-Creation-Date: 2019-04-13 13:45+0200\n"
|
||||
"PO-Revision-Date: 2019-03-17 16:04+0100\n"
|
||||
"Last-Translator: Elián Hanisch <lambdae2@gmail.com>\n"
|
||||
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
|
||||
|
@ -12342,7 +12342,7 @@ msgid ""
|
|||
" addreplace: add or replace an existing trigger\n"
|
||||
" name: name of trigger\n"
|
||||
" hook: signal, hsignal, modifier, line, print, command, command_run, "
|
||||
"timer, config, focus, info\n"
|
||||
"timer, config, focus, info, info_hashtable\n"
|
||||
" arguments: arguments for the hook, depending on hook (separated by "
|
||||
"semicolons):\n"
|
||||
" signal: name(s) of signal (required)\n"
|
||||
|
@ -12358,6 +12358,7 @@ msgid ""
|
|||
" config: name(s) of option (required)\n"
|
||||
" focus: name(s) of area (required)\n"
|
||||
" info: name(s) of info (required)\n"
|
||||
" info_hashtable: name(s) of info (required)\n"
|
||||
" conditions: evaluated conditions for the trigger\n"
|
||||
" regex: one or more regular expressions to replace strings in "
|
||||
"variables\n"
|
||||
|
@ -12402,7 +12403,8 @@ msgid ""
|
|||
" 2. replace text using POSIX extended regular expression(s) (if defined in "
|
||||
"trigger)\n"
|
||||
" 3. execute command(s) (if defined in trigger)\n"
|
||||
" 4. exit with a return code (except for modifier, line, focus and info)\n"
|
||||
" 4. exit with a return code (except for modifier, line, focus, info and "
|
||||
"info_hashtable)\n"
|
||||
" 5. perform post action\n"
|
||||
"\n"
|
||||
"Examples (you can also look at default triggers with /trigger listdefault):\n"
|
||||
|
|
17
po/fr.po
17
po/fr.po
|
@ -21,8 +21,8 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: WeeChat\n"
|
||||
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
|
||||
"POT-Creation-Date: 2019-04-13 08:46+0200\n"
|
||||
"PO-Revision-Date: 2019-04-13 08:47+0200\n"
|
||||
"POT-Creation-Date: 2019-04-13 13:45+0200\n"
|
||||
"PO-Revision-Date: 2019-04-13 13:50+0200\n"
|
||||
"Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n"
|
||||
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
|
||||
"Language: fr\n"
|
||||
|
@ -13770,7 +13770,7 @@ msgid ""
|
|||
" addreplace: add or replace an existing trigger\n"
|
||||
" name: name of trigger\n"
|
||||
" hook: signal, hsignal, modifier, line, print, command, command_run, "
|
||||
"timer, config, focus, info\n"
|
||||
"timer, config, focus, info, info_hashtable\n"
|
||||
" arguments: arguments for the hook, depending on hook (separated by "
|
||||
"semicolons):\n"
|
||||
" signal: name(s) of signal (required)\n"
|
||||
|
@ -13786,6 +13786,7 @@ msgid ""
|
|||
" config: name(s) of option (required)\n"
|
||||
" focus: name(s) of area (required)\n"
|
||||
" info: name(s) of info (required)\n"
|
||||
" info_hashtable: name(s) of info (required)\n"
|
||||
" conditions: evaluated conditions for the trigger\n"
|
||||
" regex: one or more regular expressions to replace strings in "
|
||||
"variables\n"
|
||||
|
@ -13830,7 +13831,8 @@ msgid ""
|
|||
" 2. replace text using POSIX extended regular expression(s) (if defined in "
|
||||
"trigger)\n"
|
||||
" 3. execute command(s) (if defined in trigger)\n"
|
||||
" 4. exit with a return code (except for modifier, line, focus and info)\n"
|
||||
" 4. exit with a return code (except for modifier, line, focus, info and "
|
||||
"info_hashtable)\n"
|
||||
" 5. perform post action\n"
|
||||
"\n"
|
||||
"Examples (you can also look at default triggers with /trigger listdefault):\n"
|
||||
|
@ -13861,7 +13863,7 @@ msgstr ""
|
|||
" addreplace : ajouter ou remplacer un trigger existant\n"
|
||||
" nom : nom du trigger\n"
|
||||
" hook : signal, hsignal, modifier, line, print, command, command_run, "
|
||||
"timer, config, focus, info\n"
|
||||
"timer, config, focus, info, info_hashtable\n"
|
||||
" paramètres : paramètres pour le hook, dépendant du hook (séparés par des "
|
||||
"points-virgules) :\n"
|
||||
" signal : nom(s) de signal (obligatoire)\n"
|
||||
|
@ -13879,6 +13881,7 @@ msgstr ""
|
|||
" config : nom(s) de l'option (obligatoire)\n"
|
||||
" focus : nom(s) de la zone (obligatoire)\n"
|
||||
" info : nom(s) de l'info (obligatoire)\n"
|
||||
" info_hashtable : nom(s) de l'info (obligatoire)\n"
|
||||
" conditions : conditions évaluées pour le trigger\n"
|
||||
" regex : une ou plusieurs expressions régulières pour remplacer des "
|
||||
"chaînes dans les variables\n"
|
||||
|
@ -13928,8 +13931,8 @@ msgstr ""
|
|||
" 2. remplacer le texte en utilisant une/des expression(s)s régulière(s)s "
|
||||
"POSIX étendue(s)s (si définie(s) dans le trigger)\n"
|
||||
" 3. exécuter le(s) commande(s) (si définie(s) dans le trigger)\n"
|
||||
" 4. sortir avec le code retour (sauf pour les modificateurs, line, focus et "
|
||||
"info)\n"
|
||||
" 4. sortir avec le code retour (sauf pour les modificateurs, line, focus, "
|
||||
"info et info_hashtable)\n"
|
||||
" 5. effectuer l'action \"post\"\n"
|
||||
"\n"
|
||||
"Exemples (vous pouvez aussi regarder les triggers par défaut avec /trigger "
|
||||
|
|
8
po/hu.po
8
po/hu.po
|
@ -20,7 +20,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: WeeChat\n"
|
||||
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
|
||||
"POT-Creation-Date: 2019-04-13 08:46+0200\n"
|
||||
"POT-Creation-Date: 2019-04-13 13:45+0200\n"
|
||||
"PO-Revision-Date: 2019-02-28 20:18+0100\n"
|
||||
"Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n"
|
||||
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
|
||||
|
@ -11329,7 +11329,7 @@ msgid ""
|
|||
" addreplace: add or replace an existing trigger\n"
|
||||
" name: name of trigger\n"
|
||||
" hook: signal, hsignal, modifier, line, print, command, command_run, "
|
||||
"timer, config, focus, info\n"
|
||||
"timer, config, focus, info, info_hashtable\n"
|
||||
" arguments: arguments for the hook, depending on hook (separated by "
|
||||
"semicolons):\n"
|
||||
" signal: name(s) of signal (required)\n"
|
||||
|
@ -11345,6 +11345,7 @@ msgid ""
|
|||
" config: name(s) of option (required)\n"
|
||||
" focus: name(s) of area (required)\n"
|
||||
" info: name(s) of info (required)\n"
|
||||
" info_hashtable: name(s) of info (required)\n"
|
||||
" conditions: evaluated conditions for the trigger\n"
|
||||
" regex: one or more regular expressions to replace strings in "
|
||||
"variables\n"
|
||||
|
@ -11389,7 +11390,8 @@ msgid ""
|
|||
" 2. replace text using POSIX extended regular expression(s) (if defined in "
|
||||
"trigger)\n"
|
||||
" 3. execute command(s) (if defined in trigger)\n"
|
||||
" 4. exit with a return code (except for modifier, line, focus and info)\n"
|
||||
" 4. exit with a return code (except for modifier, line, focus, info and "
|
||||
"info_hashtable)\n"
|
||||
" 5. perform post action\n"
|
||||
"\n"
|
||||
"Examples (you can also look at default triggers with /trigger listdefault):\n"
|
||||
|
|
8
po/it.po
8
po/it.po
|
@ -20,7 +20,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: WeeChat\n"
|
||||
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
|
||||
"POT-Creation-Date: 2019-04-13 08:46+0200\n"
|
||||
"POT-Creation-Date: 2019-04-13 13:45+0200\n"
|
||||
"PO-Revision-Date: 2019-03-17 16:04+0100\n"
|
||||
"Last-Translator: Esteban I. Ruiz Moreno <exio4.com@gmail.com>\n"
|
||||
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
|
||||
|
@ -12565,7 +12565,7 @@ msgid ""
|
|||
" addreplace: add or replace an existing trigger\n"
|
||||
" name: name of trigger\n"
|
||||
" hook: signal, hsignal, modifier, line, print, command, command_run, "
|
||||
"timer, config, focus, info\n"
|
||||
"timer, config, focus, info, info_hashtable\n"
|
||||
" arguments: arguments for the hook, depending on hook (separated by "
|
||||
"semicolons):\n"
|
||||
" signal: name(s) of signal (required)\n"
|
||||
|
@ -12581,6 +12581,7 @@ msgid ""
|
|||
" config: name(s) of option (required)\n"
|
||||
" focus: name(s) of area (required)\n"
|
||||
" info: name(s) of info (required)\n"
|
||||
" info_hashtable: name(s) of info (required)\n"
|
||||
" conditions: evaluated conditions for the trigger\n"
|
||||
" regex: one or more regular expressions to replace strings in "
|
||||
"variables\n"
|
||||
|
@ -12625,7 +12626,8 @@ msgid ""
|
|||
" 2. replace text using POSIX extended regular expression(s) (if defined in "
|
||||
"trigger)\n"
|
||||
" 3. execute command(s) (if defined in trigger)\n"
|
||||
" 4. exit with a return code (except for modifier, line, focus and info)\n"
|
||||
" 4. exit with a return code (except for modifier, line, focus, info and "
|
||||
"info_hashtable)\n"
|
||||
" 5. perform post action\n"
|
||||
"\n"
|
||||
"Examples (you can also look at default triggers with /trigger listdefault):\n"
|
||||
|
|
8
po/ja.po
8
po/ja.po
|
@ -20,7 +20,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: WeeChat\n"
|
||||
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
|
||||
"POT-Creation-Date: 2019-04-13 08:46+0200\n"
|
||||
"POT-Creation-Date: 2019-04-13 13:45+0200\n"
|
||||
"PO-Revision-Date: 2019-04-01 09:00+0900\n"
|
||||
"Last-Translator: AYANOKOUZI, Ryuunosuke <i38w7i3@yahoo.co.jp>\n"
|
||||
"Language-Team: Japanese <https://github.com/l/weechat/tree/master/"
|
||||
|
@ -13267,7 +13267,7 @@ msgid ""
|
|||
" addreplace: add or replace an existing trigger\n"
|
||||
" name: name of trigger\n"
|
||||
" hook: signal, hsignal, modifier, line, print, command, command_run, "
|
||||
"timer, config, focus, info\n"
|
||||
"timer, config, focus, info, info_hashtable\n"
|
||||
" arguments: arguments for the hook, depending on hook (separated by "
|
||||
"semicolons):\n"
|
||||
" signal: name(s) of signal (required)\n"
|
||||
|
@ -13283,6 +13283,7 @@ msgid ""
|
|||
" config: name(s) of option (required)\n"
|
||||
" focus: name(s) of area (required)\n"
|
||||
" info: name(s) of info (required)\n"
|
||||
" info_hashtable: name(s) of info (required)\n"
|
||||
" conditions: evaluated conditions for the trigger\n"
|
||||
" regex: one or more regular expressions to replace strings in "
|
||||
"variables\n"
|
||||
|
@ -13327,7 +13328,8 @@ msgid ""
|
|||
" 2. replace text using POSIX extended regular expression(s) (if defined in "
|
||||
"trigger)\n"
|
||||
" 3. execute command(s) (if defined in trigger)\n"
|
||||
" 4. exit with a return code (except for modifier, line, focus and info)\n"
|
||||
" 4. exit with a return code (except for modifier, line, focus, info and "
|
||||
"info_hashtable)\n"
|
||||
" 5. perform post action\n"
|
||||
"\n"
|
||||
"Examples (you can also look at default triggers with /trigger listdefault):\n"
|
||||
|
|
8
po/pl.po
8
po/pl.po
|
@ -22,7 +22,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: WeeChat\n"
|
||||
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
|
||||
"POT-Creation-Date: 2019-04-13 08:46+0200\n"
|
||||
"POT-Creation-Date: 2019-04-13 13:45+0200\n"
|
||||
"PO-Revision-Date: 2019-03-21 23:32+0100\n"
|
||||
"Last-Translator: Krzysztof Korościk <soltys@soltys.info>\n"
|
||||
"Language-Team: Polish <kde-i18n-doc@kde.org>\n"
|
||||
|
@ -13474,7 +13474,7 @@ msgid ""
|
|||
" addreplace: add or replace an existing trigger\n"
|
||||
" name: name of trigger\n"
|
||||
" hook: signal, hsignal, modifier, line, print, command, command_run, "
|
||||
"timer, config, focus, info\n"
|
||||
"timer, config, focus, info, info_hashtable\n"
|
||||
" arguments: arguments for the hook, depending on hook (separated by "
|
||||
"semicolons):\n"
|
||||
" signal: name(s) of signal (required)\n"
|
||||
|
@ -13490,6 +13490,7 @@ msgid ""
|
|||
" config: name(s) of option (required)\n"
|
||||
" focus: name(s) of area (required)\n"
|
||||
" info: name(s) of info (required)\n"
|
||||
" info_hashtable: name(s) of info (required)\n"
|
||||
" conditions: evaluated conditions for the trigger\n"
|
||||
" regex: one or more regular expressions to replace strings in "
|
||||
"variables\n"
|
||||
|
@ -13534,7 +13535,8 @@ msgid ""
|
|||
" 2. replace text using POSIX extended regular expression(s) (if defined in "
|
||||
"trigger)\n"
|
||||
" 3. execute command(s) (if defined in trigger)\n"
|
||||
" 4. exit with a return code (except for modifier, line, focus and info)\n"
|
||||
" 4. exit with a return code (except for modifier, line, focus, info and "
|
||||
"info_hashtable)\n"
|
||||
" 5. perform post action\n"
|
||||
"\n"
|
||||
"Examples (you can also look at default triggers with /trigger listdefault):\n"
|
||||
|
|
8
po/pt.po
8
po/pt.po
|
@ -20,7 +20,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: WeeChat\n"
|
||||
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
|
||||
"POT-Creation-Date: 2019-04-13 08:46+0200\n"
|
||||
"POT-Creation-Date: 2019-04-13 13:45+0200\n"
|
||||
"PO-Revision-Date: 2019-03-21 23:33+0100\n"
|
||||
"Last-Translator: Vasco Almeida <vascomalmeida@sapo.pt>\n"
|
||||
"Language-Team: Portuguese <>\n"
|
||||
|
@ -13123,7 +13123,7 @@ msgid ""
|
|||
" addreplace: add or replace an existing trigger\n"
|
||||
" name: name of trigger\n"
|
||||
" hook: signal, hsignal, modifier, line, print, command, command_run, "
|
||||
"timer, config, focus, info\n"
|
||||
"timer, config, focus, info, info_hashtable\n"
|
||||
" arguments: arguments for the hook, depending on hook (separated by "
|
||||
"semicolons):\n"
|
||||
" signal: name(s) of signal (required)\n"
|
||||
|
@ -13139,6 +13139,7 @@ msgid ""
|
|||
" config: name(s) of option (required)\n"
|
||||
" focus: name(s) of area (required)\n"
|
||||
" info: name(s) of info (required)\n"
|
||||
" info_hashtable: name(s) of info (required)\n"
|
||||
" conditions: evaluated conditions for the trigger\n"
|
||||
" regex: one or more regular expressions to replace strings in "
|
||||
"variables\n"
|
||||
|
@ -13183,7 +13184,8 @@ msgid ""
|
|||
" 2. replace text using POSIX extended regular expression(s) (if defined in "
|
||||
"trigger)\n"
|
||||
" 3. execute command(s) (if defined in trigger)\n"
|
||||
" 4. exit with a return code (except for modifier, line, focus and info)\n"
|
||||
" 4. exit with a return code (except for modifier, line, focus, info and "
|
||||
"info_hashtable)\n"
|
||||
" 5. perform post action\n"
|
||||
"\n"
|
||||
"Examples (you can also look at default triggers with /trigger listdefault):\n"
|
||||
|
|
|
@ -21,7 +21,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: WeeChat\n"
|
||||
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
|
||||
"POT-Creation-Date: 2019-04-13 08:46+0200\n"
|
||||
"POT-Creation-Date: 2019-04-13 13:45+0200\n"
|
||||
"PO-Revision-Date: 2019-03-11 21:10+0100\n"
|
||||
"Last-Translator: Eduardo Elias <camponez@gmail.com>\n"
|
||||
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
|
||||
|
@ -11800,7 +11800,7 @@ msgid ""
|
|||
" addreplace: add or replace an existing trigger\n"
|
||||
" name: name of trigger\n"
|
||||
" hook: signal, hsignal, modifier, line, print, command, command_run, "
|
||||
"timer, config, focus, info\n"
|
||||
"timer, config, focus, info, info_hashtable\n"
|
||||
" arguments: arguments for the hook, depending on hook (separated by "
|
||||
"semicolons):\n"
|
||||
" signal: name(s) of signal (required)\n"
|
||||
|
@ -11816,6 +11816,7 @@ msgid ""
|
|||
" config: name(s) of option (required)\n"
|
||||
" focus: name(s) of area (required)\n"
|
||||
" info: name(s) of info (required)\n"
|
||||
" info_hashtable: name(s) of info (required)\n"
|
||||
" conditions: evaluated conditions for the trigger\n"
|
||||
" regex: one or more regular expressions to replace strings in "
|
||||
"variables\n"
|
||||
|
@ -11860,7 +11861,8 @@ msgid ""
|
|||
" 2. replace text using POSIX extended regular expression(s) (if defined in "
|
||||
"trigger)\n"
|
||||
" 3. execute command(s) (if defined in trigger)\n"
|
||||
" 4. exit with a return code (except for modifier, line, focus and info)\n"
|
||||
" 4. exit with a return code (except for modifier, line, focus, info and "
|
||||
"info_hashtable)\n"
|
||||
" 5. perform post action\n"
|
||||
"\n"
|
||||
"Examples (you can also look at default triggers with /trigger listdefault):\n"
|
||||
|
|
8
po/ru.po
8
po/ru.po
|
@ -21,7 +21,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: WeeChat\n"
|
||||
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
|
||||
"POT-Creation-Date: 2019-04-13 08:46+0200\n"
|
||||
"POT-Creation-Date: 2019-04-13 13:45+0200\n"
|
||||
"PO-Revision-Date: 2019-03-11 21:10+0100\n"
|
||||
"Last-Translator: Aleksey V Zapparov AKA ixti <ixti@member.fsf.org>\n"
|
||||
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
|
||||
|
@ -11363,7 +11363,7 @@ msgid ""
|
|||
" addreplace: add or replace an existing trigger\n"
|
||||
" name: name of trigger\n"
|
||||
" hook: signal, hsignal, modifier, line, print, command, command_run, "
|
||||
"timer, config, focus, info\n"
|
||||
"timer, config, focus, info, info_hashtable\n"
|
||||
" arguments: arguments for the hook, depending on hook (separated by "
|
||||
"semicolons):\n"
|
||||
" signal: name(s) of signal (required)\n"
|
||||
|
@ -11379,6 +11379,7 @@ msgid ""
|
|||
" config: name(s) of option (required)\n"
|
||||
" focus: name(s) of area (required)\n"
|
||||
" info: name(s) of info (required)\n"
|
||||
" info_hashtable: name(s) of info (required)\n"
|
||||
" conditions: evaluated conditions for the trigger\n"
|
||||
" regex: one or more regular expressions to replace strings in "
|
||||
"variables\n"
|
||||
|
@ -11423,7 +11424,8 @@ msgid ""
|
|||
" 2. replace text using POSIX extended regular expression(s) (if defined in "
|
||||
"trigger)\n"
|
||||
" 3. execute command(s) (if defined in trigger)\n"
|
||||
" 4. exit with a return code (except for modifier, line, focus and info)\n"
|
||||
" 4. exit with a return code (except for modifier, line, focus, info and "
|
||||
"info_hashtable)\n"
|
||||
" 5. perform post action\n"
|
||||
"\n"
|
||||
"Examples (you can also look at default triggers with /trigger listdefault):\n"
|
||||
|
|
8
po/tr.po
8
po/tr.po
|
@ -20,7 +20,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: WeeChat\n"
|
||||
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
|
||||
"POT-Creation-Date: 2019-04-13 08:46+0200\n"
|
||||
"POT-Creation-Date: 2019-04-13 13:45+0200\n"
|
||||
"PO-Revision-Date: 2019-03-17 16:04+0100\n"
|
||||
"Last-Translator: Hasan Kiran <sunder67@hotmail.com>\n"
|
||||
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
|
||||
|
@ -10368,7 +10368,7 @@ msgid ""
|
|||
" addreplace: add or replace an existing trigger\n"
|
||||
" name: name of trigger\n"
|
||||
" hook: signal, hsignal, modifier, line, print, command, command_run, "
|
||||
"timer, config, focus, info\n"
|
||||
"timer, config, focus, info, info_hashtable\n"
|
||||
" arguments: arguments for the hook, depending on hook (separated by "
|
||||
"semicolons):\n"
|
||||
" signal: name(s) of signal (required)\n"
|
||||
|
@ -10384,6 +10384,7 @@ msgid ""
|
|||
" config: name(s) of option (required)\n"
|
||||
" focus: name(s) of area (required)\n"
|
||||
" info: name(s) of info (required)\n"
|
||||
" info_hashtable: name(s) of info (required)\n"
|
||||
" conditions: evaluated conditions for the trigger\n"
|
||||
" regex: one or more regular expressions to replace strings in "
|
||||
"variables\n"
|
||||
|
@ -10428,7 +10429,8 @@ msgid ""
|
|||
" 2. replace text using POSIX extended regular expression(s) (if defined in "
|
||||
"trigger)\n"
|
||||
" 3. execute command(s) (if defined in trigger)\n"
|
||||
" 4. exit with a return code (except for modifier, line, focus and info)\n"
|
||||
" 4. exit with a return code (except for modifier, line, focus, info and "
|
||||
"info_hashtable)\n"
|
||||
" 5. perform post action\n"
|
||||
"\n"
|
||||
"Examples (you can also look at default triggers with /trigger listdefault):\n"
|
||||
|
|
|
@ -21,7 +21,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: WeeChat\n"
|
||||
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
|
||||
"POT-Creation-Date: 2019-04-13 08:46+0200\n"
|
||||
"POT-Creation-Date: 2019-04-13 13:45+0200\n"
|
||||
"PO-Revision-Date: 2014-08-16 10:27+0200\n"
|
||||
"Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n"
|
||||
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
|
||||
|
@ -10212,7 +10212,7 @@ msgid ""
|
|||
" addreplace: add or replace an existing trigger\n"
|
||||
" name: name of trigger\n"
|
||||
" hook: signal, hsignal, modifier, line, print, command, command_run, "
|
||||
"timer, config, focus, info\n"
|
||||
"timer, config, focus, info, info_hashtable\n"
|
||||
" arguments: arguments for the hook, depending on hook (separated by "
|
||||
"semicolons):\n"
|
||||
" signal: name(s) of signal (required)\n"
|
||||
|
@ -10228,6 +10228,7 @@ msgid ""
|
|||
" config: name(s) of option (required)\n"
|
||||
" focus: name(s) of area (required)\n"
|
||||
" info: name(s) of info (required)\n"
|
||||
" info_hashtable: name(s) of info (required)\n"
|
||||
" conditions: evaluated conditions for the trigger\n"
|
||||
" regex: one or more regular expressions to replace strings in "
|
||||
"variables\n"
|
||||
|
@ -10272,7 +10273,8 @@ msgid ""
|
|||
" 2. replace text using POSIX extended regular expression(s) (if defined in "
|
||||
"trigger)\n"
|
||||
" 3. execute command(s) (if defined in trigger)\n"
|
||||
" 4. exit with a return code (except for modifier, line, focus and info)\n"
|
||||
" 4. exit with a return code (except for modifier, line, focus, info and "
|
||||
"info_hashtable)\n"
|
||||
" 5. perform post action\n"
|
||||
"\n"
|
||||
"Examples (you can also look at default triggers with /trigger listdefault):\n"
|
||||
|
|
|
@ -1200,6 +1200,60 @@ end:
|
|||
TRIGGER_CALLBACK_CB_END(info);
|
||||
}
|
||||
|
||||
/*
|
||||
* Callback for an info_hashtable hooked.
|
||||
*/
|
||||
|
||||
struct t_hashtable *
|
||||
trigger_callback_info_hashtable_cb (const void *pointer, void *data,
|
||||
const char *info_name,
|
||||
struct t_hashtable *hashtable)
|
||||
{
|
||||
struct t_hashtable *ret_hashtable;
|
||||
struct t_weelist_item *ptr_item;
|
||||
const char *ptr_key;
|
||||
|
||||
TRIGGER_CALLBACK_CB_INIT(NULL);
|
||||
|
||||
ret_hashtable = NULL;
|
||||
|
||||
TRIGGER_CALLBACK_CB_NEW_POINTERS;
|
||||
TRIGGER_CALLBACK_CB_NEW_VARS_UPDATED;
|
||||
|
||||
extra_vars = weechat_hashtable_dup (hashtable);
|
||||
|
||||
/* add data in hashtable used for conditions/replace/command */
|
||||
weechat_hashtable_set (extra_vars, "tg_info_name", info_name);
|
||||
|
||||
/* execute the trigger (conditions, regex, command) */
|
||||
trigger_callback_execute (trigger, NULL, pointers, extra_vars,
|
||||
vars_updated);
|
||||
|
||||
ret_hashtable = weechat_hashtable_new (32,
|
||||
WEECHAT_HASHTABLE_STRING,
|
||||
WEECHAT_HASHTABLE_STRING,
|
||||
NULL, NULL);
|
||||
if (ret_hashtable)
|
||||
{
|
||||
/* copy updated variables into the result "ret_hashtable" */
|
||||
for (ptr_item = weechat_list_get (vars_updated, 0); ptr_item;
|
||||
ptr_item = weechat_list_next (ptr_item))
|
||||
{
|
||||
ptr_key = weechat_list_string (ptr_item);
|
||||
if (weechat_hashtable_has_key (extra_vars, ptr_key))
|
||||
{
|
||||
weechat_hashtable_set (
|
||||
ret_hashtable,
|
||||
ptr_key,
|
||||
weechat_hashtable_get (extra_vars, ptr_key));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
TRIGGER_CALLBACK_CB_END(ret_hashtable);
|
||||
}
|
||||
|
||||
/*
|
||||
* Initializes trigger callback.
|
||||
*/
|
||||
|
|
|
@ -131,6 +131,10 @@ extern char *trigger_callback_info_cb (const void *pointer,
|
|||
void *data,
|
||||
const char *info_name,
|
||||
const char *arguments);
|
||||
extern struct t_hashtable *trigger_callback_info_hashtable_cb (const void *pointer,
|
||||
void *data,
|
||||
const char *info_name,
|
||||
struct t_hashtable *hashtable);
|
||||
extern void trigger_callback_init ();
|
||||
extern void trigger_callback_end ();
|
||||
|
||||
|
|
|
@ -1157,7 +1157,7 @@ trigger_command_init ()
|
|||
" addreplace: add or replace an existing trigger\n"
|
||||
" name: name of trigger\n"
|
||||
" hook: signal, hsignal, modifier, line, print, command, "
|
||||
"command_run, timer, config, focus, info\n"
|
||||
"command_run, timer, config, focus, info, info_hashtable\n"
|
||||
" arguments: arguments for the hook, depending on hook (separated "
|
||||
"by semicolons):\n"
|
||||
" signal: name(s) of signal (required)\n"
|
||||
|
@ -1173,6 +1173,7 @@ trigger_command_init ()
|
|||
" config: name(s) of option (required)\n"
|
||||
" focus: name(s) of area (required)\n"
|
||||
" info: name(s) of info (required)\n"
|
||||
" info_hashtable: name(s) of info (required)\n"
|
||||
" conditions: evaluated conditions for the trigger\n"
|
||||
" regex: one or more regular expressions to replace strings "
|
||||
"in variables\n"
|
||||
|
@ -1218,8 +1219,8 @@ trigger_command_init ()
|
|||
" 2. replace text using POSIX extended regular expression(s) (if "
|
||||
"defined in trigger)\n"
|
||||
" 3. execute command(s) (if defined in trigger)\n"
|
||||
" 4. exit with a return code (except for modifier, line, focus "
|
||||
"and info)\n"
|
||||
" 4. exit with a return code (except for modifier, line, focus, "
|
||||
"info and info_hashtable)\n"
|
||||
" 5. perform post action\n"
|
||||
"\n"
|
||||
"Examples (you can also look at default triggers with /trigger "
|
||||
|
|
|
@ -50,20 +50,20 @@ char *trigger_option_default[TRIGGER_NUM_OPTIONS] =
|
|||
|
||||
char *trigger_hook_type_string[TRIGGER_NUM_HOOK_TYPES] =
|
||||
{ "signal", "hsignal", "modifier", "line", "print", "command", "command_run",
|
||||
"timer", "config", "focus", "info" };
|
||||
"timer", "config", "focus", "info", "info_hashtable" };
|
||||
char *trigger_hook_option_values =
|
||||
"signal|hsignal|modifier|line|print|command|command_run|timer|config|"
|
||||
"focus|info";
|
||||
"focus|info|info_hashtable";
|
||||
char *trigger_hook_default_arguments[TRIGGER_NUM_HOOK_TYPES] =
|
||||
{ "xxx", "xxx", "xxx", "", "", "cmd;desc;args;args_desc;%(buffers_names)",
|
||||
"/cmd", "60000;0;0", "xxx", "chat", "xxx" };
|
||||
"/cmd", "60000;0;0", "xxx", "chat", "xxx", "xxx" };
|
||||
char *trigger_hook_default_rc[TRIGGER_NUM_HOOK_TYPES] =
|
||||
{ "ok,ok_eat,error", "ok,ok_eat,error", "", "", "ok,error", "ok,error",
|
||||
"ok,ok_eat,error", "ok", "ok", "", "" };
|
||||
"ok,ok_eat,error", "ok", "ok", "", "", "" };
|
||||
|
||||
char *trigger_hook_regex_default_var[TRIGGER_NUM_HOOK_TYPES] =
|
||||
{ "tg_signal_data", "", "tg_string", "message", "tg_message", "tg_argv_eol1",
|
||||
"tg_command", "tg_remaining_calls", "tg_value", "", "tg_info" };
|
||||
"tg_command", "tg_remaining_calls", "tg_value", "", "tg_info", "" };
|
||||
|
||||
char *trigger_return_code_string[TRIGGER_NUM_RETURN_CODES] =
|
||||
{ "ok", "ok_eat", "error" };
|
||||
|
@ -509,6 +509,26 @@ trigger_hook (struct t_trigger *trigger)
|
|||
}
|
||||
}
|
||||
break;
|
||||
case TRIGGER_HOOK_INFO_HASHTABLE:
|
||||
if (argv && (argc >= 1))
|
||||
{
|
||||
trigger->hooks = malloc (argc * sizeof (trigger->hooks[0]));
|
||||
if (trigger->hooks)
|
||||
{
|
||||
trigger->hooks_count = argc;
|
||||
for (i = 0; i < argc; i++)
|
||||
{
|
||||
trigger->hooks[i] = weechat_hook_info_hashtable (
|
||||
argv[i],
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
&trigger_callback_info_hashtable_cb,
|
||||
trigger, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (!trigger->hooks)
|
||||
|
|
|
@ -56,6 +56,7 @@ enum t_trigger_hook_type
|
|||
TRIGGER_HOOK_CONFIG,
|
||||
TRIGGER_HOOK_FOCUS,
|
||||
TRIGGER_HOOK_INFO,
|
||||
TRIGGER_HOOK_INFO_HASHTABLE,
|
||||
/* number of hook types */
|
||||
TRIGGER_NUM_HOOK_TYPES,
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue