From 0319d1c7997396aca8596467a2f63329b967b188 Mon Sep 17 00:00:00 2001 From: Simon Long Date: Mon, 9 May 2022 11:08:44 +0100 Subject: [PATCH] Make Wayland switching more robust --- debian/changelog | 6 ++++++ raspi-config | 14 +++++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index d8584160..74d2ade2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +raspi-config (20220506) bullseye; urgency=medium + + * Modify Wayland switching to work with AccountSettings + + -- Simon Long Fri, 06 May 2022 14:07:57 +0100 + raspi-config (20220425) bullseye; urgency=medium * Tidy hardware detection functions diff --git a/raspi-config b/raspi-config index e9f41042..25f8e4e1 100755 --- a/raspi-config +++ b/raspi-config @@ -2035,7 +2035,7 @@ do_glamor() { do_wayland() { DEFAULT=--defaultno CURRENT=0 - if grep -q "^user-session=LXDE-pi" /etc/lightdm/lightdm.conf ; then + if grep -q "^user-session=LXDE-pi-wayland" /etc/lightdm/lightdm.conf ; then DEFAULT= CURRENT=1 fi @@ -2049,10 +2049,18 @@ do_wayland() { ASK_TO_REBOOT=1 fi if [ $RET -eq 0 ]; then - sed /etc/lightdm/lightdm.conf -i -e "s/^#\\?user-session.*/user-session=LXDE-pi/" + sed /etc/lightdm/lightdm.conf -i -e "s/^#\\?user-session.*/user-session=LXDE-pi-wayland/" + sed /etc/lightdm/lightdm.conf -i -e "s/^#\\?autologin-session.*/autologin-session=LXDE-pi-wayland/" + if [ -e "/var/lib/AccountsService/users/$USER" ] ; then + sed "/var/lib/AccountsService/users/$USER" -i -e "s/XSession=.*/XSession=LXDE-pi-wayland/" + fi STATUS=enabled elif [ $RET -eq 1 ]; then - sed /etc/lightdm/lightdm.conf -i -e "s/user-session.*/#user-session=LXDE-pi/" + sed /etc/lightdm/lightdm.conf -i -e "s/^#\\?user-session.*/user-session=LXDE-pi-x/" + sed /etc/lightdm/lightdm.conf -i -e "s/^#\\?autologin-session.*/autologin-session=LXDE-pi-x/" + if [ -e "/var/lib/AccountsService/users/$USER" ] ; then + sed "/var/lib/AccountsService/users/$USER" -i -e "s/XSession=.*/XSession=LXDE-pi-x/" + fi STATUS=disabled else return $RET