From caded9b68b1b7c987b19888fd16615765fe6b699 Mon Sep 17 00:00:00 2001 From: Sam Boysel Date: Mon, 30 May 2022 23:36:33 -0700 Subject: [PATCH] fix README typos and edit for clarity --- README.md | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index f5a216e..f0e0a66 100644 --- a/README.md +++ b/README.md @@ -67,24 +67,29 @@ Example: ### Execute command on state change -Pomo will execute the command specified in the array argument `onEvent` when the -state changes. The new state will be exported as an environment variable -`POMO_STATE` for this command. For example, to trigger a terminal bell when a -session complete, add the following to `config.json` -``` +Pomo will execute an arbitrary command specified in the array argument `onEvent` +when the state changes. The first element of this array should be the +executable to run while the remaining elements are space delimited arguments. +The new state will be exported as an environment variable `POMO_STATE` for this +command. Possible state values are `RUNNING`, `PAUSED`, `BREAKING`, or +`COMPLETE`. + + +For example, to trigger a terminal bell when a session completes, add the +following to `config.json`: +```json ... -"onEvent": ["/bin/sh", "/path/to/script/my_script.sh"] +"onEvent": ["/bin/sh", "/path/to/script/my_script.sh"], ... ``` where the contents of `my_script.sh` are -``` +```bash #!/bin/sh if [ "$POMO_STATE" == "COMPLETE" ] ; then echo -e '\a' fi ``` -Possible state values are `RUNNING`, `PAUSED`, `BREAKING`, or `COMPLETE`. ## Integrations