

To stop caffeinate and return to normal sleep behavior, you can hit “Control+C” to quit out of caffeinate as it’s running like this, or you can kill it with the ‘killall caffeinate’ command if desired.

To temporarily disable sleep functions regardless of sleep settings, run the following command from Terminal in Mac OS X:Īt the core basic function of the command, caffeinate is all that’s necessary, and while caffeinate is active sleep will be prevented until it’s no longer running. How to Disable Sleep with the ‘caffeinate’ Command in Mac OS X A few useful examples are discussed below. or x characters - which indicate from hour 0 to hour 23 of the day.At it’s most simple usage, caffeinate just prevents sleep entirely, but you can modify the command with various flags to prevent just the display from sleeping, provide a specified time to avoid sleeping, prevent sleeping while a command runs, and more. -watchwindow:xx - active only when a window with xx in the title is found.-darkicons - use icons which work better for dark-on-light colour schemes.-oldicons - use more colourful tray icons.-keypress - simulate a full key press, not just a key up event.Note: the codes on the linked page are in Hex, convert them to decimal for use with this parameter -key:xx - simulate using virtual key code xx.-allowss - prevent sleep, but allow the screensaver to start.

-ontaskbar - show a task bar button (use with -showdlg).-showdlg - shows a dialog indicating whether caffeine is active.-useshift - simulate the shift key instead of F15.-noicon - does not show a task tray icon.-replace - closes the current running instance, replacing it.-apptoggleshowdlg - toggles the running state, and shows dialog.-apptoggle - toggles the running state of the current running instance of the application.-appoff - makes the current running instance of the application inactive.-appon - makes the current running instance of the application active.-appexit - terminates current running instance of application.-inactivefor:xx - application will become active after xx minutes.-activefor:xx - application will become inactive after xx minutes.-exitafter:xx - application will terminate after xx minutes.-startoff - application starts disabled.This must be the first text on the commandline xx - where xx is a number which sets the number of seconds between simulated keypresses.There are some command line switches you can use to alter this behaviour: By default the app starts enabled, and works every 59 seconds.
