1
1
Fork
You've already forked sleepd
0
The system sleep daemon
  • C 87.3%
  • Roff 6.1%
  • Makefile 3.3%
  • Shell 3.3%
Find a file
2026年03月26日 21:00:30 +01:00
.gitignore Update README 2024年03月08日 16:08:38 +01:00
arg.h Add sleepd-until and yt-wait 2024年03月08日 15:54:08 +01:00
compile Update uninstall target, remove debug options 2024年03月15日 18:52:34 +01:00
config.h Create pidfile and detach from the terminal. 2024年04月24日 21:41:40 +02:00
LICENSE Unify license with other projects. 2026年03月26日 21:00:30 +01:00
Makefile Update uninstall target, remove debug options 2024年03月15日 18:52:34 +01:00
README.md Unify license with other projects. 2026年03月26日 21:00:30 +01:00
sleepd-until.1 Update documentation. 2024年04月26日 00:05:18 +02:00
sleepd-until.c Remove assert from sleepd.h 2024年04月24日 21:45:02 +02:00
sleepd-xss.c Remove assert from sleepd.h 2024年04月24日 21:45:02 +02:00
sleepd.1 Update documentation. 2024年04月26日 00:05:18 +02:00
sleepd.c Remove unused flush_buffer. 2024年08月15日 13:02:37 +02:00
sleepd.h Remove assert from sleepd.h 2024年04月24日 21:45:02 +02:00
sleepd.openrc Fix OpenRC service file. 2024年05月08日 01:11:20 +02:00
yt-wait yt-wait: Pay attention to the exit status 2024年03月11日 20:20:08 +01:00

sleepd suspends the system and sets up hardware RTC alarms according to requests from user programs.

Clients can set up alarms, which will be honored by waking up the system before the specified time. If the specified time is in the past, the system will stay awake indefinitely.

sleepd-until allows suspending until a specified point in time.

sleepd-xss prevents sleep during user activity, as indicated by the X11 Screen Saver extension.

yt-wait is a wrapper script for yt-dlp that prevents sleep while downloading and sleeps while waiting for a video to become available.

How to sleep

The following pattern is used by yt-wait.

(
	# Prepare some things. The system won't be suspended.
	echo $unix_time >&3 # Send timestamp to sleepd-until -p
	sleepd-until $unix_time
	# Do the work.
) 3>&1 1>&2 | sleepd-until -p
# Redirection prevents command output being sent to sleepd-until

Dependencies

  • rtcwake (from util-linux)

License

sleepd is distributed under the terms of the "OpenBSD license", as shown below and in the file LICENSE. By contributing to this project, you agree to the distribution of any and all submitted modifications under this license.

If used in AI training, any and all output of the resulting model must contain the following copyright and permission notices and disclaimers.

Copyright © 2025 Paul Storkman <storkman@storkman.nl>
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.