Skip to content

Conversation

@leolost2605
Copy link
Member

@leolost2605 leolost2605 commented Jan 24, 2024

Working prototype of schedules.
Currently available are:

  • Manual schedules
  • Daylight schedules (based on sunset, sunrise)

Settings:

  • Dark/Light mode
  • do not disturb
  • monochrome

The current way schedules are set up is as follows:

  • id
  • name
  • Type (MANUAL or DAYLIGHT)
  • bool enabled
  • Dictionary private args - args specific to different types of schedules e.g. from and to with manual, or maybe in the future if you want location based schedules latitude, longitude or maybe wifi network, etc.
  • Dictionary active_settings - settings that get set when the schedule becomes active
  • Dictionary inactive_settings - settings that get set when the schedule becomes inactive (these might just be the opposites of the active_settings but could also include a default wallpaper path, etc.)

Schedules are stored as gsettings

Starts to fix #64
Fixes #11

For example some defaults (Should we provide them as actual disabled default to show the user some examples?):
[('a355ce91-d033-4f43-9f3c-cbef1b1a7c29', 0, 'Bedtime', false, {'from': <7.0>, 'to': <23.0>}, {'dnd': <true>, 'monochrome': <true>}, {}), ('2b3688c4-e037-4e58-8dde-f48b86dcff9f', 1, 'Night Time', false, {}, {'dark-mode': <true>}, {})]

@leolost2605
Copy link
Member Author

Some things to discuss here:

  • How should updating a schedule get handled?
    For example:
    Schedule is enabled and active but gets disabled. Should the inactive_settings get applied?
    And other way round etc.
  • The thing with nightlight is that we can't toggle it manually (or at least I don't know how) because GSD enforces scheduling. Of course we can work with that but since this would require quite a bit more code I'd like to leave this to a follow up PR
  • UI

@leolost2605

This comment was marked as outdated.

@leolost2605
Copy link
Member Author

@danirabbit regarding UI any suggestions where to put it? (ike which plug, maybe desktop? Or maybe even a separate one?) To make it powerful we'd probably need a list where we can add schedules, enable/disable, edit and delete them and a dialog where the user can choose the type of the schedule, the settings that get toggled and possibly even the inactive settings that get toggled (maybe something like a reverse changes on becoming inactive - custom switch).
Alternatively we can also just provide some default schedules like night, work, etc. (which we should do anyways).

@danirabbit
Copy link
Member

@leolost2605 I think it might be its own new top level plugin

@leolost2605
Copy link
Member Author

Ok this should be ready for initial reviews and testing together with the corresponding switchboard plug: elementary/settings-schedules

@leolost2605 leolost2605 requested a review from a team July 8, 2025 17:21
@danirabbit
Copy link
Member

I think one thing that's fundamentally different here from what I had in mind is that scheduling wasn't the primary thing I was going for. A focus mode like "Sleep" might be scheduled automatically between like 22:00–07:00 but if I go to bed at 21:00 I want to be able to manually set my focus to "Sleep". Likewise a focus like "Work" might not be scheduled at all but instead be set manually or by location. A focus "Driving" might be set when I'm traveling at a certain speed or Bluetooth connected to a car. Scheduling was only one small way to set focus modes

@danirabbit
Copy link
Member

Another thing is like in iOS I can choose to set a focus mode like for the next hour or until I change locations

image

This is great for like if I'm at the movies and I want to set a Do Not Disturb focus until I leave the theater

@danirabbit
Copy link
Member

danirabbit commented Jul 9, 2025

So in this model you wouldn't really enable or disable focuses from a list of focus modes. They're just things you have available and you can pick one (and only one) at any time. It's like setting your current status and the computer adapts to match that status

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.

Focus Modes Do Not Disturb scheduling

3 participants