~fgaz/public-inbox

nix-bubblewrap: Parse `DISPLAY` variables that include a screen number v1 APPLIED

Arnout Engelen: 1
 Parse `DISPLAY` variables that include a screen number

 1 files changed, 1 insertions(+), 1 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~fgaz/public-inbox/patches/35871/mbox | git am -3
Learn more about email & git

[PATCH nix-bubblewrap] Parse `DISPLAY` variables that include a screen number Export this patch

The `DISPLAY` environment variable may optionally also
include a screen number after the display number: `:0.0`.

This change makes sure the display number is correctly
extracted even in this case.
---
 nix-bwrap.tcl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/nix-bwrap.tcl b/nix-bwrap.tcl
index 3fe88f5..8253b6c 100755
--- a/nix-bwrap.tcl
+++ b/nix-bwrap.tcl
@@ -62,7 +62,7 @@ set bwrap_options [list --unshare-all --clearenv --setenv HOME $env(HOME)]
lappend bwrap_options {*}[requisites_binds $exe]

if {$params(x11) == 1} {
  set display [string trimleft $env(DISPLAY) ":"]
  regexp {:([0-9]+)(\.[0-9]+)?} $env(DISPLAY) _ display
  lappend bwrap_options \
    --ro-bind "$env(HOME)/.Xauthority" "$env(HOME)/.Xauthority" \
    --ro-bind "/tmp/.X11-unix/X$display" "/tmp/.X11-unix/X$display" \
-- 
2.37.2
Thanks, applied!