From 2b24045d8a28303430473611a46d5f33c031948c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 8 May 2026 16:22:26 +0000 Subject: [PATCH 1/2] Initial plan From 54ac9f92c211793d518d5403dbdca4c8d938229d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 8 May 2026 16:24:40 +0000 Subject: [PATCH 2/2] Fix geoclue option: restart service, poll for fix, offer fallback on timeout Agent-Logs-Url: https://github.com/TuxLux40/NeoWin/sessions/44c56706-eb37-4ee3-aec0-165bbf5d7d4c Co-authored-by: TuxLux40 <122551310+TuxLux40@users.noreply.github.com> --- install.sh | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/install.sh b/install.sh index 8f3d9c75..d9e1e819 100755 --- a/install.sh +++ b/install.sh @@ -145,6 +145,60 @@ configure_night_color() { else warn "Unknown package manager — install geoclue2 manually for your distro" fi + + # Restart plasma-knighttimed (Plasma 6's Night Color scheduling daemon) + # so it immediately attempts a fresh geoclue location lookup + if systemctl --user is-active plasma-knighttimed.service &>/dev/null; then + info "Restarting plasma-knighttimed to trigger location lookup..." + systemctl --user restart plasma-knighttimed.service 2>/dev/null || true + fi + + # Poke KWin to reload Night Color configuration + if [ -n "$qd" ]; then + $qd org.kde.KWin /KWin reconfigure 2>/dev/null || true + fi + + # Poll scheduledTransitionDateTime for up to 10 seconds to confirm a fix + if [ -n "$qd" ]; then + info "Waiting for geoclue to provide a location fix (up to 10 s)..." + local got_fix="false" + local i + for i in {1..10}; do + sleep 1 + scheduled=$($qd org.kde.KWin.NightLight /org/kde/KWin/NightLight \ + org.kde.KWin.NightLight.scheduledTransitionDateTime 2>/dev/null || echo "0") + if [ "${scheduled:-0}" != "0" ]; then + got_fix="true" + ok "geoclue location fix obtained — Night Color schedule is active" + break + fi + printf "." + done + # End the progress-dot line if we printed any dots (i.e. no fix obtained) + [ "$got_fix" != "true" ] && echo "" + + if [ "$got_fix" != "true" ]; then + warn "geoclue did not provide a location fix within 10 seconds." + warn "The geoclue portal (xdg-desktop-portal) may need configuration." + echo "" + echo " [1] Set fixed times (sunrise 07:00, sunset 19:00 — works without geoclue)" + echo " [2] Leave as-is (geoclue may work after next login or portal setup)" + echo "" + local fallback="2" + if [ -t 0 ]; then + read -rp "Choose [1/2]: " fallback + fi + if [ "${fallback:-2}" = "1" ]; then + $kw --file kwinrc --group NightColor --key Mode 2 + $kw --file kwinrc --group Times --key SunriseStart "07:00:00" + $kw --file kwinrc --group Times --key SunsetStart "19:00:00" + ok "Night Color set to fixed times (sunrise 07:00, sunset 19:00)" + info "Adjust in System Settings → Night Color" + else + info "Leaving as geoclue mode — configure the geoclue portal or re-run install after next login" + fi + fi + fi ;; 2) $kw --file kwinrc --group NightColor --key Mode 2