From 2d08dca91157fb178907c48d360f26958d18182f Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Wed, 2 Jan 2008 16:43:36 +0000 Subject: [PATCH] Now xlaunch can launch more than one X session. Use first argument starting with : for that. svn path=/nixpkgs/trunk/; revision=10053 --- pkgs/tools/X11/xlaunch/default.nix | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/X11/xlaunch/default.nix b/pkgs/tools/X11/xlaunch/default.nix index 4ec9c27ac39c..73a85be7f125 100644 --- a/pkgs/tools/X11/xlaunch/default.nix +++ b/pkgs/tools/X11/xlaunch/default.nix @@ -28,11 +28,18 @@ EOF mkdir -p \$out/libexec gcc realizeuid.c -o \$out/bin/xlaunch echo '#! ${stdenv.shell} - (egrep \"^ +env\" /etc/event.d/xserver | sed -e \"s/env/ export /\" | sed -e '\\''s/#.*//'\\'' ; echo export _XARGS_=\\\$\\( grep xserver_arguments \\\$SLIM_CFGFILE \\| sed -e s/xserver_arguments// \\) ; echo X \\\$_XARGS_ ) | bash -l & - while ! test -e /tmp/.X11-unix/X0 &>/dev/null ; do sleep 0.5; done USER=\$(egrep '\\''^[-a-z0-9A-Z_]*:[^:]*:'\\''\$1'\\'':'\\'' /etc/passwd | sed -e '\\''s/:.*//'\\'' ) shift - su -l \${USER:-identityless-shelter} -c \"DISPLAY=:0 \$*\"; + case \"\$1\" in + :*) export _display=\"\$1\"; + shift + esac + _display=\${_display:-:0} + _display=\${_display#:} + echo Using :\$_display + (egrep \"^ +env\" /etc/event.d/xserver | sed -e \"s/env/ export /\" | sed -e '\\''s/#.*//'\\'' ; echo export _XARGS_=\\\$\\( grep xserver_arguments \\\$SLIM_CFGFILE \\| sed -e s/xserver_arguments// \\| sed -e s/:0/:\${_display}/ \\| sed -e s/vt7/vt\$((7+_display))/ \\) ; echo X \\\$_XARGS_ ) | bash & + while ! test -e /tmp/.X11-unix/X\$_display &>/dev/null ; do sleep 0.5; done + su -l \${USER:-identityless-shelter} -c \"DISPLAY=:\$_display \$*\"; ' >\$out/libexec/xlaunch chmod a+x \$out/libexec/xlaunch ";