Lungo

Prevent your Mac from going to sleep

Lungo prevents your Mac from falling asleep and your screen from dimming.


Frequently Asked Questions

I have a feature request, bug report, or some feedback

Send it here.

The app does not show up in the menu bar

macOS hides menu bar apps when there is no space left in the menu bar. This is a common problem on MacBooks with a notch. Try quitting some menu bar apps to free up space. If this does not solve it, try quitting Bartender if you have it installed.

Lungo did not keep my computer awake

  • If you have the “Allow display to sleep while keeping computer awake” setting enabled, the computer is still awake even if it looks like it’s sleeping because the screen is off.
  • If you have the “Pause while screen is locked” setting enabled, you may have locked the screen before leaving it, which would cause Lungo to not keep your computer awake.
  • If you have the “Deactive when switching to battery” setting enabled and you disconnect the power adapter, Lungo would not keep your computer awake. You might have accidentally unplugged it or there might have been a power failure.
  • If you have set a sleep schedule in “System Preferences › Battery › Schedule”, it will take priority over Lungo. This is out of Lungo’s control.
  • If you have set the computer to log out after a certain amount of time in “System Preferences › Security & Privacy › Advanced”, it will take priority over Lungo. This is out of Lungo’s control.
  • If you see apps open again when you wake up your computer, it means your computer was restarted for some reason. Lungo cannot keep your computer from restarting. Some common reasons it may have restarted are a power outage, macOS crash, or scheduled shutdown/restart (in Battery system settings).

Some things you could try:

Where can I find the changelog?

Go here and click “Version History”.

Does it work when the lid is closed?

No, that’s not allowed for apps on the App Store, for good reasons. Imagine you activate it while your computer is doing a heavy task and then put the laptop in your bag. Your laptop could easily overheat.

However, if you want this, there are some solutions here.

Does Lungo keep my Mac awake even if there is a scheduled sleep?

If you have set a sleep schedule in “System Preferences › Battery › Schedule”, it will take priority over Lungo. This is out of Lungo’s control.

Can I left-click the icon to toggle it like with Caffeine?

Yes, choose “Activate on Left-click” in the settings.

Can Lungo automatically activate when I open a certain app?

I don’t have any immediate plans to support this. It’s a lot of work to implement and few people have requested it.

However, you can achieve it using the Shortcuts app. Create a new shortcut with the “Set Enabled State” action provided by Lungo. Shortcuts on iOS has automations, which lets you run a shortcut when a certain app opens. macOS does not yet have automations. I’m confident it will come with macOS 14. In the meantime, you can use the Shortery app to run a shortcut when a certain app opens.

You could also use BetterTouchTool or Keyboard Maestro instead of Shortery.

Can I use a custom duration?

Lungo comes with a set of commonly used durations, which should be enough for most users. People love Lungo for its simplicity. Lungo has tens of thousands of users and only a few people have requested a custom duration. However, power users can take advantage of the Shortcuts app to use custom durations. Drag the “Set Enabled State” Lungo action into the shortcut editor in the Shortcuts app. Click “Show more” and then choose a custom duration. You can pin the shortcut workflow to the menu bar for easy access or set a global keyboard shortcut for it.

How can I export, import, sync, or back up the settings?

See this guide.

Can you localize the app into my language?

I don’t have any immediate plans to localize the app.

How is it different from Amphetamine?

Amphetamine has lots of features. Most of which I would never use. It ships with a myriad of menu bar icons to choose from, but none that looks good. With Lungo, I wanted a focused and simple app with great defaults.

Scripting

You can control Lungo using anything that supports opening a URL with a custom scheme.

Lungo also comes with support for Shortcuts.

Tip: You can run shortcuts from the command-line.

Integrations

Custom URL scheme

For example, to activate Lungo for 10 minutes, run this terminal command:

open --background 'lungo:activate?minutes=10'

Commands

  • activate
  • deactivate
  • toggle

The activate and toggle commands support the parameters hours and minutes, which can be used together or individually. If you don’t specify a duration, it will use the default duration you have set in Lungo.

(Use lungo-cli if you need to get the active state)

Examples

Shell
# Deactivate Lungo
open --background 'lungo:deactivate'

# Activate Lungo for 1 hour and 30 minutes
open --background 'lungo:activate?hours=1&minutes=30'

# Activate Lungo for 1 hour and 30 minutes (Alternative)
open --background 'lungo:activate?hours=1.5'

# Toggle Lungo with the default duration
open --background 'lungo:toggle'

# Toggle Lungo for 10 minutes
open --background 'lungo:toggle?minutes=10'
Node.js
import {execFileSync} from 'node:child_process';

execFileSync('open', ['--background', 'lungo:toggle']);
Swift
import Cocoa

let command = "lungo:toggle"

let configuration = NSWorkspace.OpenConfiguration()
configuration.activates = false
NSWorkspace.shared.open(URL(string: command)!, configuration: configuration)
AppleScript
do shell script "open --background 'lungo:toggle'"
Python
import subprocess

subprocess.run(['open', '--background', 'lungo:toggle'])

Older Versions

These are free for everyone but they will not run on newer macOS versions.