diff options
Diffstat (limited to 'appearance')
| -rw-r--r-- | appearance/Hyprsunset.qml | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/appearance/Hyprsunset.qml b/appearance/Hyprsunset.qml index f488e96..fc0d44a 100644 --- a/appearance/Hyprsunset.qml +++ b/appearance/Hyprsunset.qml @@ -218,9 +218,15 @@ profile { } function saveSettings() { appFile.setText(root.appConfText()); } + // hyprsunset holds Hyprland's CTM manager exclusively, and pkill only + // sends SIGTERM, so the replacement must wait for the old process to + // actually exit or it dies with "A CTM manager is already running". function restart() { Quickshell.execDetached(["sh", "-c", - `pkill -x hyprsunset; setsid -f ${root.daemonCommand}`]); + `pkill -x hyprsunset; ` + + `for i in $(seq 50); do ` + + `pgrep -x hyprsunset >/dev/null 2>&1 || break; sleep 0.1; done; ` + + `setsid -f ${root.daemonCommand}`]); } function save() { |
