Skip to content

Conversation

@macdabby
Copy link

@macdabby macdabby commented Oct 8, 2021

No description provided.

Copy link
Owner

@scottyhardy scottyhardy left a comment

Choose a reason for hiding this comment

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

I have no issue with including a fix for your issue, except I'd like it to either be a command line option or have some way to auto-detect if wayland is in use.


# 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants