5 ms·
On macOS just run `caffeinate` from the terminal (or `man caffeinate` for more info on the options). I know OP copped to “various Caffeine/Amphetamine apps” bu
by velcrovan 5y ago
On macOS just run `caffeinate` from the terminal (or `man caffeinate` for more info on the options).
I know OP copped to “various Caffeine/Amphetamine apps” but said they're often “overkill”. In this case I think a system-provided command is less overkill than a web page that either uses a browser API or plays an empty video.
- reidjs 5y agoFor some reason caffeinate doesn't keep my computer awake (newish macbook pro)
- tomstuart 5y agoYou might need `caffeinate -d` to prevent the display from sleeping.
- jen729w 5y agoWhile this does work, I agree with OP here. The man page for caffeinate says that it prevents system sleep and, as far as I can tell, it does not do that on my M1 MBP using Monterey. I do a `caffeinate -d` and then throw my mouse to a hot corner to activate the screen saver.
- Tao331 5y agoI've been using a Zoom meeting of just myself, locked, audio and camera off. Worked like a charm when I needed to discharge a swelling battery.
- jedberg 5y ago> Worked like a charm when I needed to discharge a swelling battery. I think you buried the lede there...
- Tao331 5y agoIt just happens, apparently. Here's a decent rundown: https://www.ifixit.com/Wiki/What_to_do_with_a_swollen_battery#Section_What_happens_when_a_battery_gets_swollen https://www.ifixit.com/Wiki/What_to_do_with_a_swollen_batter...
- SteveDR 5y agoDoes this stay on indefinitely? I don’t like using the command line to enable settings that I only need for an hour or so. I often forget to turn them off. I like that OP’s site turns keeps my machine awake while it’s open, and I can just close the tab when I want my machine to behave normally.
- latexr 5y ago> Does this stay on indefinitely? If you want. If you don’t, use the `-t` flag for it to turn off after a set number of seconds or `-w` to do so after a specific process ends.
- lambdaba 5y agoThe more unixy way is probably `timeout <seconds> caffeinate` :)
- bajsejohannes 5y agoOr `caffeinate sleep <seconds>` which has the (only) added benefit that it comes pre-installed with MacOS
- lambdaba 5y agoYes but this got me thinking is it makes more sense to sleep after timing out the caffeination instead of keeping the sleep command running ;) that's enough Unix for the day haha
- jcynix 5y agoI regularly use "caffeinate rsync ..." to make sure that syncing finishes before the Macbook is allowed to sleep. So caffeinate just prevents sleeping until rsync terminates. You can tell caffeinate to watch for other processes too, to make sure a browser thread doing a download will finished uninterrupted before sleeping.
- deleted 5y ago[deleted]