diff --git a/spikes/gpui/headless-wayland.sh b/spikes/gpui/headless-wayland.sh index 34d926b..34cd6a1 100755 --- a/spikes/gpui/headless-wayland.sh +++ b/spikes/gpui/headless-wayland.sh @@ -29,8 +29,13 @@ SPIKE_STATE=${SPIKE_STATE:-$root/.scratch/gpui-spikes-state} runtime=$root/.scratch/wl mkdir -p "$runtime" "$SPIKE_STATE/config" "$SPIKE_STATE/data" "$SPIKE_STATE/cache" "$SPIKE_STATE/state" chmod 700 "$runtime" +# A compositor that died uncleanly leaves its socket, which the wait below +# would take for the new one's. +rm -f "$runtime"/wayland-* "$runtime"/sway-ipc.* +# sway-unwrapped: nixpkgs' sway wrapper starts sway under a dbus-run-session +# of its own when no bus is set, and that child outlives the kill below. tools=$(nix build --option substituters "https://cache.nixos.org/ https://nix-community.cachix.org" \ - --no-link --print-out-paths nixpkgs#sway nixpkgs#wtype) + --no-link --print-out-paths nixpkgs#sway-unwrapped nixpkgs#wtype) for t in $tools; do PATH="$t/bin:$PATH"; done unset DISPLAY WAYLAND_DISPLAY WAYLAND_SOCKET XDG_SESSION_TYPE DBUS_SESSION_BUS_ADDRESS SWAYSOCK export XDG_RUNTIME_DIR="$runtime" XDG_CONFIG_HOME="$SPIKE_STATE/config"