Two ways to quickly keep your Mac from sleeping, dimming, or showing a screensaver

By , Feb 17, 2016

Twelve inch MacBook Space Grey closeup 001

When you’re away from your Mac for extended periods of time, depending on the settings you’ve set, it’s going to do one of four things: 1) fall asleep, 2) dim the display, 3) show a screensaver, or 4) do nothing at all.

If you like it when your Mac falls asleep when it’s convenient, and not when it’s not convenient, then chances are you don’t have your Mac set to never fall asleep, but rather you live with annoyingly having to tap a key or touch the track pad to wake it up when it idles for too long.

In this tutorial, we’ll show you two easy ways to temporarily keep your Mac from falling asleep, dimming the display, or showing a screensaver for as long as you it need to.

A temporary solution you can use all the time

If you don’t want to disable your Mac’s ability outright to fall asleep, dim the display, or show a screensaver in the event that you might need it to actually work some day, there are some great temporary options available that you can use to keep your Mac from falling asleep for as long as you need it to.

These options are great for anyone who usually likes their Mac to fall asleep when they walk away from their computer, but not so much when they know the Mac is going to be sitting idle for a long period of time and they want to keep track of something on the screen, such as the download progress of a large file that’s taking hours to complete, or the installation of a huge app that’s taking seemingly forever to install.

The two options available are either installing a free app by the name of Caffeine from the Mac App Store, or running a simple Terminal command via the Terminal app built into your OS X operating system. Caffeine is recommended for users who aren’t savvy with command line interfaces and want a graphical user interface instead, while the Terminal command is recommended for more advanced users because it requires memorizing some commands.

They’re advantageous over keeping your Mac awake 100% of the time via your System Preferences settings, because they’re more ideal for a temporary situation. The apps also make toggling the features on or off much more accessible than if you were to go and manually toggle the features on or off in System Preferences each and every time you wanted your Mac to stay awake or fall asleep again, so you’ll save yourself quite a few clicks and some time.

How to caffeinate your Mac with Caffeine

If you’ve opted to install the free Caffeine app from the Mac App Store, then you’re already on your way to caffeinating your Mac.

After installing the app and launching it, you’ll notice a new icon in your Menu Bar that looks like a coffee cup. You can click on the Menu Bar icon to enable Caffeine and you can click on it again to disable Caffeine. The icon appears black when the app is turned on and appears grayed out when the app is turned off.

You can also hold the Option (⌘) key and click on the icon to reveal the following menu:

caffeine app keep mac awake menu bar icon

The menu includes a few options, including launching the app’s built-in preferences and choosing an activation time limit after which the Caffeine app will be disabled automatically for you.

If you open the Caffeine preferences, this is what you’ll see:

caffeine app keep your mac awake preferences

There aren’t too many options here, but the options you do get include the following:

  • Automatically starting the Caffeine app every time you log into your Mac
  • Automatically activating Caffeine when you launch the app
  • Hiding or showing the preferences pane every time you open the Caffeine app
  • Selecting a default time duration that Caffeine will run for when you enable it

Using Caffeine is pretty straightforward – when the Menu Bar icon is black, your Mac will not fall asleep, dim its display, or show any screensavers, but when you turn Caffeine off, your Mac’s system preferences will take over as usual and your Mac will fall asleep, dim its display, and show screensavers at your set intervals.

Easy enough right? – Well okay command line-lovers, it’s your turn.

How to caffeinate your Mac with Terminal

Installing fancy software from the Mac App Store isn’t required; if you’re comfortable enough, you can just launch the Terminal app on your Mac and run a simple command. Believe it or not, the Caffeine app is cleverly named after a command that already exists in your Mac’s command line interface.

To caffeinate your Mac via the Terminal app on your Mac, you can follow these steps:

1) Launch the Terminal app on your Mac.

2) In the Terminal interface, type “caffeinate” without the quotes and then hit the Return key on your keyboard.

3) Congratulations, you are now in “Caffeinate” mode on your Mac.

Note: In this mode, your computer will not fall asleep, dim its display, or display a screensaver, and it won’t do so again until you end the caffeinated command.

To end the Caffeinate command, all you need to do is press Control + C on your keyboard while Terminal is open.

The command demonstrated above enables the Caffeinate mode on your Mac for as long as you need until you disable it, but let’s say you wanted to enable Caffeinate mode for a certain period of time; is there a way to do that? Of course!

To key to making the Caffeinate mode on your Mac last for a specific duration of time is to add “-t [x amount of seconds]” to the command as you’re entering it into the Terminal app, as shown below:

In our example, pressing the Return key after the command above would turn Caffeinate mode on for 150,000 seconds. Now we can either wait the 150,000 seconds for Caffeinate to end automatically, as we specified, or we can still press the Control + C shortcut to end the command before the time is up as we did in our example above.


Keeping your Mac awake is a super easy step and you don’t even have to change your beloved System Preferences around to do it. You can either use a free Mac App Store app for the job, or you can enable the feature from the Terminal app that’s already on your Mac.

This feature is particularly useful for when you want to keep an eye on a download that might be taking a long time without your Mac falling asleep on you so you can keep an eye on the progress bar, and it might also be useful if you’re doing something like trying to draw a picture based off of an image you found on the internet without the screen going dark on you or showing a screensaver instead.

If you found this tutorial helpful, let us know in the comments below.

  • Share:
  • Follow:
  • MrDDify

    Guys there is a up to date caffeine clone that is called keepingyouawake and it’s totally free

  • Daniel Waske

    I currently rely on Amphetamine to keep my Mac from Sleeping. Is there any advantage of using Caffeine instead?

    • No. Caffeine was not updated in years and has some problems with new OS X versions like Yosemite and El Capitan.

    • Caffeine used to be the best. They haven’t updated in some time. Amphetamine is what I use and it’s got a lot more features then Caffeine.

  • Kubaton

    Anyone using Alfred (and paid for the Powerpack upgrade) can install the amazing Caffeinate Control workflow.