27.12.2020

Download Caffeine Mac App

Disable Sleep on a Mac from the Command Line. To sleep prevention much like the popular Caffeine app. Can download Caffeine from the Mac App Store. Caffeine for Mac is a simple app designed to do one thing and one thing only. When active, Caffeine will prevent your computer from dimming the screen, enabling screensavers, or hibernating. This function is useful in a variety of situations, and Caffeine's simplicity makes it ideal for users that need to keep their computer as.

Prevent your computer from going to sleep

If you have problems with your PC locking or going to sleep, caffeine will keep it awake. It works by simulating a keypress once every 59 seconds, so your machine thinks you're still working at the keyboard, so won't lock the screen or activate the screensaver.

The icon is shown above - it's the leftmost one in the task tray, and this is all you see. Double-clicking the icon empties the coffee pot (that's what the icon is) and temporarily disables the program. Double-clicking it again refills the pot, and will keep your machine awake.

By default the app starts enabled, and works every 59 seconds. There are some command line switches you can use to alter this behaviour:

  • xx - where xx is a number which sets the number of seconds between simulated keypresses. This must be the first text on the commandline
  • -startoff - application starts disabled.
  • -exitafter:xx - application will terminate after xx minutes
  • -activefor:xx - application will become inactive after xx minutes
  • -inactivefor:xx - application will become active after xx minutes
  • -appexit - terminates current running instance of application
  • -appon - makes the current running instance of the application active
  • -appoff - makes the current running instance of the application inactive
  • -apptoggle - toggles the running state of the current running instance of the application
  • -apptoggleshowdlg - toggles the running state, and shows dialog
  • -replace - closes the current running instance, replacing it
  • -noicon - does not show a task tray icon
  • -useshift - simulate the shift key instead of F15
  • -showdlg - shows a dialog indicating whether caffeine is active
  • -ontaskbar - show a task bar button (use with -showdlg)
  • -allowss - prevent sleep, but allow the screensaver to start
  • -key:xx - simulate using virtual key code xx
    Note: the codes on the linked page are in Hex, convert them to decimal for use with this parameter
  • -keypress - simulate a full key press, not just a key up event
  • -oldicons - use more colourful tray icons
  • -darkicons - use icons which work better for dark-on-light colour schemes
  • -watchwindow:xx - active only when a window with xx in the title is found
  • -activehours:..xxxxxxxx.. - put 24 . or x characters - which indicate from hour 0 to hour 23 of the day. Caffeine will be active only in hours with an x

Compatibility

Caffeine works by simulating an F15 key up event every 59 seconds. Of all the key presses available, F15 is probably the least intrusive, and least likely to interfere with your work.

However, Caffeine might interfere with some apps:

  • PowerPoint uses the F15 keypress to pause video in a slide
  • Google Docs/Sheets
  • Smartsheet
  • Terminal emulation, e.g. Putty

If you think any of these might cause you a problem, set the -useshift command line parameter.

Video

Caffeine user humancar2n has put together a short YouTube video showing how the app works.

Mac version

Do you need this functionality on your Mac? Lighthead Software have written a separate app, also named Caffeine, which can help you out.

Versions

v1.90 - October 2020

-darkicons command line option added

-activehours command line option added

Tooltip replaced with a new one which works more reliably

Menu appearance updated

v1.81 - May 2020

Bug with the -watchwindow command line fixed

v1.80 - January 2020

v1.64 - September 2017

Option for old icons added, 'cos not everyone likes the new ones

v1.63 - February 2017

Icons updated slightly to show up better on a white background.

v1.62 - April 2016

New icons, designed by Rubén Gómez Radioboy

v1.61 - October 2015

Fixed bug with app not going active/inactive correctly when a timed period elapsed

v1.60 - July 2013

New command line options:

  • -allowss
  • -ontaskbar
  • -apptoggleshowdlg
  • -key:xx
  • -keypress

Added menu items to go Active/Inactive

Type in About box corrected

-apptoggle will re-show the dialog if it was originally shown

Caffeine For Mac

v1.50 - November 2010

New command line options:

  • -inactivefor
  • -showdlg
  • -apptoggle

Simulated keypress changed from right context menu key to F15 as this is likely to be even less intrusive.

v1.40 - July 2009

New command line options:

Caffeine App Mac Os

  • -replace
  • -noicon
  • -useshift

Hovering over the tray icon now shows the status of the app

v1.35 - May 2009 seagate backup software mac download

Simulated keypress changed from shift to the right context menu key (at the suggestion of Kevin Kleinfelter) as this is likely to be less intrusive.

v1.30 - February 2009

Command line switches added to terminate the app after x minutes, disable the app after x minutes, and enable or disable the currently running instance of the app

v1.20 - March 2008

How to find the installed apps in mac. Command line switches added to set the interval and to start disabled

Download Caffeine (x86 and x64)

Accessibility Permission Prompt

Several users have reported an issue where Caffeine continues to prompt for macOS accessibility permission even after it has been granted.
This is caused by an internal inconsistency with macOS on systems where an older version of Caffeine has previously been installed.
If you are experiencing this issue, please follow the steps outlined in the Support Center to repair the macOS permission database.

Support Center
Download Now
Version 1.1.3, macOS Yosemite or Later
Compatible with macOS Catalina!
Release Notes · View Source

Caffeine is a tiny program that puts an icon in the right side of your menu bar. Click it to prevent your Mac from automatically going to sleep, dimming the screen or starting screen savers. Click it again to go back. Right-click (or ⌘-click) the icon to show the menu.

Originally developed by Tomas Franzén of Lighthead Software in 2006, Caffeine is a well known and loved utility for many Mac users, and its simplicity has allowed it to continue working perfectly long after active development ceased. Create launch agent to open mac app at login.

Unfortunately for many users, Caffeine began experiencing problems with the release of macOS Mojave, due to the enhanced privacy controls introduced which prevent Caffeine from functioning correctly.

Download Caffeine Mac App Download

We reached out to Tomas to inquire if we could continue development of Caffeine, as we believe it fits nicely with our vision of software that is simple, flexible and powerful.

Download Caffeine App Mac

Tomas has graciously provided the source code under an open source license, allowing us to continue developing Caffeine where he left off.

Genuinely useful, lean and simple to use. It even has a cute icon.

Download Caffeine Mac Apple

MacFormat Magazine