hex/nix/wait-for-session.sh
Kit Langton be9c368a00
feat(linux): add wlroots Wayland support and Nix packaging (#36)
* feat(linux): add wlroots Wayland support and Nix packaging

* fix(linux): preserve pending status and verify native coexistence

* test(linux): verify real dictation through a virtual microphone

* test(linux): bound smoke cleanup and check microphone release

* test(linux): isolate installer XDG paths from the host

* test(linux): exercise the desktop dictation lifecycle

* refactor(linux): simplify worker completion and input snapshots
2026-08-28 12:05:21 -04:00

21 lines
691 B
Shell

for ((attempt = 0; attempt < 30; attempt++)); do
if [[ -n "${WAYLAND_DISPLAY:-}" ]]; then
case "$WAYLAND_DISPLAY" in
/*) socket="$WAYLAND_DISPLAY" ;;
*) socket="${XDG_RUNTIME_DIR:-/nonexistent}/$WAYLAND_DISPLAY" ;;
esac
if [[ -S "$socket" ]]; then
exit 0
fi
elif [[ -n "${DISPLAY:-}" ]]; then
# graphical-session.target can precede the window manager on NixOS/i3.
if xprop -root _NET_SUPPORTING_WM_CHECK 2>/dev/null |
grep -Eq 'window id # 0x0*[1-9a-fA-F][0-9a-fA-F]*'; then
exit 0
fi
fi
sleep 1
done
echo "HEX: no ready graphical session. Import its display environment into the systemd user manager; retrying." >&2
exit 1