wakepy icon indicating copy to clipboard operation
wakepy copied to clipboard

Block sleep for N minutes with the wakepy CLI command?

Open fohrloop opened this issue 1 month ago • 0 comments

See similar idea: https://discuss.kde.org/t/manually-block-sleep-and-screen-locking-for-n-minutes/14560

This is a feature request: Add the ability for the CLI command to run only N minutes. Or, N hours.

Example:

wakepy 10min

would block sleep for 10 minutes, and then resume. Then:

wakepy -p 5:30h

would block sleep and prevent screensaved for 5 hours and 30 minutes.

Alternatively, the syntax could use --time/-t flag:

wakepy -t 5:30h

wakepy -p -t 5:30h

What problem this solves?

Running simply wakepy -p will prevent screensaver and automatic screen lock indefinitely. Sometimes you might want to just prevent screen lock for example for the next 60 minutes. Having this feature adds a bit security, so if you're sitting on our laptop, run wakepy -p and forgot it on, your session would still be locked automatically.

Another use case might be: Running some non-python program overnight, but you know roughly how much time it takes, and you want to preserve some energy by allowing computer to go to sleep. Running wakepy -t 4:00h would be in this case better than simply wakepy.

fohrloop avatar Nov 21 '25 17:11 fohrloop