hex/nix/wait-for-session.sh
Dax 3434eb5f35
Rename voice-control to hex everywhere, without migrations (#293)
* Rename voice-control to hex everywhere, without migrations

The Cargo package and binary are now hex, every OS keeps its data in a
hex folder, and VOICE_CONTROL_* variables are HEX_*. Hex is a fresh
app: the macOS voice-control rename, its symlink, and the Windows and
Linux beta settings imports are gone. The Windows installer gets a new
AppId so it never takes over an old voice-control install's entry.

* Format

* Drop the Windows paste-last default only the beta import used
2026-10-28 13:08:44 -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