Skip to content

Commit df1ca8b

Browse files
committed
update
1 parent 892f843 commit df1ca8b

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,3 +135,18 @@ sudo systemctl start button-box.service
135135
```
136136
systemctl status button-box.service
137137
```
138+
139+
# Bash script template
140+
I've included a template for bash scripts on `scripts/template.sh` that anyone can use to create their customized set of commands to run upon a button event. Just copy the template, rename it, edit it according to your needs, and when running the `button-box.py` controller, add the full path to the new script to one (or more) of the `--btn_*` arguments. For example:
141+
```
142+
./button-box.py --buzzer 4 \
143+
--g1_pressed '/opt/rpi-button-box/scripts/notification.sh' \
144+
--b1_pressed '/opt/rpi-button-box/scripts/switch_cameras.sh' \
145+
--r1_pressed '/opt/rpi-button-box/scripts/lights_toggle.sh' \
146+
--g2_pressed '/opt/rpi-button-box/scripts/test_connectivity.sh' \
147+
--b2_pressed '/opt/rpi-button-box/scripts/shutdown.sh' \
148+
--r2_pressed '/opt/rpi-button-box/scripts/reboot.sh' \
149+
--s2_held '/opt/rpi-button-box/scripts/alarm_on.sh' \
150+
--s2_released '/opt/rpi-button-box/scripts/alarm_off.sh' \
151+
--s3_held '/opt/rpi-button-box/scripts/emergency.sh'
152+
```

0 commit comments

Comments
 (0)