# power off shutdown begin prog = irexec button = power config = sudo shutdown -h now end # play a music # once kill current aplayex, after then call new aplayex begin prog = irexec button = 1 config = kill `ps auxw | grep aplayex | egrep -v grep | awk '{print $2}'` config = /home/pi/wav/aplayex -D hw:1,0 /home/pi/wav/01.wav & end begin prog = irexec button = 2 config = kill `ps auxw | grep aplayex | egrep -v grep | awk '{print $2}'` config = /home/pi/wav/aplayex -D hw:1,0 /home/pi/wav/02.wav & end begin prog = irexec button = 3 config = kill `ps auxw | grep aplayex | egrep -v grep | awk '{print $2}'` config = /home/pi/wav/aplayex -D hw:1,0 /home/pi/wav/03.wav & end # stop begin prog = irexec button = stop config = kill `ps auxw | grep aplayex | egrep -v grep | awk '{print $2}'` end 追記: 上記の config = kill `ps auxw | grep aplayex | egrep -v grep | awk '{print $2}'` は、既に起動している aplayex のプロセスIDを検索してそれをkillする、つまり、 aplayex を停止させるためであるが、上手く動かないときもある。 そこで、別の方法として、これを config = pkill -f aplayex に変更してみた。