How can I set the power button (on my computer case, not keyboard) to power off the system with
systemd can handle this. I think this is what you need:
HandlePowerKey: action on power key is pressed;
HandleSuspendKey: action on suspend key is pressed.
HandleHibernateKey: action on hibernate key is pressed.
HandleLidSwitch: action when the lid is closed.
The action can be one of
If no configuration, default values used:
I don't see it's related with systemd, but on my system that has
acpid installed, it respond to power button press automatically.
Can be defined through
/etc/acpi/handler.sh (On Arch Linux)
I believe you need to configure that in your BIOS (if it supports it). I don't see how the power button on the case has anything to do with your OS, where a power button on your keyboard does interact with the OS since the OS loads drivers for the keyboard.