#!/bin/sh

SIZE=$(swaymsg -t get_outputs |
    jq -r '.[]|select(.active=true).rect |
           [.width, .height] | join("x")')

TMP_DISPLAY=":999"
Xephyr -screen "$SIZE" "$TMP_DISPLAY" &

export DISPLAY="$TMP_DISPLAY"
unset WAYLAND_DISPLAY I3SOCK

sleep 1s
i3 &

sleep 1s
terminal &

wait
