[debian-edu-commits] [Git][debian-edu/debian-edu-config][master] Do not hardcode X2Go desktop to Xfce

Mike Gabriel (@sunweaver) gitlab at salsa.debian.org
Wed Aug 16 11:02:38 BST 2023



Mike Gabriel pushed to branch master at Debian Edu / debian-edu-config


Commits:
30dc5aea by Guido Berhoerster at 2023-08-16T09:55:40+02:00
Do not hardcode X2Go desktop to Xfce

Add a commandline option --x2go_desktop for specifying the default desktop and
make a best effort finding a usable desktop if none is specified.
Closes: #1049396

- - - - -


1 changed file:

- sbin/debian-edu-ltsp-install


Changes:

=====================================
sbin/debian-edu-ltsp-install
=====================================
@@ -22,6 +22,35 @@ version=2023-03-25
 
 set -e
 
+select_desktop () {
+    # select the first found desktop as the default, based on what x2goclient
+    # (src/onmainwindow.cpp) and x2goserver (x2goserver/bin/x2goruncommand)
+    # support
+    if [ -x /usr/bin/startxfce4 ]; then # from xfce4-session
+        echo XFCE
+    # FIXME x2goclient and x2goserver (x2goruncommand) in Debian only support
+    # startkde which does not exist any more (#955128)
+    #elif [ -x /usr/bin/startplasma-x11 ]; then # from plasma-workspace
+    #    echo KDE
+    elif [ -x /usr/bin/gnome-session ]; then # from gnome-session-bin
+        echo GNOME
+    elif [ -x /usr/bin/mate-session ]; then # from mate-session
+        echo MATE
+    elif [ -x /usr/bin/startlxde ]; then # from openbox-lxde-session
+        echo LXDE
+    elif [ -x /usr/bin/startlxqt ]; then # from lxqt-session
+        echo LXQT
+    elif [ -x /usr/bin/cinnamon-session-cinnamon2d ]; then # from cinnamon
+        echo CINNAMON
+    elif [ -x /usr/bin/openbox-session ]; then # from openbox
+        echo OPENBOX
+    elif [ -x /usr/bin/icewm-session ]; then # from icewm
+        echo ICEWM
+    else
+        echo XFCE
+    fi
+}
+
 # usage
 if [ -z "$1" ] ; then
 	echo "Use $0 -h or $0 --help for more information"
@@ -33,7 +62,7 @@ if [ "$1" = "-h" ] || [ "$1" = "--help" ] ; then
 
 Usage information:
 
-debian-edu-ltsp-install --arch <amd64|i386> --dist <stable|testing|sid> --dns_server <10.0.2.2|dns server ip> --diskless_workstation <yes|no> --thin_type <bare|display|desktop> --dlw <yes|no> --img <yes|no> --desktop <xfce|cinnamon|gnome|kde|lxde|lxqt|mate|none>
+debian-edu-ltsp-install --arch <amd64|i386> --dist <stable|testing|sid> --dns_server <10.0.2.2|dns server ip> --diskless_workstation <yes|no> --thin_type <bare|display|desktop> --dlw <yes|no> --img <yes|no> --desktop <xfce|cinnamon|gnome|kde|lxde|lxqt|mate|none> --x2go_desktop <xfce|cinnamon|gnome|kde|lxde|lxqt|mate|openbox|icewm>
 
 Turn a Debian Edu workstation into an LTSP server for both diskless
 workstations and thin clients.
@@ -54,6 +83,11 @@ workstations and thin clients.
              Other values: cinnamon, gnome, kde, lxde, lxqt, mate.
              (And 'none' for modular installations - also useful for testing).
 
+--x2go_desktop takes effect for X2Go thin client setup, default is any
+             of the installed desktop environments
+             Other values: cinnamon, gnome, kde, lxde, lxqt, mate, openbox,
+                           icewm
+
 --thin_type  has no default value. These are available:
     bare:    preconfigured x2go client running via 'startx' as user 'thin' with sound and
              client side mass storage support.
@@ -100,6 +134,7 @@ thin_type=""
 dlw="no"
 img="yes"
 desktop="xfce"
+x2go_desktop="$(select_desktop)"
 
 while [ $# -gt 0 ] ; do
   case "$1" in
@@ -111,6 +146,9 @@ while [ $# -gt 0 ] ; do
     --dlw) dlw="$2" ; shift ;;
     --img) img="$2" ; shift ;;
     --desktop) desktop="$2" ; shift ;;
+    --x2go_dektop)
+        x2go_desktop="$(printf '%s\n' "$2" | tr '[:lower:]' '[:upper:]')"
+        shift ;;
     --version) echo $version; exit 0 ;;
   esac
   shift
@@ -364,7 +402,7 @@ cat <<EOF > /etc/ltsp/skel/.x2goclient/sessions
 [default]
 autologin=false
 clipboard=both
-command=XFCE
+command=$x2go_desktop
 defsndport=true
 directrdp=false
 directrdpsettings=



View it on GitLab: https://salsa.debian.org/debian-edu/debian-edu-config/-/commit/30dc5aea1acef6847504adedc51b3547c7651c3a

-- 
View it on GitLab: https://salsa.debian.org/debian-edu/debian-edu-config/-/commit/30dc5aea1acef6847504adedc51b3547c7651c3a
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-edu-commits/attachments/20230816/32b9b2a8/attachment-0001.htm>


More information about the debian-edu-commits mailing list