summaryrefslogtreecommitdiffstats
path: root/remote/modules
diff options
context:
space:
mode:
Diffstat (limited to 'remote/modules')
-rwxr-xr-xremote/modules/vmchooser2/data/opt/openslx/bin/vmchooser13
1 files changed, 11 insertions, 2 deletions
diff --git a/remote/modules/vmchooser2/data/opt/openslx/bin/vmchooser b/remote/modules/vmchooser2/data/opt/openslx/bin/vmchooser
index 38d10fde..4f30f447 100755
--- a/remote/modules/vmchooser2/data/opt/openslx/bin/vmchooser
+++ b/remote/modules/vmchooser2/data/opt/openslx/bin/vmchooser
@@ -15,9 +15,18 @@ else
# TODO: Tell user
fi
+MEM=$(grep -m1 '^MemTotal:' /proc/meminfo | awk '{print $2}')
+if [ -n "$SLX_VMCHOOSER_TAB" ] && [ "$SLX_VMCHOOSER_TAB" -ge 0 -a "$SLX_VMCHOOSER_TAB" -le 2 ]; then
+ TAB="$SLX_VMCHOOSER_TAB"
+elif [ "$MEM" -lt 3000000 ]; then # Check RAM size; if it's not that much, default to the native linux sessions
+ TAB=0
+else
+ TAB=2
+fi
+
if [ -n "$SLX_VM_POOL_FILTER" ]; then
- vmchooser.real "$@" --url "$URL" --pool "$SLX_VM_POOL_FILTER" --fullscreen
+ exec vmchooser.real "$@" --url "$URL" --pool "$SLX_VM_POOL_FILTER" --fullscreen --tab "$TAB"
else
- vmchooser.real "$@" --url "$URL" --fullscreen
+ exec vmchooser.real "$@" --url "$URL" --fullscreen --tab "$TAB"
fi