Here’s what I came up with.
nu.conf file:
rpcusername=xxxxx
rpcpassword=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
server=1
walletnotify=/home/pi/Desktop/scripts/money.sh
money.sh:
#!/bin/bash
#Only if current time is more than `first_active_hour` audio will be played. This is to be quiet during the night.
first_active_hour=10
snd=$(( ( RANDOM % 3 ) + 1 ))
sfx_path="/home/pi/Desktop/scripts/sfx/gold_$snd.wav"
hour=`date +%H`
test "$hour" -gt "$first_active_hour" && (timeout --signal=SIGKILL 5s aplay -q "$sfx_path")
exit 0
This worked with blocknotify, played the sound and all, but I haven’t yet managed to find a block so I don’t know if it works with walletnotify.