diff options
| -rw-r--r-- | config/Config.qml | 57 | ||||
| -rw-r--r-- | modules/background/Background.qml | 11 | ||||
| -rw-r--r-- | modules/bar/components/workspaces/ActiveIndicator.qml | 3 | ||||
| -rw-r--r-- | modules/bar/components/workspaces/Workspaces.qml | 15 | ||||
| -rw-r--r-- | nix/default.nix | 3 |
5 files changed, 13 insertions, 76 deletions
diff --git a/config/Config.qml b/config/Config.qml index 7a5c04f..d9fb892 100644 --- a/config/Config.qml +++ b/config/Config.qml @@ -27,55 +27,6 @@ Singleton { property alias services: adapter.services property alias paths: adapter.paths - // Public save function - call this to persist config changes - function save(): void { - saveTimer.restart(); - recentlySaved = true; - recentSaveCooldown.restart(); - } - - property bool recentlySaved: false - - 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 = 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: { - recentlySaved = false; - } - } - // Helper function to serialize the config object function serializeConfig(): var { return { @@ -407,13 +358,6 @@ Singleton { 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 && !recentlySaved && elapsed > 0) { - Toaster.toast(qsTr("Config loaded"), qsTr("Config loaded in %1ms").arg(elapsed), "rule_settings"); - } else if (adapter.utilities.toasts.configLoaded && 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 +366,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 f7c0a3f..1bc567b 100644 --- a/modules/background/Background.qml +++ b/modules/background/Background.qml @@ -27,16 +27,19 @@ Loader { WlrLayershell.layer: WlrLayer.Background color: "black" - 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 source: Paths.wallpaper ?? "" } diff --git a/modules/bar/components/workspaces/ActiveIndicator.qml b/modules/bar/components/workspaces/ActiveIndicator.qml index 912f771..cd5ce35 100644 --- a/modules/bar/components/workspaces/ActiveIndicator.qml +++ b/modules/bar/components/workspaces/ActiveIndicator.qml @@ -10,10 +10,9 @@ StyledRect { required property int activeWsId required property Repeater workspaces required property Item mask - required property var monitorWorkspaces readonly property int currentWsIdx: { - let wss = monitorWorkspaces; + let wss = Hypr.workspaces.values; for (let i = 0; i < wss.length; i++) { let ws = wss[i]; if (ws.id == activeWsId) diff --git a/modules/bar/components/workspaces/Workspaces.qml b/modules/bar/components/workspaces/Workspaces.qml index 69b8e48..562dd82 100644 --- a/modules/bar/components/workspaces/Workspaces.qml +++ b/modules/bar/components/workspaces/Workspaces.qml @@ -14,16 +14,6 @@ StyledClippingRect { required property ShellScreen screen readonly property int activeWsId: Config.bar.workspaces.perMonitorWorkspaces ? (Hypr.monitorFor(screen).activeWorkspace?.id ?? 1) : Hypr.activeWsId - readonly property var monitorWorkspaces: { - if (Config.bar.workspaces.perMonitorWorkspaces) { - let monitor = Hypr.monitorFor(root.screen); - return Hypr.workspaces.values.filter(ws => { - return ws.monitor.id == monitor.id - }); - } else { - return Hypr.workspaces.values - } - } implicitWidth: Config.bar.sizes.innerWidth implicitHeight: layout.implicitHeight + Appearance.padding.small * 2 @@ -42,9 +32,9 @@ StyledClippingRect { Repeater { id: workspaces - model: monitorWorkspaces.length + model: Hypr.workspaces.values.length Workspace { - ws: monitorWorkspaces[index] + ws: Hypr.workspaces.values[index] activeWsId: root.activeWsId } } @@ -56,7 +46,6 @@ StyledClippingRect { sourceComponent: ActiveIndicator { activeWsId: root.activeWsId - monitorWorkspaces: root.monitorWorkspaces workspaces: workspaces mask: layout } 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 = { |