Commit
+13 -8 +/-1 browse
1 | diff --git a/README.md b/README.md |
2 | index f5a216e..f0e0a66 100644 |
3 | --- a/README.md |
4 | +++ b/README.md |
5 | @@ -67,24 +67,29 @@ Example: |
6 | |
7 | ### Execute command on state change |
8 | |
9 | - Pomo will execute the command specified in the array argument `onEvent` when the |
10 | - state changes. The new state will be exported as an environment variable |
11 | - `POMO_STATE` for this command. For example, to trigger a terminal bell when a |
12 | - session complete, add the following to `config.json` |
13 | - ``` |
14 | + Pomo will execute an arbitrary command specified in the array argument `onEvent` |
15 | + when the state changes. The first element of this array should be the |
16 | + executable to run while the remaining elements are space delimited arguments. |
17 | + The new state will be exported as an environment variable `POMO_STATE` for this |
18 | + command. Possible state values are `RUNNING`, `PAUSED`, `BREAKING`, or |
19 | + `COMPLETE`. |
20 | + |
21 | + |
22 | + For example, to trigger a terminal bell when a session completes, add the |
23 | + following to `config.json`: |
24 | + ```json |
25 | ... |
26 | - "onEvent": ["/bin/sh", "/path/to/script/my_script.sh"] |
27 | + "onEvent": ["/bin/sh", "/path/to/script/my_script.sh"], |
28 | ... |
29 | ``` |
30 | where the contents of `my_script.sh` are |
31 | - ``` |
32 | + ```bash |
33 | #!/bin/sh |
34 | |
35 | if [ "$POMO_STATE" == "COMPLETE" ] ; then |
36 | echo -e '\a' |
37 | fi |
38 | ``` |
39 | - Possible state values are `RUNNING`, `PAUSED`, `BREAKING`, or `COMPLETE`. |
40 | |
41 | ## Integrations |
42 |