Skip to content

Commit

Permalink
Only use xhost when display is set (#180)
Browse files Browse the repository at this point in the history
Signed-off-by: Julien Jomier <[email protected]>
  • Loading branch information
jjomier authored Feb 20, 2024
1 parent 46c6bdd commit 46a1486
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion dev_container
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,10 @@ launch() {
fi

# Allow connecting from docker. This is not needed for WSL2 (`SI:localuser:wslg` is added by default)
run_command xhost +local:docker
if [ -v DISPLAY ] && command -v xhost >/dev/null; then
run_command xhost +local:docker
fi


for video_dev in $(find /dev -regex '/dev/video[0-9]+'); do
mount_device_opt+=" --device $video_dev"
Expand Down

0 comments on commit 46a1486

Please sign in to comment.