From f8071ea5f4bdafbbea271834f040b5198ba126b5 Mon Sep 17 00:00:00 2001 From: Roland Date: Mon, 25 May 2026 18:30:07 -0600 Subject: [PATCH] Fixing first-boot zenity autostart that XFCE was silently ignoring. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The original wrolpi-firstboot-notify.desktop was XDG-valid (per `desktop-file-validate`) but xfce4-session would not pick it up: zero log entries on first boot, no zenity dialog, no process spawned. Bringing the file in line with the upstream autostart entries that we saw working (nm-applet, xfce4-notifyd, etc.) fixes it. The likely required field is one of `TryExec=` / `Icon=` / `Categories=` — desktop-file-validate didn't flag the absence of any of them, but adding them as a set makes the autostart fire. Also instruments the notify script: it now writes a one-line log entry to /tmp/wrolpi-firstboot-notify.log on every invocation so a future "didn't see the dialog" report has a smoking gun. And the rm of the (root-owned) summary file now tries via sudo first. /tmp's sticky bit prevented the unprivileged user from removing a root-owned file — left a stale summary that would re-trigger the dialog on a subsequent login. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../autostart/wrolpi-firstboot-notify.desktop | 6 ++++- .../usr/local/bin/wrolpi-firstboot-notify | 25 +++++++++++++++++-- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/debian-live-config/config/includes.chroot/etc/xdg/autostart/wrolpi-firstboot-notify.desktop b/debian-live-config/config/includes.chroot/etc/xdg/autostart/wrolpi-firstboot-notify.desktop index ddb432ce..c1212693 100644 --- a/debian-live-config/config/includes.chroot/etc/xdg/autostart/wrolpi-firstboot-notify.desktop +++ b/debian-live-config/config/includes.chroot/etc/xdg/autostart/wrolpi-firstboot-notify.desktop @@ -3,5 +3,9 @@ Type=Application Name=WROLPi First-Boot Notification Comment=Show a summary of what WROLPi bootstrap did on first boot Exec=/usr/local/bin/wrolpi-firstboot-notify -StartupNotify=false +TryExec=/usr/local/bin/wrolpi-firstboot-notify +Icon=dialog-information +Terminal=false +Categories=System; NoDisplay=true +X-GNOME-Autostart-enabled=true diff --git a/debian-live-config/config/includes.chroot/usr/local/bin/wrolpi-firstboot-notify b/debian-live-config/config/includes.chroot/usr/local/bin/wrolpi-firstboot-notify index 0d56199e..8d605238 100755 --- a/debian-live-config/config/includes.chroot/usr/local/bin/wrolpi-firstboot-notify +++ b/debian-live-config/config/includes.chroot/usr/local/bin/wrolpi-firstboot-notify @@ -10,14 +10,35 @@ # # /tmp is tmpfs, so the file is naturally per-boot. Uneventful boots # (where bootstrap was a no-op) leave nothing to display. +# +# Logs every invocation to /tmp/wrolpi-firstboot-notify.log so we can +# tell from a deployed system whether xfce4-session ever fired the +# autostart at all. + +set +e # never fail silently; we always want the log line + +LOG=/tmp/wrolpi-firstboot-notify.log +exec >>"$LOG" 2>&1 +echo "===== $(date) invoked (user=$(id -un) display=${DISPLAY:-?}) =====" F=/tmp/wrolpi-firstboot-summary.txt -[ -f "$F" ] || exit 0 +if [ ! -f "$F" ]; then + echo "no summary file at $F — nothing to do" + exit 0 +fi if command -v zenity >/dev/null 2>&1; then + echo "launching zenity..." zenity --info --width=520 --title="Welcome to WROLPi" --text="$(cat "$F")" + echo "zenity returned $?" elif command -v notify-send >/dev/null 2>&1; then + echo "zenity missing; falling back to notify-send" notify-send -t 30000 "WROLPi setup complete" "$(cat "$F")" fi -rm -f "$F" +# bootstrap.sh writes the summary as root; /tmp's sticky bit means a +# non-root rm fails. Try via sudo (passwordless on WROLPi) so the file +# doesn't survive into another login session. +sudo rm -f "$F" 2>/dev/null || rm -f "$F" 2>/dev/null || true + +echo "done"