#!/bin/rc rfork e if (! test -w '#G'/gpio) { echo 'Exiting; no gpio.' >[1=2] exit gpio } # "Broadcom" pins, not physical. # Wire to this and ground (e.g. physical 29 for 5 and 39 for ground). pin=5 echo 'pullup 5' > '#G'/gpio pushed=no while () { if (~ $pushed yes) sleep 0.5 out=`{pibutton | grep '^'$pin':'} if (~ $out(2) 0) { pushed=yes window -m rc -c 'echo ed''(1)'' is the standard editor. ; ed' } if not pushed=no sleep 0.05 }