Re:Show HN: Prevent your computer sleeping with just a webpage
by eigenvalue on Friday April 22, 2022 @04:43PM
(#31127819)
If you absolutely want to prevent a Mac from not only going to sleep, but restarting for any reason at all (say, to install important security updates, which are usually forced on the user with no choice), there aren't many good ways. The only thing I've found that really works reliably is to open MS Word, create a new document, add some random characters to it, and then leave without ever saving. Word will prevent the OS from doing anything that would cause you to lose that unsaved document. I'm sure the MS engineers dug deep into the kernel to find something foolproof. It's a bit annoying that Apple doesn't give you a little switch like that which you could toggle to say "don't restart for any reason at all".
[ Parent
| on HN ]
Re:Show HN: Prevent your computer sleeping with just a webpage
by huseyinkeles on Friday April 22, 2022 @05:44PM
(#31128570)
Same thing happens with JetBrains IDEs. I usually set my Mac to update after midnight but usually find it got stuck with the IDE asking “are you sure you want to quit?”
Re:Show HN: Prevent your computer sleeping with just a webpage
by keyle on Friday April 22, 2022 @06:42PM
(#31129123)
"This application prevented shutdown..."
Re:Show HN: Prevent your computer sleeping with just a webpage
by vulcan01 on Friday April 22, 2022 @05:01PM
(#31128083)
Amphetamine[0] works pretty well for me. They also have an extension (a kext, I think) that gives it more reliability. I don't know how reliable it is without that extension though.
[0]: https://apps.apple.com/us/app/amphetamine/id937984704?mt=12
Re:Show HN: Prevent your computer sleeping with just a webpage
by adamomada on Friday April 22, 2022 @05:55PM
(#31128691)
I've been using the more bare-bones KeepingYouAwake[0] just because I came across Caffeine first and this was suggested as the continuation of that simple utility. The icon makes it obvious whether it is enabled or disabled
Edit: I see now that Amphetamine has the option of a similar-looking icon to make it more obvious whether it is enabled or not
[0] https://github.com/newmarcel/KeepingYouAwake
(My first HN comment, via Orion Browser)
Re:Show HN: Prevent your computer sleeping with just a webpage
by windexh8er on Friday April 22, 2022 @11:52PM
(#31131220)
I used Caffeine for years and never really thought about it much, it's always been useful. But I installed Amphetamine lately on a new MBP and I've used the schedule and countdown modes multiple times now. It's a great tool and the added functionality is useful.
Re:Show HN: Prevent your computer sleeping with just a webpage
by ecf on Sunday April 24, 2022 @02:48PM
(#31146977)
> (My first HN comment, via Orion Browser)
Did you manually type that out or is this some “Sent from my iPhone”-esque growth-hacking strategy by the Orion team?
Re:Show HN: Prevent your computer sleeping with just a webpage
by freediver on Sunday April 24, 2022 @03:20PM
(#31147305)
Not from Orion, would be pretty invasive if it was (Orion dev here).
Re:Show HN: Prevent your computer sleeping with just a webpage
by adamomada on Tuesday April 26, 2022 @06:02PM
(#31173724)
Thanks for clearing that up. I happened to get your beta invite the same day and was a bit over excited about it, I guess
Thanks for working on Orion!
Re:Show HN: Prevent your computer sleeping with just a webpage
by buzzert on Friday April 22, 2022 @10:34PM
(#31130856)
And it does specifically need to be a third party application like Word. Built in apps like TextEdit support state restoration, so it will probably still reboot if you have unsaved content in TextEdit.
Re:Show HN: Prevent your computer sleeping with just a webpage
by simonjgreen on Friday April 22, 2022 @07:02PM
(#31129309)
The windows equivalent to this is an unsaved text file in notepad.
Re:Show HN: Prevent your computer sleeping with just a webpage
by gsoto on Friday April 22, 2022 @07:17PM
(#31129432)
PowerToys[0] has a utility for that. It stays in the corner of the taskbar.
Re:Show HN: Prevent your computer sleeping with just a webpage
by hnburnsy on Friday April 22, 2022 @09:56PM
(#31130654)
This is good for users who don't have admin rights but want to keep online for employee monitoring purposes.
Re:Show HN: Prevent your computer sleeping with just a webpage
by evandale on Friday April 22, 2022 @08:34PM
(#31130061)
This burns me at least twice a week. I'll go to bed and 15 mins later I'll notice my computer is still on... it's always notepad.
Re:Show HN: Prevent your computer sleeping with just a webpage
by anamexis on Friday April 22, 2022 @10:59PM
(#31130962)
An open iTerm terminal or Emacs window also fulfill this function for me (usually unintentionally)
Re:Show HN: Prevent your computer sleeping with just a webpage
by StrangeSound on Friday April 22, 2022 @04:57PM
(#31128009)
You can also do this in the browser, using the beforeunload event
https://developer.mozilla.org/en-US/docs/Web/API/Window/befo...
Re:Show HN: Prevent your computer sleeping with just a webpage
by jedberg on Friday April 22, 2022 @07:19PM
(#31129452)
I have the opposite problem. I want it to restart overnight and come back to find it blocked by my terminal being open.
Incidentally iTerm will block a restart too, and is useful to have open all the time anyway!
Re:Show HN: Prevent your computer sleeping with just a webpage
by Destiner on Friday April 22, 2022 @05:56PM
(#31128706)
I’ve been using 10 hour videos of black screen with success.
Re:Show HN: Prevent your computer sleeping with just a webpage
by bobbylarrybobby on Saturday April 23, 2022 @03:30PM
(#31137615)
Open a vim session in Terminal. Active processes prevent Terminal from quitting which prevents shutdown from proceeding