5 ms·
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 ar
by eigenvalue 4y ago
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".
- StrangeSound 4y agoYou can also do this in the browser, using the beforeunload event https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event https://developer.mozilla.org/en-US/docs/Web/API/Window/befo...
- vulcan01 4y agoAmphetamine[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 https://apps.apple.com/us/app/amphetamine/id937984704?mt=12
- adamomada 4y agoI'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 https://github.com/newmarcel/KeepingYouAwake (My first HN comment, via Orion Browser)
- ecf 4y ago> (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?
- windexh8er 4y agoI 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.
- huseyinkeles 4y agoSame 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?”
- keyle 4y ago"This application prevented shutdown..."
- Destiner 4y agoI’ve been using 10 hour videos of black screen with success.
- simonjgreen 4y agoThe windows equivalent to this is an unsaved text file in notepad.
- gsoto 4y agoPowerToys[0] has a utility for that. It stays in the corner of the taskbar. [0] https://github.com/microsoft/PowerToys https://github.com/microsoft/PowerToys
- hnburnsy 4y agoThis is good for users who don't have admin rights but want to keep online for employee monitoring purposes.
- evandale 4y agoThis 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.
- jedberg 4y agoI 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!
- deleted 4y ago[deleted]
- buzzert 4y agoAnd 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.
- anamexis 4y agoAn open iTerm terminal or Emacs window also fulfill this function for me (usually unintentionally)
- deleted 4y ago[deleted]
- lupire 4y agoWhy would Word do all that craziness instead of just saving a copy of the document like it did 20 years ago?
- bobbylarrybobby 4y agoOpen a vim session in Terminal. Active processes prevent Terminal from quitting which prevents shutdown from proceeding