PowerToys
PowerToys copied to clipboard
Configure Awake to enabled during working hours only
Description of the new feature / enhancement
I'm using Awake to override my company's group policy and prevent it from turning off monitors and locking after (what feels like only) 7 seconds. I'd like Awake to be enabled when I'm working (9-5pm, M-F) and currently the only time-based automation I see is to set the expiry date. With this I have to start it every day and change the expiry date to today. I'd prefer to be able to set and forget, in other words configure the Active period to be within certain hours of every weekday. It would then enable itself during those hours and I no longer need to launch the PowerToys settings window every morning for myself.
Scenario when this would be used?
I would use such a new feature 100% of the time to automate when Awake is active and inactive. I would set it once, then forget about it. That would be perfect for me.
Supporting information
My support for this idea is that I'm currently getting frustrated with having to reopen the settings every morning to change the expiry date. So much so that I could conceivably see myself learning Powershell to modify the configuration and relaunch Awake and maybe create a Windows Task to run it (and I'm no Windows powershell user, so I don't even know if this is a possibility, but I'm close to losing a day's effort in researching it).
This feature would be fantastic, I have the same use case. I do have a question though. Assume I've set recurring for M-F 8-5 but I leave on PTO for a week. Does Awake operate even when the computer is locked? I assume not but asking as I wouldn't want my screen on/PC unlocked while I'm out of office.
I have been looking for this option since the day I discovered "Awake". I implemented a workaround by creating a scheduled task that triggers a Powershell script when my PC resumes from sleep. The script kills any running instances of Awake, then starts it again via the CLI and pass an expiration time (e.g. the end of my work day):
Get-Process Powertoys.Awake | Stop-Process
Start-Process -WindowStyle Minimized -FilePath "C:\Program Files\PowerToys\PowerToys.Awake.exe" -ArgumentList "--expire-at=17:30:00 --display-on=false"
The scheduled task is a little tricky to setup, since I had to find out the exact event id to which it should trigger. I chose this:
The action that I configured is:
Program/script:
"C:\Program Files\PowerShell\7\pwsh.exe"
Add arguments: -NoProfile -ExecutionPolicy Bypass -File "<path-to-powershel-script>\Restart-Awake.ps1"
I hope this helps anyone while waiting for this feature to be implemented in Awake ;)
This appears to be an oft requested feature. Is anyone actively working to add this feature in a future version?
You can add a 'In-Progress' label on this. Per the contributing docs, I'm estimating a review in 3-4 weeks.
My fork: https://github.com/zskelton/PowerToys/tree/main
Tracking this conversation here: #24846