Merge pull request #312241 from tpwrules/bwrap-better-display

buildFHSEnvBubblewrap: allow more varied $DISPLAY syntax
This commit is contained in:
K900
2024-05-21 22:52:24 +03:00
committed by GitHub
@@ -196,8 +196,10 @@ let
x11_args+=(--tmpfs /tmp/.X11-unix)
# Try to guess X socket path. This doesn't cover _everything_, but it covers some things.
if [[ "$DISPLAY" == :* ]]; then
display_nr=''${DISPLAY#?}
if [[ "$DISPLAY" == *:* ]]; then
# recover display number from $DISPLAY formatted [host]:num[.screen]
display_nr=''${DISPLAY/#*:} # strip host
display_nr=''${display_nr/%.*} # strip screen
local_socket=/tmp/.X11-unix/X$display_nr
x11_args+=(--ro-bind-try "$local_socket" "$local_socket")
fi