Jump to content

Coffee Coffee — Prevent your computer from going to sleep


vitor

Recommended Posts

When reporting issues, please include your exact installed versions of:

  • The Workflow.
  • Alfred.
  • macOS.

In addition to:

  • The debugger output. Perform the failing action, click “Copy” on the top right and paste it here.
  • Details on what you did, what happened, and what you expected to happen. A short video of the steps with the debugger open may help to find the problem faster.

Thank you. Accurate and thorough information is crucial for a proper diagnosis which allows me to help you better.

Link to comment
  • 4 months later...

Well, it doesn't use caffeine. Caffeine is a third-party application, and Caffeinate is native to 10.8+. There are other workflows that control Caffeine (I wrote one, and there are others as well. I think if you search, or there might be a link in my signature).

 

Honestly, I prefer Caffeinate because you needn't install any other software, and the less you can have on your computer, the better. (Also, my menu bar is already way too cluttered). Alfred provides a great interface for Caffeinate itself, which exists through this workflow and one that I made. Check out this one and mine, and, if you like them, then just uninstall Caffeine. Otherwise, look for one of the Caffeine workflows.

 

If you really, really, really want the Caffeine icon in the menu when using Caffeinate, then you'll probably have to code your own version that interfaces with Caffeinate, but that seems to be way more trouble than it's worth.

Link to comment
  • 2 years later...
  • 1 month later...

================================================

EDIT:

This post is wrong and I am dumb. The workflow works great.

================================================

 

This workflow doesn't seem to work for me.

 

The toggle in the Alfred results correctly changes when I turn this on/off, but it never actually effects my machine -- my mac still always goes to sleep regardless of whatever I set CoffeeCoffee to.

 

However, the Caffeinate Control workflow does work for me.

 

Here's what's really weird: 

  • if I have both workflows enabled, and I turn on Caffeinate Control, then the menu results for both Caffeinate Control and CoffeeCoffee will show that caffeinate has been turned on, and my mac will not go to sleep, as expected
  • if I have both workflows enabled, and I turn on CoffeeCoffee, then the menu results for both CoffeeCoffee and Caffeinate Control will show that caffeinate has been turned on, however my mac will still go to sleep 

So basically CoffeeCoffee looks like it's working (according to Alfred's menu results), but my mac still goes to sleep. On the other hand, Caffeinate Control both looks like it's working and also actually works. 

 

This doesn't really make sense to me at all lol

 

fwiw I'm on OS X 10.11.6 running the latest version of Alfred 3

Edited by miketheburrito
Link to comment

Updates.

  • Accept relative times. Should understand most variations, like 2 hrs, 40 minutes, 500s.
  • Action it with ⌥ to also prevent display from going to sleep.
  • Updated to latest OneUpdater.
  • New icons.

To update, download the latest version (same URL) or wait a few days (15 or less) and it’ll prompt you to on next usage, since it uses OneUpdater.

Link to comment
  • 11 months later...

Update.


Made some changes and fixes for it to run smoother. But in particular, what you might notice:

  • Turning off will now only terminate itself. This means that if you have other caffeinate processes running from other entities, those will be left alone.
  • When running again to turn it off, if you previously picked a time frame it will tell you when it’s predicted to auto-turn off. Keep in mind that due to the nature of how Apple’s own caffeinate measures its timeout, the time might be somewhat off.
  • The shortcut for preventing the display from going to sleep changed from ⌥ to ⌘. 

TzHicQ9.png
To update, download the latest version (same URL) or wait a few days and it’ll prompt you to on next usage, since it uses OneUpdater.

Edited by vitor
Link to comment
  • vitor changed the title to Coffee Coffee — Prevent your computer from going to sleep
  • 3 weeks later...

Sometimes I run this workflow without a set time but want to be reminded it is running.

 

Can I take a page out of the Yak Saver workflow and add a delay set for a specific time coming off the script filter and then have it toss up a notification? And if I did this, these changes would get overwritten on the next update, correct? This wouldn't fall under the user changes that get retained during an update?

 

Thanks as always for your time.

Link to comment
2 hours ago, sepulchra said:

Can I take a page out of the Yak Saver workflow and add a delay set for a specific time coming off the script filter and then have it toss up a notification? And if I did this, these changes would get overwritten on the next update, correct?

 

Yes to both.

 

If you want to stop updates, change the bundle identifier.

Link to comment
  • 4 months later...
  • 2 months later...

It seems that the Coffee workflow does not have any effect on Sonoma 14.1.1.

This Mac upgraded from Sonoma 14.1 last week, I am pretty sure Coffee kept the machine awake then.

For what it is worth I copy the debug data below.

As far as I can tell the workflow runs just fine, so perhaps Apple changed something in the last Sonoma release?

 

[22:11:24.636] Coffee Coffee[Script Filter] Queuing argument ''
[22:11:24.713] Coffee Coffee[Script Filter] Script with argv '' finished
[22:11:24.719] Coffee Coffee[Script Filter] {"rerun":0.5,"items":[{"title":"Turn On","subtitle":"Keep awake indefinitely","arg":"coffeecoffee_process_anchor on","icon":{"path":"icon_alt.png"}}]}
[22:11:24.855] Coffee Coffee[Script Filter] Processing complete
[22:11:24.861] Coffee Coffee[Script Filter] Passing output 'coffeecoffee_process_anchor on' to Arg and Vars
[22:11:24.863] Coffee Coffee[Arg and Vars] Processing complete
[22:11:24.864] Coffee Coffee[Arg and Vars] Passing output 'coffeecoffee_process_anchor on' to Junction
[22:11:24.865] Coffee Coffee[Junction] Processing complete
[22:11:24.866] Coffee Coffee[Junction] Passing output 'coffeecoffee_process_anchor on' to Run Script

 

Edited by manusz
Link to comment

When I issue Coffee (without parameters) in Alfred, walk away and return after 20 minutes, the screen is dark.

 

Now, when I touch the mouse, I am greeted by the Lock Screen and I have to provide my password or fingerprint to log in.

 

I see this on 2 M1 Machines.

Link to comment

I did not expect to see the Lock Screen when I woke up the screen.

That may be caused by the System Setting Require password after screen saver begins or display is turned off which I have set to Immediately.

 

From now on I will use the ⌘↩ key combo as that triggers the action I expected.

 

Thank you for your help!

 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...