mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-22 02:01:55 +07:00
Detect external session management
This should make `uwsm start niri.desktop` possible like with other compositors.
This commit is contained in:
committed by
Ivan Molodetskikh
parent
22e43193e0
commit
88339633b1
@@ -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") &&
|
||||
|
||||
Reference in New Issue
Block a user