Easily Add a Switch to Your Raspberry Pi
The Raspberry Pi doesn’t have a power switch, which means you have to remember to actually turn it off properly every time you want to turn it off. If you don’t feel like running these additional commands, Instructables user AndrewH7 will show you how easy it is to add a shutdown switch.
Basically, you just add a small wire to the GPIO and wrap it with duct tape. Then you’ll install some software so that when you press the switch, it triggers the correct shutdown commands for the Pi. It’s not exactly the dignified looking solution in the world, but it’s easy to do and you can do it in a short amount of time. This is especially handy if you are using the Pi like a headless computer but still want to safely shutdown it from time to time.
Raspberry Pi Simple Shutdown Button | Instructables