i3 & I3_PID="$!" while ! [ -e "/run/user/1000/i3/ipc-socket.$I3_PID" ] do if ! [ "$(ps -p "$I3_PID" -o pid=)" ] then wait "$I3_PID" exit $? fi done