summaryrefslogtreecommitdiffstats
path: root/core/modules/vmchooser2/data/opt/openslx/bin/vmchooser
diff options
context:
space:
mode:
Diffstat (limited to 'core/modules/vmchooser2/data/opt/openslx/bin/vmchooser')
-rwxr-xr-xcore/modules/vmchooser2/data/opt/openslx/bin/vmchooser13
1 files changed, 12 insertions, 1 deletions
diff --git a/core/modules/vmchooser2/data/opt/openslx/bin/vmchooser b/core/modules/vmchooser2/data/opt/openslx/bin/vmchooser
index 28ed0cda..37cf6800 100755
--- a/core/modules/vmchooser2/data/opt/openslx/bin/vmchooser
+++ b/core/modules/vmchooser2/data/opt/openslx/bin/vmchooser
@@ -38,8 +38,19 @@ fi
if [ -n "$SLX_VMCHOOSER_TAB" ] && (( SLX_VMCHOOSER_TAB >= 0 && SLX_VMCHOOSER_TAB <= 2 )) 2>/dev/null; then
TAB="$SLX_VMCHOOSER_TAB"
-elif [ "$HW_MBRAM" -lt 3000 ]; then # Check RAM size; if it's not that much, default to the native linux sessions
+elif (( HW_MBRAM < 5000 )); then # Check RAM size; if it's not that much, default to the native linux sessions
TAB=0
+ # Only force if we have a "real" desktop
+ name=
+ for i in xfce xfce4 kde KDE plasma kde5; do
+ i="/usr/share/xsessions/${i}.desktop"
+ [ -f "$i" ] || continue
+ name="$( grep -oP '(?<=^Name=).*' "$i" )"
+ break
+ done
+ if [ -n "$name" ]; then
+ EXTRA+=( "--force-tab" "--default" "$name" )
+ fi
else
TAB=2
fi