Unverified Commit ca2605c4 authored by K900's avatar K900 Committed by GitHub
Browse files

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

buildFHSEnvBubblewrap: allow more varied $DISPLAY syntax
parents bcea670c dd990848
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -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