Work on making it easier for complex WMs to be a thing

This commit is contained in:
Salt 2020-08-10 20:39:16 -05:00
parent d792253772
commit 2e2f6a64b5

View File

@ -324,11 +324,12 @@ step_postexecute() {
step_wait() {
[ -n "$_optdryrun" ] && exit 0
trap step_logout EXIT
if [ -n "$FS_DIEONWM" ] && gettarget "$_optconfigdir/wm" && has readlink "$_return"; then
target="$(command -v "$_return")"
log "Checking for window manager" 2
if [ -n "$FS_DIEONWM" ] && gettarget "$_optconfigdir/wm"; then
target="$_return"
for job in $(jobs -p); do
if [ "$target" = "$(readlink /proc/$job/exe)" ]; then
log "Waiting for WM to exit: \"$_return\""
if [ "$target" = "$(cat /proc/$job/cmdline)" ]; then
log "Waiting for WM to exit: \"$target\""
wait "$job"
exit 0
fi