From 37c2f3f6738feb60668ff16382938e7448429a0b Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 29 Sep 2022 12:55:13 +0200 Subject: [vmchooser2] Force X11 session preselect if < 5GB RAM --- core/modules/vmchooser2/data/opt/openslx/bin/vmchooser | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'core/modules/vmchooser2') 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 -- cgit v1.2.3-55-g7522