Detect external session management

This should make `uwsm start niri.desktop` possible like with other compositors.
This commit is contained in:
Vladimir-csp
2025-07-12 10:48:26 +03:00
committed by Ivan Molodetskikh
parent 22e43193e0
commit 88339633b1
+10
View File
@@ -1,5 +1,15 @@
#!/bin/sh
# Detect if being run as a user service, which implies external session management,
# exec compositor directly
if [ -n "${MANAGERPID:-}" ] && [ "${SYSTEMD_EXEC_PID:-}" = "$$" ]; then
case "$(ps -p "$MANAGERPID" -o cmd=)" in
*systemd*--user*)
exec niri --session
;;
esac
fi
if [ -n "$SHELL" ] &&
grep -q "$SHELL" /etc/shells &&
! (echo "$SHELL" | grep -q "false") &&