diff options
| author | Freya Murphy <freya@freyacat.org> | 2026-01-20 09:46:29 -0500 |
|---|---|---|
| committer | Freya Murphy <freya@freyacat.org> | 2026-03-16 09:36:57 -0400 |
| commit | 4183a38b9ca4b3b314db51acb4c6795b5072f385 (patch) | |
| tree | 680dc7af88147f183d3c1be723d115e5bd9a1759 | |
| parent | revert 'monitorWorkspaces' (diff) | |
| download | caelestia-shell-4183a38b9ca4b3b314db51acb4c6795b5072f385.tar.gz caelestia-shell-4183a38b9ca4b3b314db51acb4c6795b5072f385.tar.bz2 caelestia-shell-4183a38b9ca4b3b314db51acb4c6795b5072f385.zip | |
remove config saving, make background scale properly, and add quickshell desktop file
| -rw-r--r-- | config/Config.qml | 66 | ||||
| -rw-r--r-- | modules/background/Background.qml | 11 | ||||
| -rw-r--r-- | nix/default.nix | 3 |
3 files changed, 11 insertions, 69 deletions
diff --git a/config/Config.qml b/config/Config.qml index 3955c06..8ea5e79 100644 --- a/config/Config.qml +++ b/config/Config.qml @@ -27,15 +27,6 @@ Singleton { property alias services: adapter.services property alias paths: adapter.paths - property bool recentlySaved: false - - // Public save function - call this to persist config changes - function save(): void { - saveTimer.restart(); - recentlySaved = true; - recentSaveCooldown.restart(); - } - // Helper function to serialize the config object function serializeConfig(): var { return { @@ -349,71 +340,17 @@ Singleton { }; } - ElapsedTimer { - id: timer - } - - Timer { - id: saveTimer - - interval: 500 - onTriggered: { - timer.restart(); - try { - // Parse current config to preserve structure and comments if possible - let config = {}; - try { - config = JSON.parse(fileView.text()); - } catch (e) { - // If parsing fails, start with empty object - config = {}; - } - - // Update config with current values - config = root.serializeConfig(); - - // Save to file with pretty printing - fileView.setText(JSON.stringify(config, null, 2)); - } catch (e) { - Toaster.toast(qsTr("Failed to serialize config"), e.message, "settings_alert", Toast.Error); - } - } - } - - Timer { - id: recentSaveCooldown - - interval: 2000 - onTriggered: { - root.recentlySaved = false; - } - } - FileView { id: fileView path: `${Paths.config}/shell.json` watchChanges: true onFileChanged: { - // Prevent reload loop - don't reload if we just saved - if (!root.recentlySaved) { - timer.restart(); - reload(); - } else { - // Self-initiated save - reload without toast - reload(); - } + reload(); } onLoaded: { try { JSON.parse(text()); - const elapsed = timer.elapsedMs(); - // Only show toast for external changes (not our own saves) and when elapsed time is meaningful - if (adapter.utilities.toasts.configLoaded && !root.recentlySaved && elapsed > 0) { - Toaster.toast(qsTr("Config loaded"), qsTr("Config loaded in %1ms").arg(elapsed), "rule_settings"); - } else if (adapter.utilities.toasts.configLoaded && root.recentlySaved && elapsed > 0) { - Toaster.toast(qsTr("Config saved"), qsTr("Config reloaded in %1ms").arg(elapsed), "rule_settings"); - } } catch (e) { Toaster.toast(qsTr("Failed to load config"), e.message, "settings_alert", Toast.Error); } @@ -422,7 +359,6 @@ Singleton { if (err !== FileViewError.FileNotFound) Toaster.toast(qsTr("Failed to read config file"), FileViewError.toString(err), "settings_alert", Toast.Warning); } - onSaveFailed: err => Toaster.toast(qsTr("Failed to save config"), FileViewError.toString(err), "settings_alert", Toast.Error) JsonAdapter { id: adapter diff --git a/modules/background/Background.qml b/modules/background/Background.qml index 1796a15..47b5bde 100644 --- a/modules/background/Background.qml +++ b/modules/background/Background.qml @@ -27,16 +27,19 @@ Loader { color: Config.background.wallpaperEnabled ? "black" : "transparent" surfaceFormat.opaque: false - anchors.top: true - anchors.bottom: true - anchors.left: true - anchors.right: true + WlrLayershell.anchors { + top: true + bottom: true + left: true + right: true + } Image { id: wallpaper anchors.fill: parent asynchronous: true + fillMode: Image.PreserveAspectCrop Loader { id: wallpaper diff --git a/nix/default.nix b/nix/default.nix index bd246a6..9f2e4af 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -140,6 +140,9 @@ in mkdir -p $out/lib ln -s ${extras}/lib/* $out/lib/ + + mkdir -p $out/share/applications + ln -s ${quickshell}/share/applications/* $out/share/applications ''; passthru = { |