This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch feature/openbox
in repository live-build-x2go.

commit df3069d77ac90729d17f0ae8933bf8df74a23baa
Author: Stefan Baur (BAUR-ITCS) <[email protected]>
Date:   Fri Dec 16 02:31:25 2016 +0100

    added multiscreen/xinerama support
---
 .../lib/live/config/2800-x2go-thinclientconfig     |   58 ++++++++++++++++++++
 1 file changed, 58 insertions(+)

diff --git a/config/includes.chroot/lib/live/config/2800-x2go-thinclientconfig 
b/config/includes.chroot/lib/live/config/2800-x2go-thinclientconfig
index 6efdc18..019a6b6 100755
--- a/config/includes.chroot/lib/live/config/2800-x2go-thinclientconfig
+++ b/config/includes.chroot/lib/live/config/2800-x2go-thinclientconfig
@@ -17,6 +17,64 @@ cat >/home/user/.xsession <<XSESSION
 # Spawn PulseAudio
 pulseaudio -D -n -L 'module-native-protocol-tcp port=4713' -L 
'module-udev-detect' --exit-idle-time=65535 &
 
+# additional variable instead of "case $(...) in", as we need the value again 
later on
+XRANDRCMDTAINTED=\$(cat /proc/cmdline | tr ' ' '\n' | awk -F '=' '\\\$1 == 
"xinerama" { print \\\$2 }')
+
+# sanitize input
+case $XRANDRCMDTAINTED in
+"above")
+       XRANDRCMD="above"
+       ;;
+"below")
+       XRANDRCMD="below"
+       ;;
+"same-as")
+       XRANDRCMD="same-as"
+       ;;
+"right-of")
+       XRANDRCMD="right-of"
+       ;;
+*)
+       XRANDRCMD="left-of" # default
+       ;;
+esac
+
+# find out how many touch devices we have
+TOUCHDEVICESCOUNT = \$(LANG=C xsetwacom --list devices | wc -l)
+
+# find out how many mouse devices we have
+MICECOUNT = \$(find /dev/input -maxdepth 1 -name "mouse*" | wc -l)
+
+# loop through the following code block for all connected display devices
+for NEXT_DISPLAY in \$(LANG=C xrandr 2>/dev/null | grep ' connected ' | cut -d 
' ' -f1); do
+
+       #remove trailing newline from NEXT_DISPLAY
+       NEXT_DISPLAY=\${NEXT_DISPLAY%\$'\n'}
+
+       # THIS_DISPLAY won't be defined until the second time the loop is 
executed, which is a
+       # neat way of running xrandr only if there are at least two connected 
display devices
+       if [ -n \${THIS_DISPLAY+x} ] ; then
+
+               if [ \$TOUCHDEVICESCOUNT -gt 0 ] &&  [ \$MICECOUNT -lt 1 ] && [ 
-z \$XRANDRCMDTAINTED ]; then
+                       # we have a touch device and no mice, and no xinerama 
parameter was set,
+                       # so switch to clone view to make the touch device 
usable
+                       /usr/bin/xrandr --output \$NEXT_DISPLAY --same-as 
\$THIS_DISPLAY
+
+               else
+                       # else use whatever is in XRANDRCMD (which is either 
our default of "left-of",
+                       # or a valid xinerama kernel parameter value)
+                       /usr/bin/xrandr --output \$NEXT_DISPLAY --\$xrandrcmd 
\$THIS_DISPLAY
+               fi
+
+               # now set THIS_DISPLAY -> every subsequent iteration of the 
loop will now enter the code block
+               # above where [ -n \${THIS_DISPLAY+x} ] is the conditional
+               THIS_DISPLAY = \$NEXT_DISPLAY
+       fi
+done
+
+# set screen background to X2Go default blue on all detected screens
+xsetroot -solid "#246ed8"
+
 # Spawn openbox
 openbox &
 

--
Alioth's 
/srv/git/code.x2go.org/live-build-x2go.git//..//_hooks_/post-receive-email on 
/srv/git/code.x2go.org/live-build-x2go.git
_______________________________________________
x2go-commits mailing list
[email protected]
http://lists.x2go.org/listinfo/x2go-commits

Reply via email to