From bf371d05afedcaa67bb9ccf54f2f533c3adacf9a Mon Sep 17 00:00:00 2001 From: "Alex Xu (Hello71)" Date: Wed, 27 Jul 2022 01:15:51 -0400 Subject: virtualwl.eclass: use blocking read instead of kill --- eclass/virtualwl.eclass | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'eclass') diff --git a/eclass/virtualwl.eclass b/eclass/virtualwl.eclass index 162f615..d2715bc 100644 --- a/eclass/virtualwl.eclass +++ b/eclass/virtualwl.eclass @@ -99,7 +99,8 @@ virtwl() { # TODO: don't run addpredict in utility function. WLR_RENDERER=pixman doesn't work addpredict /dev/dri - coproc VIRTWL { WLR_BACKENDS=headless exec tinywl -s 'echo $WAYLAND_DISPLAY'; } + local VIRTWL VIRTWL_PID + coproc VIRTWL { WLR_BACKENDS=headless exec tinywl -s 'echo $WAYLAND_DISPLAY; read _; kill $PPID'; } local -x WAYLAND_DISPLAY read WAYLAND_DISPLAY <&${VIRTWL[0]} @@ -108,7 +109,7 @@ virtwl() { retval=$? [[ -n $VIRTWL_PID ]] || die "tinywl exited unexpectedly" - kill $VIRTWL_PID + exec {VIRTWL[0]}<&- {VIRTWL[1]}>&- [[ $retval = 0 ]] || die "Failed to run '$@'" } -- cgit v1.2.3-70-g09d2