Skip to content

Watch config file changes and apply without restart #41

@GeneralD

Description

@GeneralD

Motivation

Currently config is loaded once at startup via ConfigKey.liveValue. Any changes to config.toml require restarting the daemon to take effect, making it tedious to iterate on styling.

Proposal

  • Watch ~/.config/backdrop/config.toml for changes using DispatchSource.makeFileSystemObjectSource or FSEvents
  • On change, reload and re-resolve config
  • Apply new config to the running overlay (text styles, colors, ripple, artwork, etc.)
  • Show error notification if the updated config is invalid (keep previous config)

Relevant Code

  • Sources/BackdropConfig/AppConfig.swift:318-322ConfigKey.liveValue is a static let, loaded once
  • Sources/BackdropApp/OverlayWindow.swift — reads config at init only
  • Sources/BackdropUI/Views/*.swift — read config via @Dependency(\.config)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions