Skip to content

Prevent automatic sleep and gracefully handle manual sleep by sending SIGINT to child processes

License

Notifications You must be signed in to change notification settings

sunknudsen/wakeful

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wakeful

Prevent automatic sleep and gracefully handle manual sleep by sending SIGINT to child processes.

Inspired by caffeinate, Wakeful prevents data corruption in long-running processes like bitcoin-node-docker by ensuring graceful shutdown before sleep.

If you wish to support this project, please star repo and consider a donation.

Installation

Build and install Wakeful manually

$ git clone https://github.com/sunknudsen/wakeful.git

$ cd wakeful

$ swift build --configuration release

$ sudo cp .build/release/wakeful /usr/local/bin

Build and install Wakeful using Homebrew

$ brew install sunknudsen/tap/wakeful

Usage

$ wakeful --help
Usage: wakeful [options] <command> [arguments...]

Options:
  -d, --display                 Prevent computer and display from sleeping
  -g, --grace-period <seconds>  Grace period for child process termination (default: 60)
  -h, --help                    Show this help message and exit
  -v, --verbose                 Make operation more talkative
  -V, --version                 Show version number and exit

Example: wakeful watch ls -la

Distribution

Build and notarize Wakeful

Prerequisites:

  • Create “App Manager” API key on App Store Connect
  • Run xcrun notarytool store-credentials wakeful-notarytool
  • Run cp .env.sample .env and add your “Developer ID Application” signing identity
$ source .env

$ swift build --configuration release

$ codesign --options runtime --sign "$CODESIGN_IDENTITY" --timestamp .build/release/wakeful

$ ditto -c -k --keepParent .build/release/wakeful wakeful.zip

$ xcrun notarytool submit wakeful.zip --keychain-profile "wakeful-notarytool" --wait

$ rm wakeful.zip

About

Prevent automatic sleep and gracefully handle manual sleep by sending SIGINT to child processes

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages