diff --git a/root/defaults/startwm.sh b/root/defaults/startwm.sh index ffeb3882..bd6f4fe0 100755 --- a/root/defaults/startwm.sh +++ b/root/defaults/startwm.sh @@ -1,12 +1,15 @@ #!/usr/bin/env bash +# fd 3 is opened by svc-de/run and follows SELKIES_DEBUG, stay quiet without it +[ -e /proc/self/fd/3 ] || exec 3>/dev/null + # Start DE if [ "${SELKIES_DESKTOP,,}" == "true" ]; then - exec dbus-launch --exit-with-session /usr/bin/openbox-session > /dev/null 2>&1 & + exec dbus-launch --exit-with-session /usr/bin/openbox-session >&3 2>&3 & OPENBOX_PID=$! sleep 1 selkies-desktop kill $OPENBOX_PID else - exec dbus-launch --exit-with-session /usr/bin/openbox-session > /dev/null 2>&1 + exec dbus-launch --exit-with-session /usr/bin/openbox-session >&3 2>&3 fi diff --git a/root/defaults/startwm_wayland.sh b/root/defaults/startwm_wayland.sh index 6526aa2e..19566b77 100755 --- a/root/defaults/startwm_wayland.sh +++ b/root/defaults/startwm_wayland.sh @@ -1,5 +1,8 @@ #!/usr/bin/env bash +# fd 3 is opened by svc-de/run and follows SELKIES_DEBUG, stay quiet without it +[ -e /proc/self/fd/3 ] || exec 3>/dev/null + # Start DE ulimit -c 0 export XCURSOR_THEME=breeze_cursors @@ -28,7 +31,7 @@ if [ "${PELORUS,,}" == "true" ]; then kill $ATSPI_PID kill $LABWC_PID kill $PELORUS_PID - ' > /dev/null 2>&1 + ' >&3 2>&3 else dbus-run-session bash -c ' /usr/libexec/at-spi2-registryd & @@ -38,11 +41,11 @@ if [ "${PELORUS,,}" == "true" ]; then labwc kill $ATSPI_PID kill $PELORUS_PID - ' > /dev/null 2>&1 + ' >&3 2>&3 fi else if [ "${SELKIES_DESKTOP,,}" == "true" ]; then - labwc > /dev/null 2>&1 & + labwc >&3 2>&3 & LABWC_PID=$! sleep 1 export WAYLAND_DISPLAY=wayland-0 @@ -50,6 +53,6 @@ else selkies-desktop kill $LABWC_PID else - labwc > /dev/null 2>&1 + labwc >&3 2>&3 fi fi diff --git a/root/etc/s6-overlay/s6-rc.d/svc-de/run b/root/etc/s6-overlay/s6-rc.d/svc-de/run index d68cbd3b..2cd2b725 100755 --- a/root/etc/s6-overlay/s6-rc.d/svc-de/run +++ b/root/etc/s6-overlay/s6-rc.d/svc-de/run @@ -1,5 +1,13 @@ #!/usr/bin/with-contenv bash +# session output goes to fd 3, opened here while still root because abc +# cannot open /dev/stdout itself but inherits the descriptor +if [[ "${SELKIES_DEBUG,,}" == "true" ]]; then + exec 3>&1 +else + exec 3>/dev/null +fi + # wayland entrypoint if [[ "${PIXELFLUX_WAYLAND,,}" == "true" ]]; then SOCKET_PATH="${XDG_RUNTIME_DIR}/${WAYLAND_DISPLAY:-wayland-1}"