From 8acaa9223f0da805bbfc42c6900b7dae515b76d3 Mon Sep 17 00:00:00 2001 From: kriwang Date: Wed, 24 Oct 2018 09:37:53 -0400 Subject: [PATCH 1/2] Initial commit added os_x folder --- _commands/os_x/caffeinate.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 _commands/os_x/caffeinate.md diff --git a/_commands/os_x/caffeinate.md b/_commands/os_x/caffeinate.md new file mode 100644 index 000000000..e69de29bb From 2a0cac7ae66dff27570e8c5acb9915f46b89cf9f Mon Sep 17 00:00:00 2001 From: kriwang Date: Wed, 24 Oct 2018 12:20:25 -0400 Subject: [PATCH 2/2] Added caffeinate description and all commands. --- _commands/os_x/caffeinate.md | 82 ++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) diff --git a/_commands/os_x/caffeinate.md b/_commands/os_x/caffeinate.md index e69de29bb..84471143e 100644 --- a/_commands/os_x/caffeinate.md +++ b/_commands/os_x/caffeinate.md @@ -0,0 +1,82 @@ +--- +--- + +caffeinate +--- +`caffeinate` is a mac terminal command that prevents your mac going to sleep even while not in use and regardless of sleep settings. + +~~~ bash +$ caffeinate +^C +$ +~~~ + + + +### Useful Options / Examples + +### `caffeinate -d` +Create an assertion to prevent the display from sleeping. + +### `-i` +Create an assertion to prevent the system from idle sleeping. + + +### `-m` +Create an assertion to prevent the disk from idle sleeping. + +### `-s` +Prevents the whole system from going to sleep when connected to power. + +#### Example command +Can use any of -d -i -m -s depending on needs. + +Prevent display from sleeping. + +~~~ bash +$ caffeinate -d +~~~ + +While firefox is open prevent display from sleeping. + +~~~ bash +$ caffeinate -d /Applications/Firefox.app +~~~ + +Prevents sleep until terminal command is finished running. + +~~~ bash +$ caffeinate -i good_script.sh +~~~ + +### `caffeinate -t` +Specifies the time in seconds for how the the caffeinate command should be valid. Prevents sleep for specified number of seconds. + +#### Example command +Keep your machine awake for 1 hour. 3600 seconds = 1 hour + +~~~ bash +$ caffeinate -t 3600 +~~~ + +### `caffeinate -u` +Replicates current user activity or user is active e.g. as if someone were moving the mouse.If the display is off, this option turns the display on and prevents the display from going + into idle sleep. If a timeout is not specified with '-t' option, then this assertion is + default of 5 second timeout. + +#### Example command +Wake up your mac for 2 second. Potentially useful if you ssh into your machine to wake up your machine. + +~~~ bash +$ caffeinate -u -t 2 +~~~ + +### `caffeinate -w` +Waits for the process with the specified pid to exit. Once the the process exits, the assertion is also released. + +#### Example command +Prevents display from sleeping while process 12345 is still running. + +~~~ bash +$ caffeinate -d -w 12345 +~~~ \ No newline at end of file