Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docker-wine
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,7 @@ else

# Add Linux run args
add_run_arg --env="DISPLAY"
add_run_arg --volume="$XDG_RUNTIME_DIR/$WAYLAND_DISPLAY:/tmp/$WAYLAND_DISPLAY"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@macdabby maybe it's worth putting this behind a conditional so it's set (as per feedback from @scottyhardy)

	if [ -v WAYLAND_DISPLAY ]; then
		 add_run_arg --volume="$XDG_RUNTIME_DIR/$WAYLAND_DISPLAY:/tmp/$WAYLAND_DISPLAY"
	fi

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On my local system XDG_RUNTIME_DIR is /run, will /tmp always work ?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In case it helps, the following docker command works for me:

docker run -it \
  --rm \
  --hostname="$(hostname)" \
  --env="DISPLAY" \
  --env="WAYLAND_DISPLAY" \
  --env XDG_RUNTIME_DIR="/run/user/$(id -u)" \
  --env USER_UID="$(id -u)" \
  --env USER_GID="$(id -g)" \
  --platform="linux/amd64" \
  --volume="${XAUTHORITY:-${HOME}/.Xauthority}:/home/wineuser/.Xauthority:ro" \
  --volume="/tmp/.X11-unix:/tmp/.X11-unix:ro" \
  --volume="$XDG_RUNTIME_DIR/$WAYLAND_DISPLAY:/run/user/$(id -u)/$WAYLAND_DISPLAY" \
  scottyhardy/docker-wine wine notepad

I'd like it to either be a command line option or have some way to auto-detect if wayland is in use.

if [ -n "${WAYLAND_DISPLAY:-}" ] && [ -e "$XDG_RUNTIME_DIR/$WAYLAND_DISPLAY" ]
  echo "Wayland desktop is in use"
fi

add_run_arg --volume="/tmp/.X11-unix:/tmp/.X11-unix:ro"

run_container "interactive"
Expand Down