Something went wrong. Try again.
A tui/cli program for tweaking niri wm display outputs dynamically without modifying configurations.
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566#!/usr/bin/env bash# Start a nested niri instance for the tests of dynamonix.## The tests change the outputs. Do not use the socket of the compositor that# you work in. This script starts a different instance.set -euo pipefail
directory="$(mktemp -d)"config="${directory}/config.kdl"
cat > "${config}" <<'KDL'hotkey-overlay { skip-at-startup}
layout { gaps 16}KDL
if [ -z "${WAYLAND_DISPLAY:-}" ]; then echo "error: WAYLAND_DISPLAY is not set. Start this script in a Wayland session." >&2 exit 1fi
before="$(ls "${XDG_RUNTIME_DIR}"/niri.*.sock 2>/dev/null || true)"
niri -c "${config}" &compositor=$!
for _ in $(seq 1 50); do sleep 0.1 after="$(ls "${XDG_RUNTIME_DIR}"/niri.*.sock 2>/dev/null || true)" socket="$(comm -13 <(echo "${before}") <(echo "${after}") | head -1)" if [ -n "${socket}" ]; then break fidone
if [ -z "${socket:-}" ]; then echo "error: the nested instance did not make a socket." >&2 kill "${compositor}" 2>/dev/null || true exit 1fi
cat <<EOFThe nested niri instance is ready.
socket: ${socket} process: ${compositor}
Run the test with a true compositor:
DYNAMONIX_TEST_SOCKET=${socket} cargo test -p dynamonix-ipc --test live
Run the interface:
cargo run --bin dynamonix -- --socket ${socket}
Stop the instance:
kill ${compositor}EOF
wait "${compositor}"