thiagowfx's avatar

¬ just serendipity 🍀 (not just serendipity)

Amphetamine: Keep awake

• 352 words • 2 min • updated

⚠️ This post is over one year old. It may no longer be up to date or relevant. Opinions may have changed.

Amphetamine:

The most awesome keep-awake app ever created for macOS. Amphetamine can keep your Mac, and optionally its display(s), awake through a super simple on/off switch, or automatically through easy-to-configure Triggers. Amphetamine is extremely powerful and includes advanced features for those who need them, yet remains intuitive and easy-to-use for those who don’t need all of the bells and whistles.

It’s like Caffeine (or one of its dozen clones), but better.

Here’s how I use it:

  • on my personal laptop, whenever I am streaming a movie or a TV show (e.g. via jellyfin, so that it doesn’t cut off the streaming in the middle

  • on my work computer, as soon as I start the work day, so that the VPN stays connected for the whole day, as well as my SSH sessions

Upon launching it a system tray icon appears. A left-click opens up its contextual menu, exposing lots of knobs and details. A right-click toggles it on / off.

I configure the toggle so that it stays awake for a default of 4 hours for my personal laptop, and 8-10 hours for my work computer (=the duration of an usual work day).

If you don’t specify a limit then it stays awake indefinitely, which is counterproductive: (i) spending more energy and battery than necessary and (ii) from an operational security perspective, it should ideally self-lock at some point, in case you forget to do so.

I just care about keeping internet and sessions connectivity alive, but it’s also possible to configure it to keep the display on.

For bonus productivity, configure it to always launch at login, so that activating it is just one (right) click away.

Apparently I activated it more than 180 times in my personal laptop, effectively keeping it awake for more than 24 days. At work, more than 250 sessions for more than 8 days1.

When writing this post, I just learned that I can activate it via AppleScript:

shell
% osascript -e 'tell application "Amphetamine" to start new session'

Now I can augment my prodaccess script with that.


  1. There is definitely something odd with these numbers. ↩︎