On 05/14/2018 03:09 PM, David C. Rankin wrote:
Tim, all,
This is a tangential question on whether TDE has included an acpiac
configuration module for specifying event-handling for say laptop power-button
(suspend or off) as well as lid closed, etc.
This is prompted by the trend away from acpi (with the configuration for
event handling in /etc/acpi/handlers.sh) to acpiac which has a dearth of
documentation and limited user-information. Evidently, plasma, gnome and xfce
have configuration widgets for it. K3 has none (aside from the monitor DPMS
control -- which isn't related). If TDE has an implementation, I'd love to see
the commit and see how you did it, and where you put the interface. If TDE
doesn't have an interface yet, well throw it on the wishlist heap -- as it
looks like we will all have to deal with this power-interface in the near
future -- it's code feeds into the kernel -- so it's coming.
Short list of info links:
https://www.acpica.org/documentation
what it is:
https://acpica.org/sites/acpica/files/ACPI-Introduction.pdf or the
API/Programming Reference:
https://acpica.org/sites/acpica/files/acpica-reference_18.pdf
OS-Dev wisdom:
https://wiki.osdev.org/ACPICA
OK,
Thankfully this isn't as bad as first thought. systemd provides an interface
through /etc/systemd/login.conf that allows you to control settings for
PowerKey, LidSwitch, etc..., e.g.
[Login]
#NAutoVTs=6
#ReserveVT=6
#KillUserProcesses=no
#KillOnlyUsers=
#KillExcludeUsers=root
#InhibitDelayMaxSec=5
#HandlePowerKey=poweroff <== PowerKey power button config
HandlePowerKey=suspend
#HandleSuspendKey=suspend
#HandleHibernateKey=hibernate
#HandleLidSwitch=suspend <== LidSwitch lid behavior config
#HandleLidSwitchDocked=ignore
#PowerKeyIgnoreInhibited=no
#SuspendKeyIgnoreInhibited=no
#HibernateKeyIgnoreInhibited=no
#LidSwitchIgnoreInhibited=yes
#HoldoffTimeoutSec=30s
#IdleAction=ignore
#IdleActionSec=30min
#RuntimeDirectorySize=10%
#RemoveIPC=no
#UserTasksMax=12288
So rather than need to access the acpica API via C/C++, a basic config tool
can simple manipulate the settings in /etc/systemd/login.conf (though for
user-config, there may need to be something in ~/.config or ~/.local -- I
haven't checked whether systemd provides user-override control (though I doubt
it here since login.conf is a systemd system-wide config)
Note: a systemctl daemon-reload and logout/login isn't sufficient for the
change to be seen, a reboot is needed (this is where an interface with the
API, or using one of the acpica utilities may allow a direct change of the
current acpi state.
Heap this on the (may need to get to in the future) pile...
--
David C. Rankin, J.D.,P.E.