The total circuit includes an AVR microcontroller, a near-zero current LDO, and a switching (buck) supply. My current design draws about 350nA when Vin is 9V. The AVR controls power to the Raspberry Pi. Two GPIO pins are used. One for the AVR to initiate a shutdown and one for Raspberry Pi to tell AVR after filesystem has been unmounted.
The Raspberry Pi files here, are duplicates from the Raspberry Pi Soft Power Controller GitHub repository. I don't expect many changes at this point, but the latest will be there. I'm still actively modifying the AVR code, so I am not ready to post a copy of that here.