man sleepd (Administration système) - puts a laptop to sleep during inactivity


sleepd - puts a laptop to sleep during inactivity


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


sleepd is a daemon to force laptops to enter apm 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.


-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, no distinction made between being on AC power or not. Set to 0 to disable any sleeping while the laptop is 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". If your laptop uses ACPI, you may need to get software suspend working in your kernel, and write a command to use that.
-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 both APM and ACPI for querying battery status.
-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.




It cannot always detect keyboard and mouse, especially with 2.5 kernels. 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.


Joey Hess <>