Hi, after I had spent weekend with my new toy, I faced the reality of an "unexpected" power loss and resulting damaged sdcard (read only now)
So I've tried this
https://gist.github.com/lbussy/9e81cbcc617952f1250e353bd42e7775and it seems it works, with Rpi still usb powered, the single touching the gpio3 against gnd (via 100ohm, there is an 1k8 pullup for i2c) does shutdown and the next touch reboots back.
Now, not to invent the wheel, did somebody made (or is aware of) a wiring such a comparator looks at the 5V input drop, issues the signal, while the Rpi will be powered off a supercapacitor during the shutdown, for example?
The headless minimal wifi OS config here takes aprox 12secs to shutdown, thus the supercapacitor has to be pretty large, though..