ACPI

ACPI (Advanced Configuration and Power Management Interface) is a power management system. It is part of the BIOS.

Kernel
The following kernel options need to be activated for ACPI:

Emerge
Desktop environments react on the common events generated by ACPI. If a desktop environment is not installed or to have the system react on special events the ACPI package can be installed. Install the package:

USE flags
There are no use flags available for at this time.

SELinux
For acpid to be able to shutdown a SELinux system, make sure the package is installed and the  executable is re-labelled.

Configuration
The scripts found in define how the system reacts on ACPI events. They can be edited as necessary to meet the user's needs.

OpenRC
The acpid service can now be started. While using OpenRC run:

To have the acpid service start at boot time add it to the default runlevel:

Systemd
In case of systemd:

To enable the acpid service on system boot issue:

To start the service now:

Advanced configuration
The default ACPI setup may be satisfactory for some users, however a little extra configuration may be required to get the acpid daemon to treat some basic ACPI events properly (AC power plug in/out, multimedia keys, etc.).

Modifications can be make to along with  if necessary. Why not create a complicated setup that makes use of the and  capabilities? Simply put scripts and event files in those locations for advanced usage.

A basic file will probably be enough for most users, however the following is an example of what could be done using :

Examples
ACPI events and actions examples for Lenovo ThinkPad T410