10 Powersave Events
Events are triggered from the daemon when Hardware changes are
recognised or user requests have been made.
Have a look into
/etc/powersave/events where you may want to
change the default behaviour how events get processed.
The syntax is:
EVENT="action1 action2 action3 ..."
Events are triggered e.g. when:
- power/sleep button presses and the lid closing/opening.
- battery levels are exceeded
- the power source changes (AC/Battery)
- temperature limits are reached
- the user requests a suspend/standby sleeping state
- the machine resumes from a suspend/standby sleeping state
- the daemon is stopped/started
- the user manually requests a power save policy, so called scheme change
- the CPU usage was under a certain level for a specific time
(configurable in cpufreq conf file)
- Any non thermal, battery, ac or button ACPI event had happend
If an event happens, the configured actions for this event are
processed from left to right.
There are internal (processed from the daemon internally) and external
actions (executed scripts located in
that can be assigned to each event.
Internal actions (name is reserved, scripts must not be named like that)
External actions are simply executables (typically scripts) placed in
- ignore (do nothing)
- throttle (throttle cpu(s) if throttling is enabled in this scheme)
- dethrottle (unthrottle cpu(s))
(Trigger reevaluation of usable CPU speeds. There are machines,
that cannot run on full speed when on battery. This internal event
causes a reevaluation of which speeds are available. Usually only
makes sense in acadapter.*-events).
- suspend_to_disk (Trigger the global.suspend2disk event)
- suspend_to_ram (Trigger the global.suspend2ram event)
- standby (Trigger the global.standby event)
(Actually tell kernel to do a suspend-to-disk. Should only be used
from a global.suspend2disk event)
- do_suspend_to_ram (see do_suspend_to_disk)
- do_standby (see do_suspend_to_disk)
/usr/lib/powersave/scripts, the name of the executable is the event
/etc/powersave/events to debug the hotkey events on some
ASUS notebooks (the asus_acpi module has to be loaded) and watch
/var/log/messages for the output of the debug_events script..
See the next chapter (Scripts) how to write your own scripts for events.