Hacker News new | ask | show | jobs
by singlow 1516 days ago
So i get annoyed that my computer doesn't go to sleep sometimes because some website is playing a video. Is there a simple way to tell Linux/Gnome/Chrome to ignore videos and go to sleep anyway? I don't watch long videos on this computer so I hate to come back into my office and find my screen never locked because some website played a video i wasn't even watching.
7 comments

Additionally, something to tell me whether my PC will go to sleep or not if left alone. OP's problem happens to me every so often that I need to make sure the PC is indeed going to sleep before heading out.
Nothing like packing up your laptop at the end of the day, clicking "sleep" and wondering if it actually will cooperate or if you have open it back up and close random tabs and programs till it does,then waiting for the fan to audibly stop before putting it into a bag!
it's gotten to the point now where laptop manufacturers tell you not to put sleeping/hibernating laptop into a bag at all due to amount of heat they still generate even while sleeping [0]. Only those that are fully shut down should be placed in a bag (according to them).

[0] https://www.dell.com/community/XPS/FAQ-Modern-Standby/td-p/7...

Previous HN discussion: https://news.ycombinator.com/item?id=28639952

I miss hibernation. Real, write the contents of RAM to disk and shut-off completely type of hibernation.
I am confused. It's still around, right? It might be disabled by default on Windows, but you can always modify the power setting to enable hybernation? I set mine up and replaced "sleep" with "hibernate" in every setting I could find, like power button, lid close, idle timeout.
As I understand on current windows, the normal power off is actually hibernate.
Mine still does that.
The problem is with sleep (and the "active" sleep "S0 Low Power" that will check email) and Modern Standby, which uses software to choose when to Hibernate, so might not.

Hibernate S4 itself is fine, except the risk of physically triggering wakeup.

I think on Windows you can run powercfg /requests

I'm not sure about linux or Mac though

On MacOS, Activity Monitor has a "Preventing Sleep" column. From the command line, "pmset -g" or "pmset -g assertions" has useful information.
Now we need a menu appplet, cute icon, and name like Lullaby.
Another super useful powercfg flag is /lastwake to tell you why the computer woke up from sleep.

Has helped me identify flaky input peripherals or timers many times. Worst was an HP laptop with a wonky touch bar for media controls, that would frequently ghost press and wake the computer, even when in hibernate and with the lid closed.

I think at least if it's not the currently active tab it will still go to sleep, so it's not like a random Autoplay video in a background tab will ruin your day. At least that's what it seems like with Firefox on Linux.
I have my computers set up to lock with Meta + L on my Linux machine and Cmd + L on my MacBook Pro M1. And then I quickly and simply lock them with that whenever I get up from my seat.
I think the best option would be an extension that disables autoplay across the board. There are many out there, though all flawed in their own way. The least worst for Chrome seems to be AutoplayStopper.
Firefox (at least in Windows) does allow sleep when there's a no-audio video.
This is true now. But for awhile did not and any video would keep the PC awake.

Ended up being a security risk at our company because someone in marketing didn’t know this and made a full screen video. Well, cleaning staff came in and almost all our PCs were on because lots of people use the company website.

Fixed that nonsense right away.

Cut the browser off from anything but the xorg and pulseaudio sockets (no dbus!). Then it can't place any inhibitors.
It used to be possible with mint.com. I actually reported that to them and they fixed it!