sleepd

Langue: en

Autres versions - même langue

Version: 328492 (ubuntu - 08/07/09)

Section: 8 (Commandes administrateur)

NAME

sleepd - puts a laptop to sleep during inactivity or on low battery

SYNOPSIS

sleepd [-s command] [-d command] [-u n] [-U n] [-i n [-i n ..]] [-a] [-n] [-c n] [-b n] [-A]

DESCRIPTION

sleepd is a daemon to force laptops to go to sleep after some period of inactivity. This is useful if your laptop does not automatically go to sleep when you aren't using it, and, like me, you often forget to shut it off. It is also capable of suspending a laptop when its battery gets very low.

sleepd monitors interrupts to detect when your laptop is in use. It defaults to automatically figuring out what interupts are used by your keyboard and mouse, by looking for lines containing things like "keyboard" and "mouse" in /proc/interrupts. This may not detect all keyboards and mice, so other interrupts can be specified. After a configurable amount of time with no activity on these interrupts, it asks apm(1) or some user-defined program to put the laptop to sleep.

OPTIONS

-h, --help
Show summary of options.
-n, --nodaemon
Don't fork to background; run in forground.
-u, --unused
Number of seconds the laptop can remain idle before being put to sleep. Defaults to 600 secods (10 minutes). Set to 0 to disable any sleeping due to idleness.
-U, --ac-unused
If set, controls the number of seconds the laptop can remain idle before being put to sleep when running on AC power. If not set, the laptop will not sleep when it's on AC power.
-i, --irq
Adds an irq to the list that is watched. Using this switch disables automatic detection of keyboard and mouse irqs unless -a is specified as well.
-a, --auto
Automatically detect and watch mouse and keyboard irqs. This is the default, but specifying irqs manually with -i disables the autoprobe. This turns it back on.
-s, --sleep-command
Command to run to put the laptop to sleep. Defaults to "apm -s" for systems with apm and "hibernate --force" for systems with ACPI.
-b, --battery
If this option is specified, the daemon will put the laptop to sleep if the percentage of battery charge drops below the specified number and the system is off AC power. This is useful for some laptops which don't handle this themselves. It supports using APM, ACPI, and HAL for querying battery status.
-d, --hibernate-command
A command to run instead of the regular sleep command when the battery is low. This can be useful if you want to make the system go to sleep when it's not active, but suspend to disk if the battery is low. If not set, the sleep command is used.
-A, --and
Only go to sleep if all specified conditions are met. For example, only sleep if idle and if the battery is low.
-c, --check-period
Number of seconds between check on system status. Defaults to 10 seconds, which should be fine generally.

SEE ALSO

sleepctl(1),apm(1)

http://kitenet.net/~joey/code/sleepd/

BUGS

It cannot always detect keyboard and mouse. If the keyboard or mouse interrupt is shared (as is common with usb devices), other devices on the same interrupt can keep the system awake.

AUTHOR

Joey Hess <joey@kitenet.net>