From bdaf4bed0b4da4856308f81d7cb57fda5d3f7c5c Mon Sep 17 00:00:00 2001 From: humocs-man <251756307+humocs-man@users.noreply.github.com> Date: Mon, 11 May 2026 17:41:14 +0200 Subject: [PATCH] Change notification method to systemd-run Updated notification method to use systemd-run for user sessions. --- scripts/notify-bootc-user.sh | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/scripts/notify-bootc-user.sh b/scripts/notify-bootc-user.sh index b5a6c8a..314f3f1 100755 --- a/scripts/notify-bootc-user.sh +++ b/scripts/notify-bootc-user.sh @@ -17,14 +17,15 @@ TARGET_USER=$(loginctl list-sessions --no-legend | awk '$3 != "root" {print $3; USER_ID=$(id -u "$TARGET_USER") RUNTIME_DIR="/run/user/$USER_ID" -# 4. Benachrichtigung senden -# -a "System-Update" setzt den Namen in der Titelleiste -# --action definiert den Button -# --wait lässt das Skript auf die Reaktion warten -RESPONSE=$(sudo -u "$TARGET_USER" \ - DBUS_SESSION_BUS_ADDRESS="unix:path=$RUNTIME_DIR/bus" \ - XDG_RUNTIME_DIR="$RUNTIME_DIR" \ - notify-send -a "System-Update" "Ein neues System-Update ist bereit." "Der Neustart aktiviert die Änderungen." \ +# 4. Benachrichtigung senden via systemd-run +# Wir nutzen --machine=$TARGET_USER@.host, um in die User-Session zu springen +RESPONSE=$(systemd-run --machine="$TARGET_USER@.host" \ + --user \ + --pipe \ + --wait \ + notify-send -a "System-Update" \ + "Ein neues System-Update ist bereit." \ + "Der Neustart aktiviert die Änderungen." \ --icon=system-reboot-symbolic \ --urgency=critical \ --action="reboot=Jetzt neu starten" \