Skip to content

Commit

Permalink
fix: x server access (#119)
Browse files Browse the repository at this point in the history
  • Loading branch information
perrin4869 authored May 14, 2024
1 parent 4613282 commit 7fe43b6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions run_zwift.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ do
sleep 1
done

[[ -n "${DBUS_SESSION_BUS_ADDRESS}" ]] && watch -n 30 xdg-screensaver reset &

echo "Killing uneccesary applications"
pkill ZwiftLauncher
pkill ZwiftWindowsCra
Expand Down
8 changes: 4 additions & 4 deletions zwift.sh
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ then
# Using Experimental Wayland, setup required parameters
# To force wayland DISPLAY must be blank.
WAYLAND_FLAGS=(
-e XDG_RUNTIME_DIR=/run/user/$ZWIFT_UID
-e XDG_RUNTIME_DIR=/run/user/$ZWIFT_UID
-e PULSE_SERVER=/run/user/$ZWIFT_UID/pulse/native
-e WINE_EXPERIMENTAL_WAYLAND=1
)
Expand All @@ -143,9 +143,9 @@ then
# if left to the run command the directory can get the wrong permissions
if [[ -z $(podman volume ls | grep zwift-$USER) ]]
then
$CONTAINER_TOOL volume create zwift-$USER
$CONTAINER_TOOL volume create zwift-$USER
fi

PODMAN_FLAGS=(
--userns keep-id:uid=$ZWIFT_UID,gid=$ZWIFT_GID
)
Expand All @@ -162,7 +162,7 @@ CONTAINER=$($CONTAINER_TOOL run ${GENERAL_FLAGS[@]} \
)

# Allow container to connect to X, has to be set for different UID
if [[ -z $WAYLAND_DISPLAY && $ZWIFT_UID -ne $(id -u) ]]
if [[ -z $WAYLAND_DISPLAY ]]
then
xhost +local:$($CONTAINER_TOOL inspect --format='{{ .Config.Hostname }}' $CONTAINER)
fi

0 comments on commit 7fe43b6

Please sign in to comment.