From 46af2c27ee153f957b79a840293aae07074efd5d Mon Sep 17 00:00:00 2001 From: Stu Black Date: Tue, 28 Oct 2025 21:30:34 -0400 Subject: [PATCH] Tweak start-captive-wmaker.sh to behave a little more nicely. * Select $DISPLAY dynamically because X11 likes :0 and Wayland likes :1 and who knows what else might like some other value. * Kill Xephyr after wmaker exits. * 640x480 should be big enough for anyone. (And the window shouldn't get in the way so much.) --- start-captive-wmaker.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/start-captive-wmaker.sh b/start-captive-wmaker.sh index 32a5f402..2afb4c33 100755 --- a/start-captive-wmaker.sh +++ b/start-captive-wmaker.sh @@ -77,10 +77,18 @@ if [ -n "$1" -a -x "$WindowMaker$1" ] ; then shift fi -Xephyr -screen 1080x760 :1 & +for i in $(seq 5 10) ; do + if [ "x$DISPLAY" != "x:$i" ] ; then + xephyr_display=":$i" + break + fi +done +echo "Running Xephyr on display $xephyr_display" + +Xephyr -screen 640x480 "$xephyr_display" & xephyr_pid=$! -DISPLAY=:1 gdb \ +DISPLAY="$xephyr_display" gdb \ --directory "$project_base" \ --quiet \ - --args "$WindowMaker" -display :1 --for-real "$@" + --args "$WindowMaker" -display "$xephyr_display" --for-real "$@" kill $xephyr_pid -- 2.39.5