From 0a80d099bc760a8886902e040e2001b438e510b0 Mon Sep 17 00:00:00 2001 From: lucy Date: Mon, 5 Jan 2026 15:22:29 +0100 Subject: [PATCH] fix config saving issue by moving writes to singleton --- Colors.qml | 38 +++++++++++++++---------------- config.json | 6 +++++ modules/bar/Volume.qml | 4 ++-- modules/settings/Settings.qml | 42 ++++++++++++++++++----------------- modules/settings/config.json | 6 +++++ modules/wallpaper/Overlay.qml | 9 ++++---- 6 files changed, 60 insertions(+), 45 deletions(-) create mode 100644 config.json create mode 100644 modules/settings/config.json diff --git a/Colors.qml b/Colors.qml index 42dff64..0e0a638 100644 --- a/Colors.qml +++ b/Colors.qml @@ -5,25 +5,25 @@ import Quickshell Singleton { id: customColors // Core Backgrounds - readonly property color background: "#1D2021" - readonly property color foreground: "#D5C4A1" - readonly property color cursor: "#D5C4A1" + readonly property color background: "#1A1B26" + readonly property color foreground: "#C0CAF5" + readonly property color cursor: "#C0CAF5" // The 16 Colors of the Apocalypse - readonly property color color0: "#1D2021" - readonly property color color1: "#FB4934" - readonly property color color2: "#B8BB26" - readonly property color color3: "#FABD2F" - readonly property color color4: "#83A598" - readonly property color color5: "#D3869B" - readonly property color color6: "#8EC07C" - readonly property color color7: "#D5C4A1" - readonly property color color8: "#665C54" - readonly property color color9: "#FB4934" - readonly property color color10: "#B8BB26" - readonly property color color11: "#FABD2F" - readonly property color color12: "#83A598" - readonly property color color13: "#D3869B" - readonly property color color14: "#8EC07C" - readonly property color color15: "#FBF1C7" + readonly property color color0: "#414868" + readonly property color color1: "#F7768E" + readonly property color color2: "#9ECE6A" + readonly property color color3: "#E0AF68" + readonly property color color4: "#7AA2F7" + readonly property color color5: "#BB9AF7" + readonly property color color6: "#7DCFFF" + readonly property color color7: "#A9B1D6" + readonly property color color8: "#414868" + readonly property color color9: "#F7768E" + readonly property color color10: "#9ECE6A" + readonly property color color11: "#E0AF68" + readonly property color color12: "#7AA2F7" + readonly property color color13: "#BB9AF7" + readonly property color color14: "#7DCFFF" + readonly property color color15: "#C0CAF5" } diff --git a/config.json b/config.json new file mode 100644 index 0000000..967a391 --- /dev/null +++ b/config.json @@ -0,0 +1,6 @@ +{ + "currentWall": "file:///home/lucy/.walls/faris.jpg", + "font": "MonaSpiceXe Nerd Font Propo", + "fontSize": 13, + "wallDir": "/home/lucy/.walls/" +} diff --git a/modules/bar/Volume.qml b/modules/bar/Volume.qml index ae95528..2a4c407 100644 --- a/modules/bar/Volume.qml +++ b/modules/bar/Volume.qml @@ -29,11 +29,11 @@ Item { function getVolumeIcon() { // Safety check: if Pipewire is dead or sink is missing if (!sink) - return "volume_mute"; + return "volume_off"; // If muted, show the hush icon if (sink.audio.muted) - return "volume_mute"; + return "volume_off"; // Volume is usually 0.0 to 1.0 (0% to 100%) const vol = sink.audio.volume; diff --git a/modules/settings/Settings.qml b/modules/settings/Settings.qml index 303c8b4..babf26b 100644 --- a/modules/settings/Settings.qml +++ b/modules/settings/Settings.qml @@ -1,30 +1,32 @@ pragma ComponentBehavior: Bound pragma Singleton import QtQuick -import Quickshell.Io import Quickshell +import Quickshell.Io -FileView { - id: settingsView - path: "/home/lucy/.cache/quickshell_settings.json" - - watchChanges: true - onAdapterUpdated: writeAdapter() - - adapter: JsonAdapter { - id: jsonAdapter - property string currentWall: "" - property string wallDir: "/home/lucy/.walls/" - property string font: "CommitMono Nerd Font Propo" - property real fontSize: 12 - } - onCurrentWallChanged: writeAdapter() - onWallDirChanged: writeAdapter() - onFontChanged: writeAdapter() - onFontSizeChanged: writeAdapter() - +Singleton { property alias currentWall: jsonAdapter.currentWall property alias font: jsonAdapter.font property alias fontSize: jsonAdapter.fontSize property alias wallDir: jsonAdapter.wallDir + FileView { + id: settingsView + path: "/home/lucy/.config/quickshell/modules/settings/config.json" + + watchChanges: true + onAdapterChanged: reload() + onAdapterUpdated: reload() + + adapter: JsonAdapter { + id: jsonAdapter + property string currentWall: "" + property string wallDir: "/home/lucy/.walls/" + property string font: "MonaSpiceXe Nerd Font Propo" + property real fontSize: 13 + } + } + onCurrentWallChanged: settingsView.writeAdapter() + onWallDirChanged: settingsView.writeAdapter() + onFontChanged: settingsView.writeAdapter() + onFontSizeChanged: settingsView.writeAdapter() } diff --git a/modules/settings/config.json b/modules/settings/config.json new file mode 100644 index 0000000..f0f8cfd --- /dev/null +++ b/modules/settings/config.json @@ -0,0 +1,6 @@ +{ + "currentWall": "file:///home/lucy/.walls/gentoo-abducted-1680x1050.png", + "font": "MonaSpiceXe Nerd Font Propo", + "fontSize": 13, + "wallDir": "/home/lucy/.walls/" +} diff --git a/modules/wallpaper/Overlay.qml b/modules/wallpaper/Overlay.qml index e6da166..3c16e1e 100644 --- a/modules/wallpaper/Overlay.qml +++ b/modules/wallpaper/Overlay.qml @@ -8,8 +8,9 @@ import "." WlrLayershell { id: overlayRoot required property var modelData - property var padding: 5 - property var rounding: 20 + property var padding: 2 + property var rounding: 15 + property var hyprgaps: 15 onPaddingChanged: { hyprGaps.exec(hyprGaps.command); console.log(hyprGaps.command); @@ -19,8 +20,8 @@ WlrLayershell { id: hyprGaps running: true property bool isZero: overlayRoot.padding === 0 - property var top: isZero ? 10 : overlayRoot.padding * 2 - property var sides: overlayRoot.padding + top + property var top: isZero ? 10 : overlayRoot.padding * 2 + overlayRoot.hyprgaps + property var sides: overlayRoot.padding + overlayRoot.hyprgaps property var gaps: top + "," + sides + "," + sides + "," + sides command: ["hyprctl", "keyword", "general:gaps_out", gaps] onStarted: console.log("set gaps to ", gaps)