mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-23 02:05:33 +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
|
#!/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" ] &&
|
if [ -n "$SHELL" ] &&
|
||||||
grep -q "$SHELL" /etc/shells &&
|
grep -q "$SHELL" /etc/shells &&
|
||||||
! (echo "$SHELL" | grep -q "false") &&
|
! (echo "$SHELL" | grep -q "false") &&
|
||||||
|
|||||||
Reference in New Issue
Block a user