mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2025-12-05 21:15:38 -05:00
Simplify Copr spec
This commit is contained in:
@@ -10,7 +10,9 @@ Type=simple
|
|||||||
ExecStart=/usr/bin/dms run --session
|
ExecStart=/usr/bin/dms run --session
|
||||||
ExecReload=/usr/bin/pkill -HUP -x dms
|
ExecReload=/usr/bin/pkill -HUP -x dms
|
||||||
Restart=always
|
Restart=always
|
||||||
RestartSec=1
|
RestartSec=3
|
||||||
|
StartLimitBurst=5
|
||||||
|
StartLimitIntervalSec=30
|
||||||
TimeoutStopSec=10
|
TimeoutStopSec=10
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
|
|||||||
@@ -151,40 +151,7 @@ fi
|
|||||||
|
|
||||||
# Restart DMS for active users after upgrade
|
# Restart DMS for active users after upgrade
|
||||||
if [ "$1" -ge 2 ]; then
|
if [ "$1" -ge 2 ]; then
|
||||||
# Find all quickshell DMS processes (PID and username)
|
pkill -HUP -x dms
|
||||||
while read pid cmd; do
|
|
||||||
username=$(ps -o user= -p "$pid" 2>/dev/null)
|
|
||||||
|
|
||||||
[ "$username" = "root" ] && continue
|
|
||||||
[ -z "$username" ] && continue
|
|
||||||
|
|
||||||
# Get user's UID and validate session
|
|
||||||
user_uid=$(id -u "$username" 2>/dev/null)
|
|
||||||
[ -z "$user_uid" ] && continue
|
|
||||||
[ ! -d "/run/user/$user_uid" ] && continue
|
|
||||||
|
|
||||||
wayland_display=$(tr '\0' '\n' < /proc/$pid/environ 2>/dev/null | grep '^WAYLAND_DISPLAY=' | cut -d= -f2)
|
|
||||||
[ -z "$wayland_display" ] && continue
|
|
||||||
|
|
||||||
echo "Restarting DMS for user: $username"
|
|
||||||
|
|
||||||
# Run as user with full Wayland session environment
|
|
||||||
runuser -u "$username" -- /bin/sh -c "
|
|
||||||
export XDG_RUNTIME_DIR=/run/user/$user_uid
|
|
||||||
export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$user_uid/bus
|
|
||||||
export WAYLAND_DISPLAY=$wayland_display
|
|
||||||
export PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:\$PATH
|
|
||||||
|
|
||||||
# Check if DMS is running as a systemd service
|
|
||||||
if systemctl --user is-active dms.service >/dev/null 2>&1; then
|
|
||||||
systemctl --user restart dms.service >/dev/null 2>&1
|
|
||||||
else
|
|
||||||
pkill -HUP dms >/dev/null 2>&1
|
|
||||||
fi
|
|
||||||
" 2>/dev/null || true
|
|
||||||
|
|
||||||
break
|
|
||||||
done < <(pgrep -a -f 'quickshell.*dms' 2>/dev/null)
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
%files
|
%files
|
||||||
|
|||||||
Reference in New Issue
Block a user