aboutsummaryrefslogtreecommitdiffstats
path: root/appearance/Hyprsunset.qml
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-09-16 13:15:46 +0200
committerDanilo M. <danix@danix.xyz>2026-09-16 13:15:46 +0200
commit0c0ea6b422907df12deb48a1ea3d332d072b9f69 (patch)
treecf674cd0972208492d544e34f273f6b46cc20e9d /appearance/Hyprsunset.qml
parent222875656922ab5826b3d7c546bb3ab0a4e04e17 (diff)
downloadquickshell-0c0ea6b422907df12deb48a1ea3d332d072b9f69.tar.gz
quickshell-0c0ea6b422907df12deb48a1ea3d332d072b9f69.zip
fix(appearance): final review fixes for the Sunset, Idle and Icons tabs
xcur2png wrote its config file into the qs CWD, which is the repo root, so hovering a legacy Xcursor theme left a stray left_ptr.conf in the tree. Point -c at the per-theme cache dir instead. Hyprsunset.save() could run before refresh()'s two cat processes landed and write a header-only hyprsunset.conf, blanking the location. Guard on the same confLoaded/appLoaded flags Hypridle already uses. The idle save had no acknowledgement, which the spec requires. Add a notice after the restart and show it in the tab, and switch Hypridle's save guard to a loaded flag so a config whose first block is a listener is not mistaken for an unloaded one. classify() used else if, so a directory carrying both index.theme and cursors/ (Adwaita) was listed as a cursor theme only and never reached the icon picker. Make the two tests independent; selftest gains the dual-purpose case.
Diffstat (limited to 'appearance/Hyprsunset.qml')
-rw-r--r--appearance/Hyprsunset.qml11
1 files changed, 10 insertions, 1 deletions
diff --git a/appearance/Hyprsunset.qml b/appearance/Hyprsunset.qml
index ea389fd..f488e96 100644
--- a/appearance/Hyprsunset.qml
+++ b/appearance/Hyprsunset.qml
@@ -36,6 +36,8 @@ Singleton {
property string notice: ""
property string sunSummary: ""
property bool busy: false
+ property bool confLoaded: false
+ property bool appLoaded: false
readonly property string header:
"# Managed by hyprsunset-qt. Edits here are overwritten on save.\n"
@@ -160,7 +162,12 @@ profile {
Process {
id: confProc
command: ["cat", root.confPath]
- stdout: StdioCollector { onStreamFinished: root.profiles = root.parseProfiles(text) }
+ stdout: StdioCollector {
+ onStreamFinished: {
+ root.profiles = root.parseProfiles(text);
+ root.confLoaded = true;
+ }
+ }
}
// hyprsunset-qt's own settings: location + daemon command.
@@ -194,6 +201,7 @@ profile {
root.cachePathRaw = c["cache.path"] ?? "~/.config/hyprsunset-qt/sun.json";
root.cachePath = root.expandTilde(root.cachePathRaw);
root.daemonCommand = c["daemon.command"] ?? "hyprsunset";
+ root.appLoaded = true;
}
}
}
@@ -216,6 +224,7 @@ profile {
}
function save() {
+ if (!root.confLoaded || !root.appLoaded) return;
for (const p of root.profiles) {
if (!root.validTime(p.time)) { root.notice = `invalid time: ${p.time}`; return; }
if (p.temperature !== null && p.temperature !== undefined &&