- C 87.3%
- Roff 6.1%
- Makefile 3.3%
- Shell 3.3%
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.