Jump to content

Caffeine and Caffeinate Workflows (updated)


Recommended Posts

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

Link to comment
  • 4 weeks later...

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

Link to comment
  • 2 weeks later...

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
Link to comment
  • 7 years later...

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

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