From f7206ef08d59f1047a3a7c85bd9b6b12f3d0ac34 Mon Sep 17 00:00:00 2001 From: horus645 Date: Sat, 18 Dec 2021 22:17:20 -0300 Subject: [PATCH] Added documentation for discriminated on-click events --- doc/yambar-particles.5.scd | 45 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 43 insertions(+), 2 deletions(-) diff --git a/doc/yambar-particles.5.scd b/doc/yambar-particles.5.scd index ab689a0..a633269 100644 --- a/doc/yambar-particles.5.scd +++ b/doc/yambar-particles.5.scd @@ -36,15 +36,56 @@ following attributes are supported by all particles: : no : Foreground (text) color. Just like _font_, this is an inherited attribute. | on-click +: associative array/string +: no +: When set to a string, executes the string as a command when the particle + is left-clicked. Tags can be used. Note that the string is *not* + executed in a shell. The same applies to all attributes associated with + it, below. +| on-click.left : string : no -: Command to execute when the particle is clicked. Tags can be - used. Note that the string is *not* executed in a shell. +: Command to execute when the particle is left-clicked. +| on-click.right +: string +: no +: Command to execute when the particle is right-clicked. +| on-click.middle +: string +: no +: Command to execute when the particle is middle-clicked. +| on-click.wheel-up +: string +: no +: Command to execute every time a 'wheel-up' event is triggered. +| on-click.wheel-down +: string +: no +: Command to execute every time a 'wheel-down' event is triggered. | deco : decoration : no : Decoration to apply to the particle. See *yambar-decorations*(5) +## EXAMPLES: + +*on-click* as a string (handles left click): +``` +content: + : + on-click: command args +``` + +*on-click* as an associative array (handles other buttons): +``` +content: + : + on-click: + left: command-1 + wheel-up: command-3 + wheel-down: command-4 +``` + # STRING This is the most basic particle. It takes a format string, consisting