How to shut down (and start up) Moto X without lock button?
ADB: Once you have the Android Debugging Bridge (available with the Android SDK or packaged separately) installed on your system and authorized on your device, you can simply run this command from a terminal: adb reboot -p
Replace the missing button with a Pressy clone that plugs into your headphone jack. You can then use it with an app like KeyCut to configure what it does.