SLEEPD(8)

πŸ“¦ version 2.11, in debian bookworm

πŸ’€ NAME πŸ’€

sleepd β€” bestie, this daemon puts your laptop to sleep when you're being inactive, or when the battery gets scary low ✨


🌸 SYNOPSIS 🌸

sleepd [-s command] [-d command] [-u n] [-U n] [-I] [-i n] [-E] [-e
filename] [-a] [-l n] [-w] [-n] [-v] [-c n] [-b n] [-A] [-H] [-N
[device] [-r n] [-t n]]

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so real talk: sleepd is a daemon that forces laptops to go to sleep after some period of inactivity πŸ’… it's giving "the friend who makes sure you actually go to bed." this is super useful if your laptop does not automatically go to sleep when you aren't using it, and β€” like the original author β€” if you, too, constantly forget to shut it off 😭. it can also suspend a laptop when its battery gets very low πŸͺ«

sleepd can detect activity in several ways, no cap. the default is to poll both event devices and interrupts to figure out when your laptop is in use because of keyboard or mouse activity πŸ–±οΈβŒ¨οΈ. it defaults to polling /dev/input/event*. you may specify a list of device files to poll instead, or use options to enable other means of checking for activity (network activity, utmp, or load average). after a configurable amount of time with no activity, sleepd runs a program to put the laptop to sleep 😴 periodt.


πŸ‘‘ OPTIONS πŸ‘‘

  • -h, --help β€” shows you a lil summary of the options 🫢
  • -n, --nodaemon β€” don't fork to background; run in forground (yes, the original spells it like that, we love her πŸ™ˆ)
  • -v, --verbose β€” outputs status messages, so you can see what's happening in real time πŸ‘€
  • -u, --unused β€” number of seconds the laptop can remain idle before being put to sleep. defaults to 600 seconds (10 minutes). set it to 0 to disable any sleeping due to idleness πŸ›‘
  • -U, --ac-unused β€” if set, this controls the number of seconds the laptop can remain idle before being put to sleep when running on AC power. if it's not set, the laptop will not sleep when it's on AC power πŸ”Œ
  • -e, --event β€” adds an event file to the list that is watched. using this switch disables polling all files in /dev/input/event* πŸŽ€
  • -E, --no-events β€” this switch disables event device polling 🚫
  • -l, --load β€” if set, a load average higher than this number will prevent the computer from sleeping. if not set, the computer will ignore the load average πŸ“Š
  • -w β€” if set, sleepd will also check idletime based on utmp. this will prevent the system from sleeping while remote connections are active. it uses the time limit from -u 🌐
  • -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 ⚑
  • -I, --no-irq β€” this switch disables interrupt polling πŸ’€
  • -a, --auto β€” automatically detect and watch mouse and keyboard irqs πŸ–±οΈβŒ¨οΈ
  • -s, --sleep-command β€” the command to run to put the laptop to sleep. defaults to "apm -s" for systems with APM and "pm-suspend" 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 the system to 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 πŸ’Ύ
  • -N, --netdev β€” monitor a network interface for activity based on packet count. eth0 is the default. this option may be used more than once with different network interfaces πŸ“‘
  • -t, --tx-min β€” set a baseline transmit raffic rate in packets per second for network monitoring. requires -N (and yes, "raffic" β€” the typo is canon, we keep it fr fr πŸ™ˆ)
  • -r, --rx-min β€” set a baseline receive traffic rate in packets per second for network monitoring. requires -N πŸ“Ά
  • -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 checks on system status. defaults to 10 seconds, which should be fine generally ⏱️
  • -H, --force-upower β€” force UPower to be used instead of ACPI or other methods to query battery status πŸ”‹

🌈 SEE ALSO 🌈


πŸ’€ BUGS πŸ’€

interrupt monitoring 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 πŸ’€. use event device polling instead β€” that's the move, trust 🫢

no cap, this one will bite you if you've got shared usb interrupts. event device polling is the fix.

🧚 AUTHOR 🧚

Joey Hess <joey@kitenet.net>


and that's the whole vibe check, bestie πŸŽ€ this was SLEEPD(8) from the System Manager's Manual β€” section 8, system manager business, sleeping laptops only πŸ’€βœ¨ thanks for reading, go take a nap, you've earned it πŸ«ΆπŸ’–

πŸ“¦ where this page comes from