Live data from Hacker News

Show HN: Prevent your computer sleeping with just a webpage

nosleep.page

21–30 of 137 posts

Re: Show HN: Prevent your computer sleeping with just a webpage

#21

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.

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

Re: Show HN: Prevent your computer sleeping with just a webpage

#22
So I like this and I'm trying it out, it seemingly works OK.

However, the GREEN background is very annoying. I don't need the whole webpage to be green for me to know it's on and working. I can't minimize the browser (firefox) because then it apparently doesn't work. So I'm left with a very big green screen sitting in the corner of my eye. Wondering too the effect of that in terms of screen color burnout (if that's even a thing anymore).

I would definitely recommend to tone down the color scheme. Stay away from green. Just go with grey and darker grey or black for your on/off schemes, including inside of the slider button.

My use case is that I have the "nosleep" computer on the side of my desk. It catches IM/chat messages (from Teams, etc.) and email (from Outlook). I don't like my primary development machine bothered by these notifications, but I do like having that machine "awake" and alert to chat/email notifications (and I can't (or shouldn't) change the default policies on that machine).

Re: Show HN: Prevent your computer sleeping with just a webpage

#23
My work resets my Mac sleep timer settings on reboot or update. This is very annoying for maintaining persistent connections to servers, such as my development machine. I wrote a simple Python script to move my mouse pointer by 1-5 pixels at random intervals. Works great, and it always looks like I’m online for prying eyes in Slack.

Re: Show HN: Prevent your computer sleeping with just a webpage

#24
post #16

Earlier quoted context omitted.

For some reason caffeinate doesn't keep my computer awake (newish macbook pro)

You might need `caffeinate -d` to prevent the display from sleeping.

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

Re: Show HN: Prevent your computer sleeping with just a webpage

#25

Earlier quoted context omitted.

I obviously missed the NoSleep.js at the end ... but then I wonder: what is then so special about this website?

It prevents your computer from sleeping with just a webpage. Why does it need to be more special than that?

I think karrussell is talking about the live demo linked from NoSleep.js' project page: https://richtr.github.io/NoSleep.js/example/

Re: Show HN: Prevent your computer sleeping with just a webpage

#26

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.

[deleted]

Re: Show HN: Prevent your computer sleeping with just a webpage

#28
post #16

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.

For some reason caffeinate doesn't keep my computer awake (newish macbook pro)

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

Re: Show HN: Prevent your computer sleeping with just a webpage

#29
That's pretty handy! I remember a coworker asking me for something similar years ago and me just making something on the fly in C++ (a glorified wrapper over "SetThreadExecutionState"): https://gist.github.com/Hamcha/3a7b3e7518e13d1fba7e

I wonder if that page would even work, his work PC at the time (late 2015) was a dual-socket Pentium III which ran surprisingly OK given the already 15+ years of age, but lacked in software support as apps like Skype and Chrome at one point started shipping binaries that required.. SSE2

Post reply on HN