Skip to content

feat: prevent sleep and keep screen on during timer (Windows)#450

Open
todoterza wants to merge 1 commit into
Splode:mainfrom
todoterza:Keep-PC-on-while-timer-active---Feature-addition-(windows)
Open

feat: prevent sleep and keep screen on during timer (Windows)#450
todoterza wants to merge 1 commit into
Splode:mainfrom
todoterza:Keep-PC-on-while-timer-active---Feature-addition-(windows)

Conversation

@todoterza
Copy link
Copy Markdown

Closes #449

The problem

Windows default power settings put the PC to sleep after a period of inactivity. When Pomotroid is used to time work that doesn't involve the PC — reading, writing, studying — the system may sleep mid-session, causing missed alerts and disrupted focus.

The solution

A new Power section in System settings with two toggles:

  • Keep System Awake — prevents the PC from sleeping while a timer is running
  • Keep Screen On — sub-option that also prevents the display from turning off

Both toggles activate only while the timer is running and release immediately on pause, reset, or completion.

Implementation

Windows only. Uses SetThreadExecutionState (documented Win32 API, stable since Windows XP). No-op on other platforms — no behaviour change for macOS or Linux users.

The result

Uninterrupted, focused, straightforward work for even more users of Pomotroid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature addition: Keep PC awake

1 participant