This page explains how to configure the action taken when you press the power button on your PC.

Configure Power Button Action

When the power button is pressed on your PC, the ACPI daemon passes control to:

This in turn passes control to

And this in turn passes control to

There are therefore a number of places where you can configure the action(s) taken when the power button is pressed. For example, in antiX 17.1, the command executed by /etc/acpi/powerbtn.sh is:

if [ -x /etc/acpi/powerbtn.sh ] ; then
        # Compatibility with old config script from acpid package
        /etc/acpi/powerbtn.sh
elif [ -x /etc/acpi/powerbtn.sh.dpkg-bak ] ; then
        # Compatibility with old config script from acpid package
        # which is still around because it was changed by the admin
        /etc/acpi/powerbtn.sh.dpkg-bak
else
        # Normal handling.
        /sbin/shutdown -h -P now "Power button pressed"
fi 

If, for example, you want a laptop to sleep rather than shutdown, you would change the penultimate line of this file (/sbin/shutdown -h -P now "Power button pressed") to:

        /usr/sbin/pm-suspend                      

This change can be effected by editing the file using the following command: