From 6806ae4a850fc7785a8c05304237cf53b5b8f951 Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Fri, 23 Dec 2016 13:12:09 +0100 Subject: merge with latest dev version (tm-scripts commit f5a59daf8d70a9027118292cd40b18c221897408) --- .../data/opt/openslx/scripts/beamergui-mode_setter | 27 +++++++++++++++++----- 1 file changed, 21 insertions(+), 6 deletions(-) (limited to 'core/modules/beamergui') diff --git a/core/modules/beamergui/data/opt/openslx/scripts/beamergui-mode_setter b/core/modules/beamergui/data/opt/openslx/scripts/beamergui-mode_setter index 503e44fa..b747d257 100755 --- a/core/modules/beamergui/data/opt/openslx/scripts/beamergui-mode_setter +++ b/core/modules/beamergui/data/opt/openslx/scripts/beamergui-mode_setter @@ -55,13 +55,28 @@ if [ ${#OUTPUTNAMES[@]} -eq 2 ]; then # Either of them a projector? BEAMER= + MAYBEAMER= + SMALL= for i in 0 1; do - WIDTH=$(grep -E "^${OUTPUTNAMES[$i]}.*[0-9]+mm x [0-9]+mm" <<<"$XRANDR" | head -n 1 | grep -o -E ' [0-9]+mm x' | grep -o -E '[0-9]+') - if [ -z "$WIDTH" ] || [ "$WIDTH" -eq 0 ] || [ "$WIDTH" -gt 900 ]; then - echo "Screen $i is beamer, width is '$WIDTH'" - BEAMER=$i - fi + WIDTH=$(grep -E "^${OUTPUTNAMES[$i]}.*[0-9]+mm x [0-9]+mm" <<<"$XRANDR" | head -n 1 | grep -o -E ' [0-9]+mm x' | grep -o -E '[0-9]+') + if [ -z "$WIDTH" ] || [ "$WIDTH" -eq 0 ] || [ "$WIDTH" -gt 900 ]; then + echo "Screen $i is beamer, width is '$WIDTH'" + BEAMER=$i + elif [ -n "$WIDTH" ] && [ "$WIDTH" -gt 700 ]; then + MAYBEAMER=$i + elif [ -n "$WIDTH" ] && [ "$WIDTH" -lt 550 ]; then + SMALL=yes + fi done + if [ -z "$BEAMER" ] && [ -n "$MAYBEAMER" ] && [ -n "$SMALL" ]; then + # This is a hack on top of the other hack; we already treat outputs reporting a sufficiently large width + # as beamers, as we have encountered such devices in the wild. However, we might have just a large TV connected + # that is intended to be used just like a beamer to present the screen to the audience. So if we have a screen + # that is at least 70cm wide and the other one is no wider than 55cm we treat this as a beamer setup aswell. + # The reasoning here is that if it were a dual screen setup, the screens should be roughly the same size. + echo "Treating $MAYBEAMER as beamer as size difference is big enough" + BEAMER=$MAYBEAMER + fi if [ -n "$BEAMER" ]; then echo "${OUTPUTNAMES[$BEAMER]} is a beamer. " @@ -160,6 +175,6 @@ if [ ${#OUTPUTNAMES[@]} -eq 2 ]; then fi fi else - echo "\e[32mOther than two outputs.\e[0m" + echo -e "\e[32mOther than two outputs.\e[0m" fi -- cgit v1.2.3-55-g7522