1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2025-12-05 21:15:38 -05:00

Add 'dms restart' to Copr upgrades

This commit is contained in:
purian23
2025-10-24 17:16:29 -04:00
parent f32596053b
commit 6310394034
2 changed files with 36 additions and 0 deletions

View File

@@ -191,6 +191,24 @@ jobs:
rmdir "%{_sysconfdir}/xdg" 2>/dev/null || true
fi
# Restart DMS for active users after upgrade
if [ "$1" -ge 2 ] && [ -x /usr/bin/dms ]; then
# Find users running quickshell with DMS
for username in $(ps aux | grep -E '[q]uickshell.*dms' | awk '{print $1}' | sort -u); do
if [ "$username" = "root" ]; then
continue
fi
# Get user's UID for DBus path
user_uid=$(id -u "$username" 2>/dev/null)
if [ -n "$user_uid" ] && [ -d "/run/user/$user_uid" ]; then
echo "Restarting DMS for user: $username"
# Run as user with proper DBus session
runuser -u "$username" -- /bin/sh -c "DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$user_uid/bus /usr/bin/dms restart >/dev/null 2>&1 || true" 2>/dev/null || true
fi
done
fi
%files
%license LICENSE
%doc README.md CONTRIBUTING.md