Skip to content

added XDG_RUNTIME_DIR to container#118

Open
macdabby wants to merge 2 commits into
scottyhardy:masterfrom
macdabby:fix-for-wayland
Open

added XDG_RUNTIME_DIR to container#118
macdabby wants to merge 2 commits into
scottyhardy:masterfrom
macdabby:fix-for-wayland

Conversation

@macdabby
Copy link
Copy Markdown

@macdabby macdabby commented Oct 8, 2021

No description provided.

Copy link
Copy Markdown
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.

Comment thread docker-wine

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

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
Copy Markdown

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 ?

Copy link
Copy Markdown

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