Skip to content

breakManager: Add new state machine for screen time/health breaks

Philip Withnall requested to merge pwithnall/gnome-shell:break-reminders into main

This implements health break reminder support in gnome-shell. It depends on a few bits and bobs from other modules:

  • New settings schemas in gsettings-desktop-schemas
  • A settings UI in gnome-control-center
  • User documentation in gnome-user-docs

It implements the design from https://gitlab.gnome.org/Teams/Design/settings-mockups/-/blob/master/wellbeing/wellbeing.png.

The core of the implementation is BreakManager, which is a state machine which uses the Mutter IdleMonitor to track whether the user is, or should be, in a screen time break.

The BreakDispatcher is based on top of this, and controls showing notifications, countdown timers, screen fades, the lock shield, etc. to make the user aware of upcoming or due breaks, as per their notification preferences.

Unit tests are included to check that BreakManager works. These provide mock implementations of basic GLib clock functions, the IdleMonitor and Gio.Settings in order to test the state machine in faster-than-real-time.

Signed-off-by: Philip Withnall pwithnall@gnome.org

See: Teams/Design/initiatives#130

Edited by Philip Withnall

Merge request reports

Loading