Self-powered Attiny13 with 2N2222

The first solution is probably better for my case since I will add several buttons and put some diodes and check which button was pressed.

Thanks