Skip to content

fix(settings): dual-persistence, atomic save, and property watcher coverage - #159

Open
berlin-566 wants to merge 1 commit into
mainfrom
save-conf
Open

berlin-566 wants to merge 1 commit into
mainfrom
save-conf

Conversation

@berlin-566

Copy link
Copy Markdown
Member

Summary

Fixes settings persistence issues across reboots/reloads (notably sound effects toggling back on by itself) and enhances overall configuration durability and reliability.

Key Changes

  1. Dual-Persistence Architecture:

    • Saves settings to ~/.config/agility-shell/settings_prefs.json (durable user config) and automatically mirrors to ~/.cache/quickshell/settings_prefs.json and /var/tmp/sddm-theme/settings_prefs.json for backwards compatibility with agl CLI, agilityd, and SDDM.
    • Initial boot seamlessly migrates existing preferences from cache into ~/.config/agility-shell/.
    • Automatic disaster recovery: if cache is wiped, settings are automatically recovered from ~/.config/agility-shell/.
  2. Atomic Writing & Backup Safeguards:

    • Added save_settings.py which writes to a temporary file, flushes (os.fsync), sets 0644 permissions, and atomically renames (os.replace) while keeping a .bak backup file to prevent JSON corruption on power-off or crash.
    • Added read_settings.py for safe fallback parsing across primary config, cache, and .bak backups.
  3. Complete Property Watcher Coverage:

    • Added missing change watchers in SettingsService.qml and HyprlandService.qml:
      • soundEffectsEnabled (resolves sound effects turning back on after closing settings)
      • pillBarThickness
      • bluetoothOnStartup
      • barIconMode, barIconShape, barIconCycleShapes, barIconCycleInterval, barIconCustomSvg
      • barOpenOnHover, barSolidTone
      • wpClicksEnabled, wpSourceMode, wpCustomFolderPath
    • Added explicit Binding on checked across EffectsSettings.qml, BarSettings.qml, BarAppletsSettings.qml, and IntegrationsSettings.qml to prevent UI toggle state drift.
  4. Rust CLI and Daemon Durability:

    • Updated crates/agility-cli and crates/agilityd to check the durable config store first with cache fallback.
    • Updated Theme.qml to mirror colorschemes to ~/.config/agility-shell/colorscheme.json.

Verification

  • Tested toggling sound effects and verified atomic updates across both config and cache locations.
  • Tested cache deletion and verified automatic recovery on load.
  • Verified cargo check builds with 0 errors.

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.

1 participant