There is only one thing that has irked me about my ASUS VivoBook, and it isn’t the laptop’s fault. When I go to hit the “delete” key, it is right next to the power button. The reason this matters is that default behavior in Ubuntu and all it’s flavor variants, is for this button to immediately shut the computer off…that’s right, no warning or popups etc, just slammed straight down. To change this, you can edit logind.conf and set HandlePowerKey to “ignore”.
Here is the command you need:sudo nano /etc/systemd/logind.conf
Then change HandlePowerKey=poweroff
to
HandlePowerKey=ignore
Do make sure that if it is commented out, you remove the comment.
Now the power button does nothing while the computer is running, and simply turns it on when the laptop is off.
**Note**
A 10 second press of the power button does still successfully force the laptop down.