Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure the machine never sleeps...ever #690

Closed
wants to merge 1 commit into from

Conversation

cameronaaron
Copy link
Contributor

I noticed even with amphetamine my machine would randomly decide to sleep and it would cause the server to break so I took a stab at making it so even if there was a nuclear war this thing would be a roach and not die

@mehapps
Copy link

mehapps commented Sep 2, 2024

I think you could safely change the watchdog interval to something like 30 seconds or even a minute? I'm sure there's probably a good reason you did 5 seconds but AFAIK the lowest sleep interval is a minute of inactivity?

@cameronaaron
Copy link
Contributor Author

I might change it to 30 largely the thing I really want to prevent is it detecting the laptop is closed if it crashes during that time

@mehapps
Copy link

mehapps commented Sep 2, 2024

I see, would it maybe be safer to use pmset to disable sleep entirely? That way caffeinate doesn't have to be a running subprocess, and it could just be reverted if u disable the setting in bluebubbles

@cameronaaron
Copy link
Contributor Author

I was thinking about that actually...That honestly might be the way to go...instead of caffinate we just kill sleep then revert when the box is unchecked I think @zlshames would be more in favor of that as well

@mehapps
Copy link

mehapps commented Sep 2, 2024

FWIW, these commands should do it (from OpenCore's Fixing Sleep guide + my own experience)

sudo pmset -a sleep 0
sudo pmset autopoweroff 0
sudo pmset powernap 0
sudo pmset standby 0
sudo pmset tcpkeepalive 0
sudo pmset proximitywake 0
sudo pmset -a disablesleep 1

Copy link
Member

@zlshames zlshames left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I don't love the idea of preventing the display from sleeping. Some people might want to let their display turn off, cuz everything else will remain working. Also, what's the point of using the Run Indefinitely flag? Doesn't it already do that by default? Or is the default a lower limit?

@zlshames
Copy link
Member

zlshames commented Nov 9, 2024

FWIW, these commands should do it (from OpenCore's Fixing Sleep guide + my own experience)

sudo pmset -a sleep 0
sudo pmset autopoweroff 0
sudo pmset powernap 0
sudo pmset standby 0
sudo pmset tcpkeepalive 0
sudo pmset proximitywake 0
sudo pmset -a disablesleep 1

The server can't run sudo commands

@cameronaaron
Copy link
Contributor Author

It's been a min since I looked at this but I think I was hoping to essentially cut out the need for amphetamine especially on a laptop but since then focus on tricking it into thinking it's in clam shell.

@mehapps
Copy link

mehapps commented Nov 9, 2024

FWIW, these commands should do it (from OpenCore's Fixing Sleep guide + my own experience)

sudo pmset -a sleep 0
sudo pmset autopoweroff 0
sudo pmset powernap 0
sudo pmset standby 0
sudo pmset tcpkeepalive 0
sudo pmset proximitywake 0
sudo pmset -a disablesleep 1

The server can't run sudo commands

Ah I see, is there any way to escalate just when the box is clicked? Like when the box is clicked ask for sudo password and then run those commands? Those are just one time things, so you would only need the password when it's checked or unchecked.

@zlshames
Copy link
Member

FWIW, these commands should do it (from OpenCore's Fixing Sleep guide + my own experience)

sudo pmset -a sleep 0
sudo pmset autopoweroff 0
sudo pmset powernap 0
sudo pmset standby 0
sudo pmset tcpkeepalive 0
sudo pmset proximitywake 0
sudo pmset -a disablesleep 1

The server can't run sudo commands

Ah I see, is there any way to escalate just when the box is clicked? Like when the box is clicked ask for sudo password and then run those commands? Those are just one time things, so you would only need the password when it's checked or unchecked.

I'd need to check. Unsure if it hinges on the app being notarized or just signed. Research required...

@mehapps
Copy link

mehapps commented Nov 11, 2024

Sounds good, afaik it doesn't (from my experience from using python with the elevate module)

@cameronaaron
Copy link
Contributor Author

closing will be superseded by #706

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants