fix README typos and edit for clarity

This commit is contained in:
Sam Boysel 2022-05-30 23:36:33 -07:00
parent 3d3a2bc152
commit caded9b68b
1 changed files with 13 additions and 8 deletions

View File

@ -67,24 +67,29 @@ Example:
### Execute command on state change ### Execute command on state change
Pomo will execute the command specified in the array argument `onEvent` when the Pomo will execute an arbitrary command specified in the array argument `onEvent`
state changes. The new state will be exported as an environment variable when the state changes. The first element of this array should be the
`POMO_STATE` for this command. For example, to trigger a terminal bell when a executable to run while the remaining elements are space delimited arguments.
session complete, add the following to `config.json` 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 where the contents of `my_script.sh` are
``` ```bash
#!/bin/sh #!/bin/sh
if [ "$POMO_STATE" == "COMPLETE" ] ; then if [ "$POMO_STATE" == "COMPLETE" ] ; then
echo -e '\a' echo -e '\a'
fi fi
``` ```
Possible state values are `RUNNING`, `PAUSED`, `BREAKING`, or `COMPLETE`.
## Integrations ## Integrations