Jump to content

Caffeine and Caffeinate Workflows (updated)


Recommended Posts

Posted

I had originally posted these workflows in a previous thread (Toggle Caffeine), but it had a bunch of different ones posted in it. I just updated both to have Alleyoop update functionality.

 

Caffeine Toggle — (Github Repo) (Download)

Just just "caf" to enable or disable caffeine. There are others with more functionality (i.e. activate for a number of minutes) if you want those. 

 

Caffeinate — (Github Repo) (Download)

Caffeinate is a native Mountain Lion utility that does the same thing as caffeine, but it has no menu icon. In this workflow, you can set the time in minutes. Here is the readme.md file from Github:

 

---

 

 

Requirements

OS X 10.8.x (Mountain Lion)

Description

In Mountain Lion (10.8), Apple introduced a utility called "Caffeinate" that basically replicates what the Caffeine utility (web | app storefrom Lighthead Software does.

Commands

Available Commands:

  • status — Shows whether caffeinate is active and returns the number of minutes if it is.
  • en — Enables caffeinate.
  • en "minutes" — Enables caffeinate for X minutes.
  • dis — Disables caffeinate."
Screenshots Caffeinate Activated

caffeinate-activated.PNG

Caffeinate Help

caffeinate-help-large-text.PNG

Caffeinate Launch

caffeinate-launch.PNG

Caffeinate Status

caffeinate-activated.PNG

  • 4 weeks later...
Posted

Hi,

I just installed this. When I type "caff en" it says "caffeine is already active". But it isn't. Status reports that it's currently active for an indefinite period. Basically it mistakenly thinks caffeine is active. I'm on 10.8, on a retina mbp. I'd love it if this workflow was working. 

Posted

@69wpm Caffeinate disables the screen saver and disables the computer from sleeping entirely. There are a few options when launching the command to determine exactly which things it prevents, but, if I remember right, the command that I've used disables everything.

 

@PhilosopherDog: can you open a terminal and run "ps aux|grep caffeinate|grep -v grep" after you've tried to enable the caffeinate workflow? That'll check to see if the process is running. If it isn't, then can you type "caffeinate -dsi" into the terminal? If that runs (it should prevent you from inputting anything else afterword until you hit ctrl+c to cancel the command), then try "caffeinate -dsi >/dev/null 2>&1 &" and then type "ps aux|grep caffeinate|grep -v grep" to make sure that the command is running. Let me know what happens so that I can troubleshoot the workflow.

  • 2 weeks later...
Posted (edited)

PhilosopherDog: can you open a terminal and run "ps aux|grep caffeinate|grep -v grep" after you've tried to enable the caffeinate workflow? That'll check to see if the process is running. If it isn't, then can you type "caffeinate -dsi" into the terminal? If that runs (it should prevent you from inputting anything else afterword until you hit ctrl+c to cancel the command), then try "caffeinate -dsi >/dev/null 2>&1 &" and then type "ps aux|grep caffeinate|grep -v grep" to make sure that the command is running. Let me know what happens so that I can troubleshoot the workflow.

 

Hey,

 

I seems like the same thing happened to me this morning when starting my computer, so here is what I got:

  • Tried to run ps aux|grep caffeinate|grep -v grep but nothing happened
  • Typed in caffeinate -dsi and I could not input anything until I hit ctrl + c, so that worked
  • Then I tried caffeinate -dsi >/dev/null 2>&1 & and the result was: 
    [1] 574 
  • Finally, I typed ps aux|grep caffeinate|grep -v grep and I got that result:
    Me          574   0.0  0.0  2455792   1248 s001  S     9:53AM   0:00.00 caffeinate -dsi 
I hope it helps!

I will try one more time if if it ever happens again, to see if I get the same results.

 

Cheers,

Xavier

Edited by erravid
  • 7 years later...
Posted

I use Catalina 10.15.4.

 

when i launch workflow debug reports:

 

NSAppleScriptErrorAppName = Caffeine;

    NSAppleScriptErrorBriefMessage = "Not authorized to send Apple events to Caffeine.";

    NSAppleScriptErrorMessage = "Not authorized to send Apple events to Caffeine.";

    NSAppleScriptErrorNumber = "-1743";

 

 

How can I fix it? Thanks

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...