pwatk wrote:Well I've discovered that this from the README.Slackware doesn't work:
Code: Select all
...
As an example, if you wanted to change the hdparm setting for
your hard drive's power management setting: rather than copying the entire
contents of /usr/lib(64)/pm-utils/power.d/harddrive to /etc/pm/power.d/ and
editing the copy, you could place only these two lines:
DRIVE_POWER_MGMT_BAT=128 # edit value as desired
DRIVE_POWER_MGMT_AC=128 # edit value as desired
...
The README is wrong in that regard. Have a look at man pm-suspend and man pm-powersave. The meaning of each of the directories is explained there and how to use the program. It's much shorter than the Slackware README too.

To give you a short overview:
/etc/pm/config.d: Any configuration values like DRIVE_POWER_MGMT_BAT, ...
/etc/pm/sleep.d, /usr/lib/pm-utils/sleep.d: Suspend and hibernate hooks
/etc/pm/power.d/, /usr/lib/pm-utils/power.d/: Scripts which are executed to enable/disable powersave
Those lines need to go into /etc/pm-utils/config.d/. Add a file named e.g. /etc/pm-utils/config.d/drivepwr with this content:
Code: Select all
DRIVE_POWER_MGMT_BAT=128 # edit value as desired
DRIVE_POWER_MGMT_AC=128 # edit value as desired
It should work then without hacking the default scripts.
pwatk wrote:I'm now one step further because these settings are applied when resuming from hibernation but nothing happens if I plug or unplug the AC adaptor (I tested this with different settings) and the settings are not applied at boot.
Well, that's a completely different thing.

You weren't intially asking for it either, were you.

Anyway, as of now pm-utils or more specifically pm-powersave which handles this functionality, doesn't notice the change of power state. You need to modify the acpi-handler.sh. Have a look here:
https://sites.google.com/site/cheer6/acpi%27shandler.sh