Skip to content

Commit

Permalink
init: forward wayland display only if it is set
Browse files Browse the repository at this point in the history
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
  • Loading branch information
89luca89 committed May 1, 2024
1 parent 5f4c54c commit 16775da
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions distrobox-init
Original file line number Diff line number Diff line change
Expand Up @@ -1789,6 +1789,10 @@ if [ -z "\$XAUTHLOCALHOSTNAME" ]; then
export XAUTHLOCALHOSTNAME="\$(host-spawn sh -c "printf "%s" \\\$XAUTHLOCALHOSTNAME")"
[ -z "\$XAUTHLOCALHOSTNAME" ] && unset XAUTHLOCALHOSTNAME
fi
if [ -z "\$WAYLAND_DISPLAY" ]; then
export WAYLAND_DISPLAY="\$(host-spawn sh -c "printf "%s" \\\$WAYLAND_DISPLAY")"
[ -z "\$WAYLAND_DISPLAY" ] && unset WAYLAND_DISPLAY
fi
# This will ensure a default prompt for a container, this will be remineshent of
# toolbx prompt: https://github.com/containers/toolbox/blob/main/profile.d/toolbox.sh#L47
Expand Down Expand Up @@ -1829,6 +1833,10 @@ if test -z \$XAUTHLOCALHOSTNAME
set -gx XAUTHLOCALHOSTNAME (host-spawn sh -c "printf "%s" \\\$XAUTHLOCALHOSTNAME")
test -z \$XAUTHLOCALHOSTNAME ; and set -e XAUTHLOCALHOSTNAME
end
if test -z \$WAYLAND_DISPLAY
set -gx WAYLAND_DISPLAY (host-spawn sh -c "printf "%s" \\\$WAYLAND_DISPLAY")
test -z \$WAYLAND_DISPLAY ; and set -e WAYLAND_DISPLAY
end
# This will ensure we have a first-shell password setup for an user if needed.
# We're going to use this later in case of rootful containers
Expand Down

0 comments on commit 16775da

Please sign in to comment.