From 8bd160852a36aee3f1442752cf3381ca6f51630a Mon Sep 17 00:00:00 2001 From: Neal Gompa Date: Fri, 23 Apr 2021 00:45:10 -0400 Subject: [PATCH] Simplify to creating/deleting the flag file in the udev rule (#1952431) --- 61-sddm-plasmawayland.rules | 3 ++- sddm-disable-plasmawayland.sh | 38 ----------------------------------- sddm.spec | 8 ++++---- 3 files changed, 6 insertions(+), 43 deletions(-) delete mode 100644 sddm-disable-plasmawayland.sh diff --git a/61-sddm-plasmawayland.rules b/61-sddm-plasmawayland.rules index 8a6a235..35e18b3 100644 --- a/61-sddm-plasmawayland.rules +++ b/61-sddm-plasmawayland.rules @@ -1,2 +1,3 @@ # disable Wayland if modesetting is disabled -IMPORT{cmdline}="nomodeset", RUN+="/usr/libexec/sddm-disable-plasmawayland" +RUN+="/usr/bin/rm -f /etc/sddm/hide-wayland-sessions" +IMPORT{cmdline}="nomodeset", RUN+="/usr/bin/touch /etc/sddm/hide-wayland-sessions" diff --git a/sddm-disable-plasmawayland.sh b/sddm-disable-plasmawayland.sh deleted file mode 100644 index cf626db..0000000 --- a/sddm-disable-plasmawayland.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash - -# Copyright (C) 2021 Neal Gompa -# -# Fedora-License-Identifier: MIT -# SPDX-2.0-License-Identifier: MIT -# SPDX-3.0-License-Identifier: MIT -# -# This program is free software. -# For more information on free software, see -# . - -# This script rewrites SDDM configuration to switch from Wayland to X11 in the event -# Plasma Wayland session is not desired. - - -# Determine whether Plasma Wayland is the default session -WAYLAND_DEFAULT=1 -X11_SESSION_NAME="plasmax11.desktop" - -if [ -f "/usr/share/xsessions/plasma.desktop" ]; then - # We're in a world before Plasma Wayland is default - WAYLAND_DEFAULT=0 - X11_SESSION_NAME="plasma.desktop" -fi - -# If autologin is configured, force back to X11 session -if [ -f "/etc/sddm.conf" ]; then - sed -e "s|^Session=plasma.*|Session=${X11_SESSION_NAME}|" -i /etc/sddm.conf -fi - -# If previous session was Wayland, set it to X11 now -if [ -f "/var/lib/sddm/state.conf" ]; then - sed -e "s|^Session=/usr/share/wayland-sessions/plasma.*|Session=/usr/share/xsessions/${X11_SESSION_NAME}|" -i /var/lib/sddm/state.conf -fi - -# Tell SDDM that Wayland sessions are to be hidden -touch /etc/sddm/hide-wayland-sessions diff --git a/sddm.spec b/sddm.spec index 3798913..265b9c2 100644 --- a/sddm.spec +++ b/sddm.spec @@ -9,7 +9,7 @@ Name: sddm Version: 0.19.0 -Release: 12%{?dist} +Release: 13%{?dist} License: GPLv2+ Summary: QML based X11 desktop manager @@ -64,7 +64,6 @@ Source15: README.scripts Source16: sddm.sysconfig # udev rules for disabling plasma-wayland in broken scenarios Source17: 61-sddm-plasmawayland.rules -Source18: sddm-disable-plasmawayland.sh Provides: service(graphical-login) = sddm @@ -164,7 +163,6 @@ rm -fv %{buildroot}%{_sysconfdir}/sddm/Xsession # Add auto-fallback hack for when modesetting isn't available (#1952431) install -Dpm 644 %{SOURCE17} %{buildroot}%{_udevrulesdir}/61-sddm-plasmawayland.rules -install -Dpm 755 %{SOURCE18} %{buildroot}%{_libexecdir}/sddm-disable-plasmawayland # ghost file for runtime wayland session hide flag touch %{buildroot}%{_sysconfdir}/sddm/hide-wayland-sessions @@ -237,7 +235,6 @@ fi %{_libexecdir}/sddm-helper %{_tmpfilesdir}/sddm.conf %{_udevrulesdir}/61-sddm-plasmawayland.rules -%{_libexecdir}/sddm-disable-plasmawayland %ghost %{_sysconfdir}/sddm/hide-wayland-sessions %attr(0711, root, sddm) %dir %{_localstatedir}/run/sddm %attr(1770, sddm, sddm) %dir %{_localstatedir}/lib/sddm @@ -262,6 +259,9 @@ fi %changelog +* Fri Apr 23 2021 Neal Gompa - 0.19.0-13 +- Simplify to creating/deleting the flag file in the udev rule (#1952431) + * Thu Apr 22 2021 Neal Gompa - 0.19.0-12 - Enable hiding Wayland sessions with a flag file (#1952431)