Skip to content

status: Implement new Stay Awake toggle

Adrian Vovk requested to merge AdrianVovk/gnome-shell:stay-awake into main

I'll copy+paste this comment for the reasoning behind this MR:

Another toggle idea: A stay-awake/"caffine" toggle (if enabled grabs a sleep inhibitor, otherwise not) is incredibly useful in my experience. There's so many use-cases where I sometimes keep the device from suspending itself in situations where it should not do so automatically:

  • long compilation job I want to keep an eye on while doing something else (not on that device). That way I can set the device somewhere I can see it, and can get some chores done while it's compiling. When it's done, I'll notice, turn off stay-awake, and get back to what I was doing on the device. In my experience, if I let the screen turn off I'll either excessively go back to check the device or just completely forget about it and never check it at all until long after it finishes.
  • ditto for a file download or any other long-running task
  • when presenting, I'll usually pull up a timer on a secondary device. I turn on stay-awake and set the device somewhere I can see it, so that I can monitor the time I have left to present. W/o this feature, the device would pretty quickly fall asleep unless I distract myself from my presentation to bump the touchpad
  • for school: using laptop to pull up some reference material while working on an assignment on my desktop. It's distracting to have to keep bumping the touchpad occasionally, or even worse when the device does go to sleep and you need to re-enter a password, so I'll turn on stay-awake to keep the screen on. That way I can glance at the resource I have pulled up w/o distracting myself from my work
  • if you're cooking and have a recipe pulled up, sometimes your hands are dirty so you won't be interacting with the device but you will be using it. Usually I'll see people awkwardly try to bump their touchpad w/ an elbow. If you miss the moment when the screen dims and the device ends up falling asleep in a situation like this, you'll need to go wash off your hands to re-enter your password, and then dirty them again w/ the cooking. For this use-case you can turn on stay-awake while following a recipe that dirties/busies your hands, and it will prevent both the awkward elbow move and the occasional pointless hand-wash. Conceptually similar situations can happen if the device falls asleep while you're following a time-sensitive part of a recipe or, as often happens in the kitchen, trying to juggle cooking a couple different dishes all at once.
  • In a social situation: I can play some music for a social gathering w/ some friends, and then turn on stay-awake so that it doesn't lock. That way the people I have over can walk to up the laptop and change the music that's playing w/o making me walk up and unlock it. In my experience, on devices w/o a stay-awake toggle, people tend to just give me their password whenever I ask to change the music. Sure, leaving a device unlocked w/ other people around isn't a great security move, but the alternative most people go for is giving someone else your password and that's markedly worse.

What's important about these use-cases is that the user wouldn't want the device to remain unlocked in the general case, but do in a specific instance (i.e. "I don't usually want the device to stay unlocked whenever I'm compiling/running a timer/browsing the web/listening to music, but I do want that in situations where compiling+chores/timer+presentation/web+cooking+dirty hands/music+friends"). I'm sure there's many more use-cases; I just listed the ones I personally run into fairly regularly and see others around me run into.

The one downside I can think of is a user forgetting to turn it off. Frankly, I don't think the OS should be concerning itself about policing the user here. If the user turns on the toggle, then walks away, then comes back to a dead device, that's on them. However, to help prevent mistakes, the toggle can automatically turn itself off whenever the user manually suspends/locks the device. So for instance: the user enables stay-awake, then 30 minutes later shuts their laptop lid. Clearly they don't want the laptop to stay awake anymore, so we should turn off the toggle. Same goes w/ a desktop and the keyboard shortcuts that lock the session.

Thoughts? If the design team OKs it, I'd be happy to implement it in GNOME shell :)

Here's what it looks like: Screenshot_from_2022-10-09_15-09-50

I know anecdotes aren't necessarily worth much, but I have a friend who I converted to using GNOME (from Windows), and I installed an extension that provides the functionality I described. They later came up to me and said that they're liking the GNOME workflow (🎉 yay!) and that the stay awake extension I installed for them is probably one of the most useful features.

Edited by Adrian Vovk

Merge request reports