From rtandy@sd63.bc.ca Thu Jan 29 19:24:21 2015 Received: (at submit) by bugs.x2go.org; 29 Jan 2015 18:24:23 +0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on ymir.das-netzwerkteam.de X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,URIBL_BLOCKED autolearn=ham version=3.3.2 X-Greylist: delayed 398 seconds by postgrey-1.34 at ymir.das-netzwerkteam.de; Thu, 29 Jan 2015 19:24:21 CET Received: from mail.sd63.bc.ca (mail.sd63.bc.ca [142.31.146.55]) by ymir.das-netzwerkteam.de (Postfix) with ESMTPS id B11453BC7E for ; Thu, 29 Jan 2015 19:24:21 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail.sd63.bc.ca (Postfix) with ESMTP id D64ED2444B1E for ; Thu, 29 Jan 2015 10:17:40 -0800 (PST) Received: from mail.sd63.bc.ca ([127.0.0.1]) by localhost (mail.sd63.bc.ca [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id e6NjuF8KhaTg for ; Thu, 29 Jan 2015 10:17:40 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by mail.sd63.bc.ca (Postfix) with ESMTP id 7195B2444B1F for ; Thu, 29 Jan 2015 10:17:40 -0800 (PST) X-Virus-Scanned: amavisd-new at sd63.bc.ca Received: from mail.sd63.bc.ca ([127.0.0.1]) by localhost (mail.sd63.bc.ca [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id LaTjjl6DfCXw for ; Thu, 29 Jan 2015 10:17:40 -0800 (PST) Received: from bowmore (bowmore.sbo.sd63.bc.ca [10.0.253.103]) by mail.sd63.bc.ca (Postfix) with SMTP id 56C532444B1E for ; Thu, 29 Jan 2015 10:17:40 -0800 (PST) Received: (nullmailer pid 18388 invoked by uid 1000); Thu, 29 Jan 2015 18:17:40 -0000 Date: Thu, 29 Jan 2015 10:17:40 -0800 From: Ryan Tandy To: submit@bugs.x2go.org Subject: please set DESKTOP_SESSION and XDG_CURRENT_DESKTOP like local sessions Message-ID: <20150129181740.GC2051@bowmore> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="ibTvN161/egqYuK8" Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) --ibTvN161/egqYuK8 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Package: x2goserver Version: 4.1.0.0-0~1215~ubuntu14.04.1 Severity: wishlist Hi, In Ubuntu before 15.04, and Debian jessie, the DESKTOP_SESSION for GNOME=20 Flashback is actually "gnome-fallback". In particular, this name is=20 found in /etc/upstart-xsessions while "gnome-flashback" is not, which=20 prevents Upstart user sessions from being enabled. ("gnome-session=20 --session=3Dgnome-flashback is still the correct command, though.) Furthermore, recent (Ubuntu >=3D 13.10, Debian jessie) login managers also= =20 export XDG_CURRENT_DESKTOP using the value of the DesktopNames field=20 =66rom the session file. This variable is starting to gain wide use by=20 applications that care about the desktop environment they run under. I can write a patch that adds all this information to x2goruncommand in=20 the existing format. However it occurs to me that it might make more=20 sense to parse the files in /usr/share/xsessions and use the information=20 directly instead of duplicating it. Please let me know which you'd=20 prefer to see. --=20 Ryan Tandy - Programmer/Analyst rtandy@sd63.bc.ca School District 63 (Saanich) +1 250 652 7385 --ibTvN161/egqYuK8 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJUynlBAAoJECKfzxL11mu2ER0P/0guvmJNZxMU+cacjJ1GacOT UzjaeJFLSBwpnNv1xdKlR1hRr8b2fcomnm9RyX8moQE9Nw/tyeQj5wFryldkCNFx dLA5sLp+1M2gl2RMf2wbYPjS+pcyv/NneF0tpJcc8ES3k2mmg+D/1oDWkkGfB0En uOpVAJ9MXEJswDHJOwx4n9OsbDWxTGJ4aFrFWg0ruhs4AK/Q9SCZoug8f64qdyG8 RvygNZZemQCTr44ziAJjfyeqkooVCabkOLu/kfnH3dsgr96UMYEaT+0U/7Qzhwla XbkKH4xbqcPseaBIVGkzew/s6fzTfvfJHJQ/Zc6oNL7gvbT3GR4xmC7IsrrW7K3/ NDSFhWjXymdHNDg5B8DuD6HZfnAhcgU31vJXJLxbH9M3lDMf90zLkWYaDyASGiNY 56erMXkC20W3JsWdxYwl/A4ZmtlUReCxQcPR444JBJa14Qd5Z165NJTeHgyKq5ga Ib0oUhQCDhMF0jrg4hmJ6UVv/aa7ECsjkfVcW/XcrLTSqe0/kvPZzstdZQyYIACS jx5Krgxg390R/ZfCPifqbFbqJdSDpDYUTWcxkWCn7unjy1j1GXso5H0WlHMjtxwj m67YbpeXol0cUqJrxbrJrt91dvhcjnfjM8ac0DMogzKmaVX55r3dRGC6qaKQGJTt PcK8qWFi2FbfdXJcEZyK =iA0v -----END PGP SIGNATURE----- --ibTvN161/egqYuK8-- From mike.gabriel@das-netzwerkteam.de Thu Feb 5 12:31:44 2015 Received: (at 774) by bugs.x2go.org; 5 Feb 2015 11:31:48 +0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on ymir.das-netzwerkteam.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,URIBL_BLOCKED autolearn=ham version=3.3.2 Received: from freya.das-netzwerkteam.de (freya.das-netzwerkteam.de [88.198.48.199]) by ymir.das-netzwerkteam.de (Postfix) with ESMTPS id DFA6B3BE61 for <774@bugs.x2go.org>; Thu, 5 Feb 2015 12:31:43 +0100 (CET) Received: from grimnir.das-netzwerkteam.de (grimnir.das-netzwerkteam.de [78.46.204.98]) by freya.das-netzwerkteam.de (Postfix) with ESMTPS id 6B992C39; Thu, 5 Feb 2015 12:31:43 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by grimnir.das-netzwerkteam.de (Postfix) with ESMTP id 168213C201; Thu, 5 Feb 2015 12:31:40 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at grimnir.das-netzwerkteam.de Received: from grimnir.das-netzwerkteam.de ([127.0.0.1]) by localhost (grimnir.das-netzwerkteam.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ReFS1iVp5pn6; Thu, 5 Feb 2015 12:31:39 +0100 (CET) Received: from grimnir.das-netzwerkteam.de (localhost [127.0.0.1]) by grimnir.das-netzwerkteam.de (Postfix) with ESMTPS id E22613C21D; Thu, 5 Feb 2015 12:31:12 +0100 (CET) Received: from 134.245.44.2 ([134.245.44.2]) by mail.das-netzwerkteam.de (Horde Framework) with HTTP; Thu, 05 Feb 2015 11:31:05 +0000 Date: Thu, 05 Feb 2015 11:31:05 +0000 Message-ID: <20150205113105.Horde.pMAVIXVYS9UljNMdiHh_1w1@mail.das-netzwerkteam.de> From: Mike Gabriel To: Ryan Tandy , 774@bugs.x2go.org Subject: Re: [X2Go-Dev] Bug#774: please set DESKTOP_SESSION and XDG_CURRENT_DESKTOP like local sessions In-Reply-To: <20150129181740.GC2051@bowmore> User-Agent: Internet Messaging Program (IMP) H5 (6.2.2) Accept-Language: de,en Organization: DAS-NETZWERKTEAM X-Originating-IP: 134.245.44.2 X-Remote-Browser: Mozilla/5.0 (X11; Linux x86_64; rv:32.0) Gecko/20100101 Firefox/32.0 Iceweasel/32.0 Content-Type: multipart/signed; boundary="=_ElvCrUTx6lUpcsRf4scMhg3"; protocol="application/pgp-signature"; micalg=pgp-sha1 MIME-Version: 1.0 This message is in MIME format and has been PGP signed. --=_ElvCrUTx6lUpcsRf4scMhg3 Content-Type: text/plain; charset=us-ascii; format=flowed; DelSp=Yes Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Ryan, On Do 29 Jan 2015 19:17:40 CET, Ryan Tandy wrote: > Package: x2goserver > Version: 4.1.0.0-0~1215~ubuntu14.04.1 > Severity: wishlist > > Hi, > > In Ubuntu before 15.04, and Debian jessie, the DESKTOP_SESSION for=20=20 >=20GNOME Flashback is actually "gnome-fallback". In particular, this=20=20 >=20name is found in /etc/upstart-xsessions while "gnome-flashback" is=20= =20 >=20not, which prevents Upstart user sessions from being enabled.=20=20 >=20("gnome-session --session=3Dgnome-flashback is still the correct=20=20 >=20command, though.) > > Furthermore, recent (Ubuntu >=3D 13.10, Debian jessie) login managers=20= =20 >=20also export XDG_CURRENT_DESKTOP using the value of the DesktopNames=20= =20 >=20field from the session file. This variable is starting to gain wide=20= =20 >=20use by applications that care about the desktop environment they run=20= =20 >=20under. > > I can write a patch that adds all this information to x2goruncommand=20= =20 >=20in the existing format. However it occurs to me that it might make=20= =20 >=20more sense to parse the files in /usr/share/xsessions and use the=20=20 >=20information directly instead of duplicating it. Please let me know=20= =20 >=20which you'd prefer to see. x2goruncommand actually requires a complete rewrite (and has to be=20=20 based=20on freedesktop.org specs). Until that happens, let's hard-code this stuff. Please provide your patch. Thanks! Mike --=20 DAS-NETZWERKTEAM mike=20gabriel, herweg 7, 24357 fleckeby fon: +49 (1520) 1976 148 GnuPG Key ID 0x25771B31 mail: mike.gabriel@das-netzwerkteam.de, http://das-netzwerkteam.de freeBusy: https://mail.das-netzwerkteam.de/freebusy/m.gabriel%40das-netzwerkteam.de.x= fb --=_ElvCrUTx6lUpcsRf4scMhg3 Content-Type: application/pgp-signature Content-Description: Digitale PGP-Signatur Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAABAgAGBQJU01R3AAoJEJr0azAldxsxO1MP/3nLkFN3KYx/sVYNWbYiB1ir u+6tMAzTPFuROfnCL23e+arv+Ocdx0UOLwEUelDJgldsFO+PEx0X8KS/8X316iBr sPPwrqlwkVq8/Y3lXSCq4Y6A3T+in+UWWugakXplH96iGnsa2CPTb9z1kbJTp1BA pEbQ5cQd+NhhGBLRXeYeXWdabgE3W9/VYE3ykFI9ivLPa4IUAnrq2UBoIdf4tDch /VfcHpKauLgAsGsSPbH6rxnvvyIEwe13RoRTAiszPw37L7+yukm4v3mHBZbYz5Ca 00YPblhR6djSlDBvR26DasHyEL+7SZNaipNlm8e1r6laFiYKFeKnD8GYj2zoAPPo 70dFWBI0A0Sg+Yhgplqe7akq9UApm7wX0Cc30k+v+HTiy0E/3gabh2ttbQp0lp9v 1A7TGb/XN10kq6gAgEiaoY/uLEJl2ETB6Lhd+Q1U1ihZ617HgISBp4ttWrxu+wzT bkDrxio1ikXlvsbgVt84Bl4lgzHqTQKjIrTDiC0Gg6GNWnMTZqHmKa21QRczNsz/ kpw/FsCbMfIwvdp+iFSqRX9OoBrm2hO3fG7ihWhCy68mCT61LvYP5xfkfzPwTM6U 9l+uPXjBGrdeAq1AhkusNd2VWfZtDAUKcrYwlqHmfJgISN5VibqgnF2IjrRpz4Db UVl5qou6JpnIueJGxHzd =Zb0X -----END PGP SIGNATURE----- --=_ElvCrUTx6lUpcsRf4scMhg3-- From rtandy@sd63.bc.ca Tue Mar 17 20:19:12 2015 Received: (at 774) by bugs.x2go.org; 17 Mar 2015 19:19:15 +0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on ymir.das-netzwerkteam.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,URIBL_BLOCKED autolearn=ham version=3.3.2 X-Greylist: delayed 436 seconds by postgrey-1.34 at ymir.das-netzwerkteam.de; Tue, 17 Mar 2015 20:19:11 CET Received: from mail.sd63.bc.ca (mail.sd63.bc.ca [142.31.146.55]) by ymir.das-netzwerkteam.de (Postfix) with ESMTPS id A57245DAA3 for <774@bugs.x2go.org>; Tue, 17 Mar 2015 20:19:11 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail.sd63.bc.ca (Postfix) with ESMTP id 27ECC24447DC; Tue, 17 Mar 2015 12:11:53 -0700 (PDT) Received: from mail.sd63.bc.ca ([127.0.0.1]) by localhost (mail.sd63.bc.ca [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id F6tzfATLcrdl; Tue, 17 Mar 2015 12:11:51 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by mail.sd63.bc.ca (Postfix) with ESMTP id CA7D424441D7; Tue, 17 Mar 2015 12:11:51 -0700 (PDT) X-Virus-Scanned: amavisd-new at sd63.bc.ca Received: from mail.sd63.bc.ca ([127.0.0.1]) by localhost (mail.sd63.bc.ca [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id eIc1QREg_yXs; Tue, 17 Mar 2015 12:11:51 -0700 (PDT) Received: from bowmore (bowmore.sbo.sd63.bc.ca [10.0.253.103]) by mail.sd63.bc.ca (Postfix) with SMTP id A9551244004B; Tue, 17 Mar 2015 12:11:51 -0700 (PDT) Received: (nullmailer pid 22965 invoked by uid 1000); Tue, 17 Mar 2015 19:11:51 -0000 Date: Tue, 17 Mar 2015 12:11:51 -0700 From: Ryan Tandy To: Mike Gabriel Cc: 774@bugs.x2go.org Subject: Re: [X2Go-Dev] Bug#774: please set DESKTOP_SESSION and XDG_CURRENT_DESKTOP like local sessions Message-ID: <20150317191151.GB2066@bowmore> References: <20150129181740.GC2051@bowmore> <20150205113105.Horde.pMAVIXVYS9UljNMdiHh_1w1@mail.das-netzwerkteam.de> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="a8Wt8u1KmwUX3Y2C" Content-Disposition: inline In-Reply-To: <20150205113105.Horde.pMAVIXVYS9UljNMdiHh_1w1@mail.das-netzwerkteam.de> User-Agent: Mutt/1.5.21 (2010-09-15) --a8Wt8u1KmwUX3Y2C Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline Control: tags -1 + patch Hi! Sorry it's taken me so long to get back to you about this. On Thu, Feb 05, 2015 at 11:31:05AM +0000, Mike Gabriel wrote: >On Do 29 Jan 2015 19:17:40 CET, Ryan Tandy wrote: >>I can write a patch that adds all this information to x2goruncommand >>in the existing format. However it occurs to me that it might make >>more sense to parse the files in /usr/share/xsessions and use the >>information directly instead of duplicating it. Please let me know >>which you'd prefer to see. > > >x2goruncommand actually requires a complete rewrite (and has to be >based on freedesktop.org specs). > >Until that happens, let's hard-code this stuff. Please provide your patch. Well, I started doing that, but it ended up being a lot less work (and a lot shorter code) to just take the settings from the session files. :) Please consider the attached patch. It makes x2goruncommand behave more like GDM/LightDM for GNOME-ish sessions. Testing GNOME Flashback on recent Ubuntu requires a couple of patches to Ubuntu packages, which I'm working on getting accepted. Details on Launchpad: https://bugs.launchpad.net/ubuntu/+source/gnome-session/+bug/1251281/comments/46 https://launchpad.net/~rtandy/+archive/ubuntu/flashback/+packages The gnome-session patch is applicable to Jessie too, but I think it's too late in the freeze to get it accepted now. :( Many thanks for your work on X2Go! -- Ryan Tandy - Programmer/Analyst rtandy@sd63.bc.ca School District 63 (Saanich) 250-652-7385 --a8Wt8u1KmwUX3Y2C Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0001-Launch-gnome-session-using-settings-from-the-session.patch" >From 9d84e88f7a7f4b0d47bfcf933796b2ca7cfd179f Mon Sep 17 00:00:00 2001 From: Ryan Tandy Date: Tue, 17 Mar 2015 10:39:29 -0700 Subject: [PATCH] Launch gnome-session using settings from the session file. Taking the settings from the session file should be more reliable and future-proof than hard-coding them. This makes X2Go behave more like GDM or LightDM in several cases. Setting DESKTOP_SESSION and XDG_CURRENT_DESKTOP correctly allows Upstart to manage the user session on Ubuntu 13.10 and later. That in turn means GTK_MODULES no longer has to be set manually, since there is an Upstart session job that sets it. Passing the startup command as an argument to the session wrapper is necessary on Ubuntu 15.04 and later. --- x2goserver/bin/x2goruncommand | 137 ++++++++++++------------------------------ 1 file changed, 39 insertions(+), 98 deletions(-) diff --git a/x2goserver/bin/x2goruncommand b/x2goserver/bin/x2goruncommand index ac7ff7f..c28ada1 100755 --- a/x2goserver/bin/x2goruncommand +++ b/x2goserver/bin/x2goruncommand @@ -83,108 +83,48 @@ elif [ "$sndsys" == "arts" ]; then export ARTS_SERVER="localhost:$4" fi -# detect Ubuntu version via /etc/lsb-release (not supported by Debian) -if [ -e "/etc/lsb-release" ]; then - source /etc/lsb-release -fi - # let x2goruncommand choose what command to use for a given desktop shell name (GNOME, UNITY, KDE, XFCE4, LXDE, TRINITY, MATE, OPENBOX, ICEWM) -# NOTES on GNOME startup behaviour in different distributions -# =========================================================== - -# Debian and every other non-Ubuntu distro launchs GNOME3 (in accelerated mode) when calling gnome-session - -# Ubuntu launches Unity (in accelerated mode) when calling gnome-session. -# To make the GNOME variants start up properly on Ubuntu, we have to make the following differentiations - -# Ubuntu 10.10 and earlier (maverick): -# GNOME -> gnome-session -# (would start GNOME2) -# Ubuntu 11.04 (natty): -# GNOME -> gnome-session --session=2d-gnome -# UNITY -> gnome-session --session=2d-ubuntu -# (GNOME3 based desktop shells) -# Ubuntu 11.10 (oneiric) & 12.04 (precise): -# GNOME -> gnome-session --session=gnome-fallback -# UNITY -> gnome-session --session=ubuntu-2d -# (GNOME3 based desktop shells) -# Ubuntu 12.10 (quantal): -# GNOME -> gnome-session --session=gnome-fallback -# UNITY -> gnome-session --session=ubuntu -# (GNOME3 based desktop shells) -# Ubuntu 13.10 (raring) and later: -# GNOME -> gnome-session --session=gnome-flashback -# UNITY -> gnome-session --session=ubuntu -# (GNOME3 based desktop shells) -# Additionally, $GTK_MODULES must include "unity-gtk-module". -# $GTK_MODULES does not need tha value for any other distro -# or any earlier release of Ubuntu. -# -# The logic for launching GNOME should be generic enough -# to work with every other distro. -# -# Also, it appears that some Linux GNOME2 distros need DESKTOP_SESSION="gnome" -# while others do not. +# Use the gnome-session logic to launch a Unity 2D or Cinnamon 2D session. +# Fall back to GNOME if the chosen session isn't available. +if [ "$cmd" == "UNITY" ] || [ "$cmd" == "unity" ]; then + x2go_xsession=ubuntu-2d + cmd="gnome-session" +elif [ "$cmd" == "CINNAMON" ] || [ "$cmd" == "cinnamon" ]; then + x2go_xsession=cinnamon2d + cmd="gnome-session" +fi if [ "$cmd" == "GNOME" ] || [ "$cmd" == "gnome-session" ]; then - cmd="/usr/bin/gnome-session" - if [ "$DISTRIB_ID" == "Ubuntu" ] && [ "$(echo "$DISTRIB_RELEASE >= 13.10" | bc)" == "1" ]; then - export DESKTOP_SESSION="gnome-flashback" - if [ -z "$GTK_MODULES" ] ; then - export GTK_MODULES="unity-gtk-module" - else - export GTK_MODULES="$GTK_MODULES:unity-gtk-module" + # Try to pick an appropriate session file, and take settings from it. + for session in "$x2go_xsession" gnome-flashback-metacity gnome-fallback gnome-2d gnome; do + session_desktop=/usr/share/xsessions/"$session".desktop + if [ -f "$session_desktop" ]; then + # Run the command specified in the session file. + cmd="$(sed -n 's/^Exec=//p' "$session_desktop")" + + # Use gnome-session's --disable-acceleration-check option if available. + # The Exec= line might already include it. That's OK. + if $cmd --help | grep -q -- --disable-acceleration-check; then + cmd="$cmd --disable-acceleration-check" + fi + + # Set DESKTOP_SESSION and GDMSESSION to the base name of the session file. + export DESKTOP_SESSION="$session" + export GDMSESSION="$session" + + # Try to set a reasonable XDG_CURRENT_DESKTOP. + # gnome-session will overwrite this, but on recent Ubuntu, some helpers are started by upstart instead of gnome-session. + # DesktopNames field is ;-separated. XDG_CURRENT_DESKTOP should be :-separated. + export XDG_CURRENT_DESKTOP="$(sed -n '/^DesktopNames=/ { s/^DesktopNames=//; s/;/:/g; s/:$//; p; }' "$session_desktop")" + # Before DesktopNames was standardized, a few Ubuntu releases used X-LightDM-DesktopName. + if [ -z "$XDG_CURRENT_DESKTOP" ]; then + export XDG_CURRENT_DESKTOP="$(sed -n 's/^X-LightDM-DesktopName=//p' "$session_desktop")" + fi + + break fi - args=" --session=$DESKTOP_SESSION" - elif [ -e /usr/share/gnome-session/sessions/gnome-flashback.session ]; then - export DESKTOP_SESSION="gnome-flashback" - args=" --session=$DESKTOP_SESSION" - elif [ -e /usr/share/gnome-session/sessions/gnome-fallback.session ]; then - export DESKTOP_SESSION="gnome-fallback" - args=" --session=$DESKTOP_SESSION" - elif [ -e /usr/share/gnome-session/sessions/2d-gnome.session ]; then - export DESKTOP_SESSION="2d-gnome" - args=" --session=$DESKTOP_SESSION" - elif [ "$DISTRIB_ID" == "Ubuntu" ] && [ "$(echo "$DISTRIB_RELEASE <= 10.10" | bc)" == "1" ]; then - export DESKTOP_SESSION="gnome" - elif cat /etc/debian_version | egrep "^(squeeze|6\.).*" >/dev/null; then - export DESKTOP_SESSION="gnome" - fi - -elif ([ "$cmd" == "UNITY" ] || [ "$cmd" == "unity" ]); then - cmd="/usr/bin/gnome-session" - if [ "$DISTRIB_ID" == "Ubuntu" ] && [ "$(echo "$DISTRIB_RELEASE >= 12.10" | bc)" == "1" ]; then - export DESKTOP_SESSION="ubuntu" - args=" --session=$DESKTOP_SESSION" - elif [ "$DISTRIB_ID" == "Ubuntu" ] && [ "$(echo "$DISTRIB_RELEASE == 11.10" | bc)" == "1" -o "$(echo "$DISTRIB_RELEASE == 12.04" | bc)" == "1" ]; then - export DESKTOP_SESSION="ubuntu-2d" - args=" --session=$DESKTOP_SESSION" - elif [ "$DISTRIB_ID" == "Ubuntu" ] && [ "$(echo "$DISTRIB_RELEASE == 11.04" | bc)" == "1" ]; then - export DESKTOP_SESSION="2d-ubuntu" - args=" --session=$DESKTOP_SESSION" - fi - # on earlier Ubuntu versions or with non-Ubuntu Distros the ,,UNITY'' command in X2Go will launch the GNOME2 desktop shell - -elif ([ "$cmd" == "CINNAMON" ] || [ "$cmd" == "cinnamon" ]); then - # Cinnamon 2.0 and newer - # The cmd is a script that calls the "cinnamon-session" binary. - if [ -e /usr/bin/cinnamon-session-cinnamon2d ]; then - cmd="/usr/bin/cinnamon-session-cinnamon2d" - # Cinnamon 1.6 & 1.8 - # The cmd is a script that calls the "gnome-session" binary. - elif [ -e /usr/bin/gnome-session-cinnamon2d ]; then - cmd="/usr/bin/gnome-session-cinnamon2d" - # Cinnamon 1.4 - # The cmd is a script that calls the "gnome-session" binary. - elif [ -e /usr/bin/gnome-session-cinnamon ]; then - cmd="/usr/bin/gnome-session-cinnamon" - # Fallback to the old behavior. - else - cmd="/usr/bin/gnome-session" - export DESKTOP_SESSION="cinnamon2d" - args=" --session=$DESKTOP_SESSION" - fi + done elif [ "$cmd" == "MATE" ]; then cmd="/usr/bin/mate-session" @@ -293,7 +233,8 @@ if [ "$EXEC" != "" ] && [ -x "$EXEC" ]; then if x2gofeature X2GO_XSESSION &>/dev/null && [ "x$X2GO_SESS_TYPE" = "xD" ]; then STARTUP="$cmd$args" "$X2GO_LIB_PATH/x2gosyslog" "$0" "notice" "launching session with Xsession-x2go mechanism, using STARTUP=\"$STARTUP\"" - XSESSION_EXEC="$cmd" STARTUP="/usr/bin/env LD_LIBRARY_PATH=${LD_LIBRARY_PATH} ${STARTUP}" /etc/x2go/Xsession + # LightDM passes the session command as an argument to the session wrapper. Some Ubuntu Xsession.d scripts depend on that. + XSESSION_EXEC="$cmd" STARTUP="/usr/bin/env LD_LIBRARY_PATH=${LD_LIBRARY_PATH} ${STARTUP}" /etc/x2go/Xsession "$cmd" else "$X2GO_LIB_PATH/x2gosyslog" "$0" "debug" "executing command \"$cmd$args\"..." -- 1.9.1 --a8Wt8u1KmwUX3Y2C-- From ionic@ionic.de Fri Mar 20 05:48:58 2015 Received: (at 774) by bugs.x2go.org; 20 Mar 2015 04:49:00 +0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on ymir.das-netzwerkteam.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_DKIM_INVALID, URIBL_BLOCKED autolearn=ham version=3.3.2 Received: from Root24.de (powered.by.root24.eu [5.135.3.88]) by ymir.das-netzwerkteam.de (Postfix) with ESMTP id 93C0E5DAA4 for <774@bugs.x2go.org>; Fri, 20 Mar 2015 05:48:58 +0100 (CET) Received: from nopileos.local (home.ionic.de [217.92.117.31]) by mail.ionic.de (Postfix) with ESMTPSA id 0943C4F08A0F; Fri, 20 Mar 2015 05:48:58 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=ionic.de; s=default; t=1426826938; bh=ZH1o8l6nZsh2LimLr8E7HsaO4v7sCYw/zs5NF7h7LB0=; h=Date:From:To:Subject:References:In-Reply-To:From; b=gj+FarWp+SV4RtgqzZsONUco9r02t//ROybXKoog9yvldtnnF3+T4CcY7iKlQOnXr JDxVW9uqwBU1mEjr1LVLfU6oZ18fy/U/bxWdIx7riYDMDVfJQeF8z5N8HI5UiFcn7Y UjLjhJqay+/E73tsbWUKyDT/HbkKyVRxyq6IiKjE= Message-ID: <550BA6B1.9010809@ionic.de> Date: Fri, 20 Mar 2015 05:48:49 +0100 From: Mihai Moldovan User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Ryan Tandy , 774@bugs.x2go.org, Mike Gabriel Subject: Re: [X2Go-Dev] Bug#774: Bug#774: please set DESKTOP_SESSION and XDG_CURRENT_DESKTOP like local sessions References: <20150129181740.GC2051@bowmore> <20150205113105.Horde.pMAVIXVYS9UljNMdiHh_1w1@mail.das-netzwerkteam.de> <20150317191151.GB2066@bowmore> In-Reply-To: <20150317191151.GB2066@bowmore> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="do1sPPGMcWlFHQu1DJom4p0aqKmKa0Vh1" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --do1sPPGMcWlFHQu1DJom4p0aqKmKa0Vh1 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 17.03.2015 08:11 PM, Ryan Tandy wrote: > Control: tags -1 + patch > > Hi! Sorry it's taken me so long to get back to you about this. > > On Thu, Feb 05, 2015 at 11:31:05AM +0000, Mike Gabriel wrote: >> On Do 29 Jan 2015 19:17:40 CET, Ryan Tandy wrote: >>> I can write a patch that adds all this information to x2goruncommand >>> in the existing format. However it occurs to me that it might make >>> more sense to parse the files in /usr/share/xsessions and use the >>> information directly instead of duplicating it. Please let me know >>> which you'd prefer to see. >> >> >> x2goruncommand actually requires a complete rewrite (and has to be >> based on freedesktop.org specs). >> >> Until that happens, let's hard-code this stuff. Please provide your >> patch. > > Well, I started doing that, but it ended up being a lot less work (and > a lot shorter code) to just take the settings from the session files. := ) > > Please consider the attached patch. It makes x2goruncommand behave > more like GDM/LightDM for GNOME-ish sessions. This looks interesting, but does it work for non-Ubuntu/Debian systems, too? Especially old(er) ones like SLE{S,D} 11, EPEL 5 etc.? Mihai --do1sPPGMcWlFHQu1DJom4p0aqKmKa0Vh1 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBCgAGBQJVC6a1AAoJEB/WLtluJTqHQg8QANLb1fWVV3M5CTYDJG1g5e2F dRuhHxhtCeGPCLvP0ehdmcYh18tgOemB2Vssa+1AArqDPp9g60/BwM47RwDCjUx6 X9wnPa1BnDlBtB6ng0GFiW2q/uhQP8jwmAekmKw7Sx/Wm72BpjPAqPLtYUFWBfhv EFAfg+XpE/KBbFKUdXpAULJ3+JVmR8SfJxzXSWKlORLOBp6ALUq1EP/UK1pHQdrG A23LM5934jRK/vrnCiBEPiEc6GIaQHoqUqBLghh6tFKRO1p5RnhiUrSw+NJs5U8Q QI4Et72ICqD7T77M82/okgd8Evrq71FMKZ76j+RekAdbzOORVGW8UKLHCaaFmMws YVZ2WtgLcNi5suTVJRqCUG9gdU6ZjH7uUg8O+ijE2iG4z+o23mHCA2qsYxiihagR wxvlyWE1g0yOfBY59I7fDiHmM0HfjMGRT3qvLQUXph3AWlDzwDK0ZJ5JZi0SEAUF wf/4o1HDOqzR+ro06Z73GSNwj1koqaA91twtDl6E2ibFTgkq3/K+BcYr5k4yxnU+ wSQInxJEXuB7YMr8KLeLqFus7bpgubGzpBjrnhUzJ5O9XPwMeDF7HA+rESH0bcz7 TgMUurocZAI/HP8LlOcnTLPAPVHQxb/DJ7gIdLI5/tMgZvwpzz8bI+2kGc34fZwc OeuPNXy9a4rQR9eFuevr =9+K+ -----END PGP SIGNATURE----- --do1sPPGMcWlFHQu1DJom4p0aqKmKa0Vh1-- From rtandy@sd63.bc.ca Fri Mar 20 23:12:38 2015 Received: (at 774) by bugs.x2go.org; 20 Mar 2015 22:12:42 +0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on ymir.das-netzwerkteam.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,URIBL_BLOCKED autolearn=ham version=3.3.2 Received: from mail.sd63.bc.ca (mail.sd63.bc.ca [142.31.146.55]) by ymir.das-netzwerkteam.de (Postfix) with ESMTPS id 6CA625DAA4 for <774@bugs.x2go.org>; Fri, 20 Mar 2015 23:12:37 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail.sd63.bc.ca (Postfix) with ESMTP id 9E08B244005C; Fri, 20 Mar 2015 15:12:34 -0700 (PDT) Received: from mail.sd63.bc.ca ([127.0.0.1]) by localhost (mail.sd63.bc.ca [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id kmz6qmdHN7Mh; Fri, 20 Mar 2015 15:12:33 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by mail.sd63.bc.ca (Postfix) with ESMTP id ACB8824447D8; Fri, 20 Mar 2015 15:12:33 -0700 (PDT) X-Virus-Scanned: amavisd-new at sd63.bc.ca Received: from mail.sd63.bc.ca ([127.0.0.1]) by localhost (mail.sd63.bc.ca [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id lfDRJUnm5XuA; Fri, 20 Mar 2015 15:12:33 -0700 (PDT) Received: from bowmore (bowmore.sbo.sd63.bc.ca [10.0.253.103]) by mail.sd63.bc.ca (Postfix) with SMTP id 86EF0244005C; Fri, 20 Mar 2015 15:12:33 -0700 (PDT) Received: (nullmailer pid 19062 invoked by uid 1000); Fri, 20 Mar 2015 22:12:33 -0000 Date: Fri, 20 Mar 2015 15:12:33 -0700 From: Ryan Tandy To: Mihai Moldovan Cc: 774@bugs.x2go.org, Mike Gabriel Subject: Re: [X2Go-Dev] Bug#774: Bug#774: please set DESKTOP_SESSION and XDG_CURRENT_DESKTOP like local sessions Message-ID: <20150320221233.GA2119@bowmore> References: <20150129181740.GC2051@bowmore> <20150205113105.Horde.pMAVIXVYS9UljNMdiHh_1w1@mail.das-netzwerkteam.de> <20150317191151.GB2066@bowmore> <550BA6B1.9010809@ionic.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="s2ZSL+KKDSLx8OML" Content-Disposition: inline In-Reply-To: <550BA6B1.9010809@ionic.de> User-Agent: Mutt/1.5.21 (2010-09-15) --s2ZSL+KKDSLx8OML Content-Type: multipart/mixed; boundary="X1bOJ3K7DJ5YkBrT" Content-Disposition: inline --X1bOJ3K7DJ5YkBrT Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Fri, Mar 20, 2015 at 05:48:49AM +0100, Mihai Moldovan wrote: >This looks interesting, but does it work for non-Ubuntu/Debian systems, >too? Especially old(er) ones like SLE{S,D} 11, EPEL 5 etc.? Tested on CentOS 5 and 6 successfully. CentOS 7 seems to not include the=20 GNOME Flashback components, so I couldn't test there. I wasn't able to get X2Go working at all on OpenSuSE 11. :/ Looks like=20 packages.x2go.org doesn't carry 11 any more? Works on OpenSuSE 12,=20 although the GNOME fallback desktop seems to be affected by a few bugs.=20 I didn't test OpenSuSE 13, but glancing at the repo it looks like they=20 retired the fallback/gnome-panel packages like RHEL7 did. The patch I sent before exports XDG_CURRENT_DESKTOP needlessly in=20 environments that have no value for it (e.g. older GNOME 2). Should be=20 harmless, but even so I'm attaching a corrected patch and interdiff=20 since the previous one. The approach probably extends to non-GNOME desktops too, but I don't=20 know when I would have time to go through and test them all... --=20 Ryan Tandy - Programmer/Analyst rtandy@sd63.bc.ca School District 63 (Saanich) 250-652-7385 --X1bOJ3K7DJ5YkBrT Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0001-Launch-gnome-session-using-settings-from-the-session.patch" Content-Transfer-Encoding: quoted-printable =46rom e184e85cbf28928864fd3d935bced28295e7624f Mon Sep 17 00:00:00 2001 =46rom: Ryan Tandy Date: Tue, 17 Mar 2015 10:39:29 -0700 Subject: [PATCH] Launch gnome-session using settings from the session file. Taking the settings from the session file should be more reliable and future-proof than hard-coding them. This makes X2Go behave more like GDM or LightDM in several cases. Setting DESKTOP_SESSION and XDG_CURRENT_DESKTOP correctly allows Upstart to manage the user session on Ubuntu 13.10 and later. That in turn means GTK_MODULES no longer has to be set manually, since there is an Upstart session job that sets it. Passing the startup command as an argument to the session wrapper is necessary on Ubuntu 15.04 and later. --- x2goserver/bin/x2goruncommand | 140 +++++++++++++-------------------------= ---- 1 file changed, 42 insertions(+), 98 deletions(-) diff --git a/x2goserver/bin/x2goruncommand b/x2goserver/bin/x2goruncommand index ac7ff7f..f35d159 100755 --- a/x2goserver/bin/x2goruncommand +++ b/x2goserver/bin/x2goruncommand @@ -83,108 +83,51 @@ elif [ "$sndsys" =3D=3D "arts" ]; then export ARTS_SERVER=3D"localhost:$4" fi =20 -# detect Ubuntu version via /etc/lsb-release (not supported by Debian) -if [ -e "/etc/lsb-release" ]; then - source /etc/lsb-release -fi - # let x2goruncommand choose what command to use for a given desktop shell = name (GNOME, UNITY, KDE, XFCE4, LXDE, TRINITY, MATE, OPENBOX, ICEWM) =20 -# NOTES on GNOME startup behaviour in different distributions -# =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D - -# Debian and every other non-Ubuntu distro launchs GNOME3 (in accelerated = mode) when calling gnome-session - -# Ubuntu launches Unity (in accelerated mode) when calling gnome-session. -# To make the GNOME variants start up properly on Ubuntu, we have to make = the following differentiations - -# Ubuntu 10.10 and earlier (maverick): -# GNOME -> gnome-session -# (would start GNOME2) -# Ubuntu 11.04 (natty): -# GNOME -> gnome-session --session=3D2d-gnome -# UNITY -> gnome-session --session=3D2d-ubuntu -# (GNOME3 based desktop shells) -# Ubuntu 11.10 (oneiric) & 12.04 (precise): -# GNOME -> gnome-session --session=3Dgnome-fallback -# UNITY -> gnome-session --session=3Dubuntu-2d -# (GNOME3 based desktop shells) -# Ubuntu 12.10 (quantal): -# GNOME -> gnome-session --session=3Dgnome-fallback -# UNITY -> gnome-session --session=3Dubuntu -# (GNOME3 based desktop shells) -# Ubuntu 13.10 (raring) and later: -# GNOME -> gnome-session --session=3Dgnome-flashback -# UNITY -> gnome-session --session=3Dubuntu -# (GNOME3 based desktop shells) -# Additionally, $GTK_MODULES must include "unity-gtk-module". -# $GTK_MODULES does not need tha value for any other distro -# or any earlier release of Ubuntu. -# -# The logic for launching GNOME should be generic enough -# to work with every other distro. -# -# Also, it appears that some Linux GNOME2 distros need DESKTOP_SESSION= =3D"gnome" -# while others do not. +# Use the gnome-session logic to launch a Unity 2D or Cinnamon 2D session. +# Fall back to GNOME if the chosen session isn't available. +if [ "$cmd" =3D=3D "UNITY" ] || [ "$cmd" =3D=3D "unity" ]; then + x2go_xsession=3Dubuntu-2d + cmd=3D"gnome-session" +elif [ "$cmd" =3D=3D "CINNAMON" ] || [ "$cmd" =3D=3D "cinnamon" ]; then + x2go_xsession=3Dcinnamon2d + cmd=3D"gnome-session" +fi =20 if [ "$cmd" =3D=3D "GNOME" ] || [ "$cmd" =3D=3D "gnome-session" ]; then - cmd=3D"/usr/bin/gnome-session" - if [ "$DISTRIB_ID" =3D=3D "Ubuntu" ] && [ "$(echo "$DISTRIB_RELEASE >=3D = 13.10" | bc)" =3D=3D "1" ]; then - export DESKTOP_SESSION=3D"gnome-flashback" - if [ -z "$GTK_MODULES" ] ; then - export GTK_MODULES=3D"unity-gtk-module" - else - export GTK_MODULES=3D"$GTK_MODULES:unity-gtk-module" + # Try to pick an appropriate session file, and take settings from it. + for session in "$x2go_xsession" gnome-flashback-metacity gnome-fallback g= nome-2d gnome; do + session_desktop=3D/usr/share/xsessions/"$session".desktop + if [ -f "$session_desktop" ]; then + # Run the command specified in the session file. + cmd=3D"$(sed -n 's/^Exec=3D//p' "$session_desktop")" + + # Use gnome-session's --disable-acceleration-check option if available. + # The Exec=3D line might already include it. That's OK. + if $cmd --help | grep -q -- --disable-acceleration-check; then + cmd=3D"$cmd --disable-acceleration-check" + fi + + # Set DESKTOP_SESSION and GDMSESSION to the base name of the session fi= le. + export DESKTOP_SESSION=3D"$session" + export GDMSESSION=3D"$session" + + # Try to set a reasonable XDG_CURRENT_DESKTOP. + # gnome-session will overwrite this, but on recent Ubuntu, some helpers= are started by upstart instead of gnome-session. + # DesktopNames field is ;-separated. XDG_CURRENT_DESKTOP should be :-se= parated. + desktopname=3D"$(sed -n '/^DesktopNames=3D/ { s/^DesktopNames=3D//; s/;= /:/g; s/:$//; p; }' "$session_desktop")" + # Before DesktopNames was standardized, a few Ubuntu releases used X-Li= ghtDM-DesktopName. + if [ -z "$desktopname" ]; then + desktopname=3D"$(sed -n 's/^X-LightDM-DesktopName=3D//p' "$session_des= ktop")" + fi + # Only export the variable if set by some session file. + if [ -n "$desktopname" ]; then + export XDG_CURRENT_DESKTOP=3D"$desktopname" + fi + break fi - args=3D" --session=3D$DESKTOP_SESSION" - elif [ -e /usr/share/gnome-session/sessions/gnome-flashback.sessio= n ]; then - export DESKTOP_SESSION=3D"gnome-flashback" - args=3D" --session=3D$DESKTOP_SESSION" - elif [ -e /usr/share/gnome-session/sessions/gnome-fallback.session= ]; then - export DESKTOP_SESSION=3D"gnome-fallback" - args=3D" --session=3D$DESKTOP_SESSION" - elif [ -e /usr/share/gnome-session/sessions/2d-gnome.session ]; th= en - export DESKTOP_SESSION=3D"2d-gnome" - args=3D" --session=3D$DESKTOP_SESSION" - elif [ "$DISTRIB_ID" =3D=3D "Ubuntu" ] && [ "$(echo "$DISTRIB_RELE= ASE <=3D 10.10" | bc)" =3D=3D "1" ]; then - export DESKTOP_SESSION=3D"gnome" - elif cat /etc/debian_version | egrep "^(squeeze|6\.).*" >/dev/null; then - export DESKTOP_SESSION=3D"gnome" - fi - -elif ([ "$cmd" =3D=3D "UNITY" ] || [ "$cmd" =3D=3D "unity" ]); then - cmd=3D"/usr/bin/gnome-session" - if [ "$DISTRIB_ID" =3D=3D "Ubuntu" ] && [ "$(echo "$DISTRIB_RELEASE >=3D = 12.10" | bc)" =3D=3D "1" ]; then - export DESKTOP_SESSION=3D"ubuntu" - args=3D" --session=3D$DESKTOP_SESSION" - elif [ "$DISTRIB_ID" =3D=3D "Ubuntu" ] && [ "$(echo "$DISTRIB_RELEASE =3D= =3D 11.10" | bc)" =3D=3D "1" -o "$(echo "$DISTRIB_RELEASE =3D=3D 12.04" | b= c)" =3D=3D "1" ]; then - export DESKTOP_SESSION=3D"ubuntu-2d" - args=3D" --session=3D$DESKTOP_SESSION" - elif [ "$DISTRIB_ID" =3D=3D "Ubuntu" ] && [ "$(echo "$DISTRIB_RELEASE =3D= =3D 11.04" | bc)" =3D=3D "1" ]; then - export DESKTOP_SESSION=3D"2d-ubuntu" - args=3D" --session=3D$DESKTOP_SESSION" - fi - # on earlier Ubuntu versions or with non-Ubuntu Distros the ,,UNITY'' com= mand in X2Go will launch the GNOME2 desktop shell - -elif ([ "$cmd" =3D=3D "CINNAMON" ] || [ "$cmd" =3D=3D "cinnamon" ]); then - # Cinnamon 2.0 and newer - # The cmd is a script that calls the "cinnamon-session" binary. - if [ -e /usr/bin/cinnamon-session-cinnamon2d ]; then - cmd=3D"/usr/bin/cinnamon-session-cinnamon2d" - # Cinnamon 1.6 & 1.8 - # The cmd is a script that calls the "gnome-session" binary. - elif [ -e /usr/bin/gnome-session-cinnamon2d ]; then - cmd=3D"/usr/bin/gnome-session-cinnamon2d" - # Cinnamon 1.4 - # The cmd is a script that calls the "gnome-session" binary. - elif [ -e /usr/bin/gnome-session-cinnamon ]; then - cmd=3D"/usr/bin/gnome-session-cinnamon" - # Fallback to the old behavior. - else - cmd=3D"/usr/bin/gnome-session" - export DESKTOP_SESSION=3D"cinnamon2d" - args=3D" --session=3D$DESKTOP_SESSION" - fi + done =20 elif [ "$cmd" =3D=3D "MATE" ]; then cmd=3D"/usr/bin/mate-session" @@ -293,7 +236,8 @@ if [ "$EXEC" !=3D "" ] && [ -x "$EXEC" ]; then if x2gofeature X2GO_XSESSION &>/dev/null && [ "x$X2GO_SESS_TYPE" =3D "xD"= ]; then STARTUP=3D"$cmd$args" "$X2GO_LIB_PATH/x2gosyslog" "$0" "notice" "launching session with Xsessi= on-x2go mechanism, using STARTUP=3D\"$STARTUP\"" - XSESSION_EXEC=3D"$cmd" STARTUP=3D"/usr/bin/env LD_LIBRARY_PATH=3D${LD_LI= BRARY_PATH} ${STARTUP}" /etc/x2go/Xsession + # LightDM passes the session command as an argument to the session wrapp= er. Some Ubuntu Xsession.d scripts depend on that. + XSESSION_EXEC=3D"$cmd" STARTUP=3D"/usr/bin/env LD_LIBRARY_PATH=3D${LD_LI= BRARY_PATH} ${STARTUP}" /etc/x2go/Xsession "$cmd" else "$X2GO_LIB_PATH/x2gosyslog" "$0" "debug" "executing command \"$cmd$args\= "..." =20 --=20 1.9.1 --X1bOJ3K7DJ5YkBrT Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0001-Launch-gnome-session-using-settings-from-the-session.patch.diff" diff -u b/x2goserver/bin/x2goruncommand b/x2goserver/bin/x2goruncommand --- b/x2goserver/bin/x2goruncommand +++ b/x2goserver/bin/x2goruncommand @@ -116,12 +116,15 @@ # Try to set a reasonable XDG_CURRENT_DESKTOP. # gnome-session will overwrite this, but on recent Ubuntu, some helpers are started by upstart instead of gnome-session. # DesktopNames field is ;-separated. XDG_CURRENT_DESKTOP should be :-separated. - export XDG_CURRENT_DESKTOP="$(sed -n '/^DesktopNames=/ { s/^DesktopNames=//; s/;/:/g; s/:$//; p; }' "$session_desktop")" + desktopname="$(sed -n '/^DesktopNames=/ { s/^DesktopNames=//; s/;/:/g; s/:$//; p; }' "$session_desktop")" # Before DesktopNames was standardized, a few Ubuntu releases used X-LightDM-DesktopName. - if [ -z "$XDG_CURRENT_DESKTOP" ]; then - export XDG_CURRENT_DESKTOP="$(sed -n 's/^X-LightDM-DesktopName=//p' "$session_desktop")" + if [ -z "$desktopname" ]; then + desktopname="$(sed -n 's/^X-LightDM-DesktopName=//p' "$session_desktop")" + fi + # Only export the variable if set by some session file. + if [ -n "$desktopname" ]; then + export XDG_CURRENT_DESKTOP="$desktopname" fi - break fi done --X1bOJ3K7DJ5YkBrT-- --s2ZSL+KKDSLx8OML Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJVDJtOAAoJECKfzxL11mu2LmEP/ik2e2ybuOfinQVjkkp8CW5d ghAZfnoYBwrgNXCSbhsVt9ud1yM6MHr2g4Lc9+J/jycpn3NMCj16SH3BFIO3BsK1 cV1xph0aVHVwvRvry9mTVd6OLgpSf1pXppdrx5b63CnRhzmYNdV4OeEePx2wWQpR U88jClzrOeEgwOHC9NgjBasxu8ZN9KFxSbWBA9R4XwgNXftM23OJCSGQoChiQmvR Vv4iwctpu0mNkKQPd9Prh6Jq5HLKj5wStfZ0nSPnUJ2b+gNW23518wxbB78s/SsR 6HnOxN13e/Rx05tn34ncn34vR53SSZlsczKjCodKNvncFS1lR6e/dmJHgI1hqvkk 3KglH2siFbHGjicYl/ambMo7ddB61W8v/NOxtGSsxMF9owvGGEPGMF1A6/VPNxG9 h/4yWjRlkFSwZNFUz4sPs5/IFUdHhDPcRPZOqz7y3PEeaxW+5FT21VTMAU3wVAWT tKWemKOP0OAQT3C2UGEkGCVNUGdah2IjtiWSZsE03W0/9sKFEt5Hs7FGmZnQdp9a LFFUZIFbVZMiMNTDnYo72g0UOO4NHg9raxvD8a5SAjLrazs0F6iZOd15kcFtwc1/ WS9zB8FFY/m3Y4FaJYASfnZ6ClRVJ+CP/XKyJVK4ELnV0+R2KT9zahOgdwWwh+y+ WBsvlw31w6Ja2eLfI2e7 =Osuw -----END PGP SIGNATURE----- --s2ZSL+KKDSLx8OML--