summaryrefslogtreecommitdiffstats
path: root/core/modules/vmchooser2
diff options
context:
space:
mode:
authorSimon Rettberg2022-09-29 12:55:13 +0200
committerSimon Rettberg2022-09-29 12:55:13 +0200
commit37c2f3f6738feb60668ff16382938e7448429a0b (patch)
treebc57278cf736678d1374f6dd376ed3cb44bdf391 /core/modules/vmchooser2
parent[vmchooser2] Switch wrapper script to bash and use array (diff)
downloadmltk-37c2f3f6738feb60668ff16382938e7448429a0b.tar.gz
mltk-37c2f3f6738feb60668ff16382938e7448429a0b.tar.xz
mltk-37c2f3f6738feb60668ff16382938e7448429a0b.zip
[vmchooser2] Force X11 session preselect if < 5GB RAM
Diffstat (limited to 'core/modules/vmchooser2')
-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