Fix Firefox display access when configure.sh runs via su

Pass DISPLAY and WAYLAND_DISPLAY explicitly through the su call in
install.sh so Firefox can connect to the user's display session.
Remove the now-unnecessary DISPLAY=:0 fallback from get_nc_token.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-29 18:02:20 +02:00
parent a5c8d596fa
commit 9cb2977527
2 changed files with 1 additions and 4 deletions
+1 -1
View File
@@ -490,7 +490,7 @@ read -r -p "Run configure.sh now to set up your environment? [y/N]: " RUN_CONF
if [[ "${RUN_CONF,,}" == "y" ]]; then if [[ "${RUN_CONF,,}" == "y" ]]; then
if [[ -n "$SUDO_USER" ]]; then if [[ -n "$SUDO_USER" ]]; then
info "Running configure.sh as user '$SUDO_USER'..." info "Running configure.sh as user '$SUDO_USER'..."
su - "$SUDO_USER" -c "bash '$CONF_SCRIPT'" su - "$SUDO_USER" -c "DISPLAY='${DISPLAY}' WAYLAND_DISPLAY='${WAYLAND_DISPLAY}' bash '$CONF_SCRIPT'"
else else
echo echo
echo "configure.sh must be run as a non-root user. Please run:" echo "configure.sh must be run as a non-root user. Please run:"
-3
View File
@@ -102,9 +102,6 @@ get_nc_token() {
REQTOKEN=$( echo "${REQJSON}" | grep -oP '(?<="token":")[^"]+(?=")' ) REQTOKEN=$( echo "${REQJSON}" | grep -oP '(?<="token":")[^"]+(?=")' )
REQURL=$( echo "${REQJSON}" | grep -oP '(?<="login":")[^"]+(?=")' ) REQURL=$( echo "${REQJSON}" | grep -oP '(?<="login":")[^"]+(?=")' )
if [[ -z ${DISPLAY} ]]; then
export DISPLAY=:0
fi
/usr/bin/firefox "${REQURL}" & /usr/bin/firefox "${REQURL}" &
for i in {1..200} for i in {1..200}