Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:15.4:ARM
sddm
0001-Read-the-DISPLAYMANAGER_AUTOLOGIN-value-fr...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0001-Read-the-DISPLAYMANAGER_AUTOLOGIN-value-from-sysconf.patch of Package sddm
From 392b0353f31c1a68520857657660fdbfad7ed755 Mon Sep 17 00:00:00 2001 From: Hrvoje Senjan <hrvoje.senjan@gmail.com> Date: Sat, 2 Sep 2017 11:27:01 +0200 Subject: [PATCH] Read the DISPLAYMANAGER_AUTOLOGIN value from sysconfig/displaymanager Support DISPLAYMANAGER_AUTOLOGIN entry from /etc/sysconfig/displaymanager, the value overwrites any entry in sddm.conf/[Autologin]/User. Patch also defaults to default.desktop as default autologin session. This is controlled only by sddm.conf file. --- CMakeLists.txt | 1 + src/common/Configuration.h | 5 +++-- src/common/Constants.h.in | 1 + src/daemon/Display.cpp | 6 ++++++ 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fc3f2ce..b6b9237 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -197,6 +197,7 @@ set(WAYLAND_SESSION_COMMAND "${DATA_INSTALL_DIR}/scripts/wayland-session" set(CONFIG_FILE "${CMAKE_INSTALL_FULL_SYSCONFDIR}/sddm.conf" CACHE PATH "Path of the sddm config file") set(CONFIG_DIR "${CMAKE_INSTALL_FULL_SYSCONFDIR}/sddm.conf.d" CACHE PATH "Path of the sddm config directory") set(SYSTEM_CONFIG_DIR "${CMAKE_INSTALL_PREFIX}/lib/sddm/sddm.conf.d" CACHE PATH "Path of the system sddm config directory") +set(DISPLAY_MANAGER_CONFIG_FILE "${CMAKE_INSTALL_FULL_SYSCONFDIR}/sysconfig/displaymanager" CACHE PATH "Path of the sysconfig/displaymanager config file") set(LOG_FILE "${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/log/sddm.log" CACHE PATH "Path of the sddm log file") set(DBUS_CONFIG_FILENAME "org.freedesktop.DisplayManager.conf" CACHE STRING "Name of the sddm config file") set(COMPONENTS_TRANSLATION_DIR "${DATA_INSTALL_DIR}/translations" CACHE PATH "Components translations directory") diff --git a/src/common/Configuration.h b/src/common/Configuration.h index a7e0585..ff314a7 100644 --- a/src/common/Configuration.h +++ b/src/common/Configuration.h @@ -94,14 +94,15 @@ namespace SDDM { Section(Autologin, Entry(User, QString, QString(), _S("Username for autologin session")); - Entry(Session, QString, QString(), _S("Name of session file for autologin session (if empty try last logged in)")); + Entry(Session, QString, _S("default.desktop"), _S("Name of session file for autologin session (if empty try last logged in)")); + Entry(Relogin, bool, false, _S("Whether sddm should automatically log back into sessions when they exit")); ); ); Config(StateConfig, []()->QString{auto tmp = getpwnam("sddm"); return tmp ? QString::fromLocal8Bit(tmp->pw_dir) : QStringLiteral(STATE_DIR);}().append(QStringLiteral("/state.conf")), QString(), QString(), Section(Last, - Entry(Session, QString, QString(), _S("Name of the session for the last logged-in user.\n" + Entry(Session, QString, _S("/usr/share/xsessions/default.desktop"), _S("Name of the session for the last logged-in user.\n" "This session will be preselected when the login screen appears.")); Entry(User, QString, QString(), _S("Name of the last logged-in user.\n" "This user will be preselected when the login screen appears")); diff --git a/src/common/Constants.h.in b/src/common/Constants.h.in index f09858c..098c77b 100644 --- a/src/common/Constants.h.in +++ b/src/common/Constants.h.in @@ -35,6 +35,7 @@ #define CONFIG_FILE "@CONFIG_FILE@" #define CONFIG_DIR "@CONFIG_DIR@" #define SYSTEM_CONFIG_DIR "@SYSTEM_CONFIG_DIR@" +#define DISPLAY_MANAGER_CONFIG_FILE "@DISPLAY_MANAGER_CONFIG_FILE@" #define LOG_FILE "@LOG_FILE@" #define PID_FILE "@PID_FILE@" diff --git a/src/daemon/Display.cpp b/src/daemon/Display.cpp index b95f6e5..e3a5566 100644 --- a/src/daemon/Display.cpp +++ b/src/daemon/Display.cpp @@ -35,6 +35,7 @@ #include <QFile> #include <QTimer> #include <QLocalSocket> +#include <QSettings> #include <pwd.h> #include <unistd.h> @@ -143,6 +144,11 @@ namespace SDDM { // log message qDebug() << "Display server started."; + QSettings sysconfSettings(QStringLiteral(DISPLAY_MANAGER_CONFIG_FILE), QSettings::NativeFormat); + QString sysconfigUser = sysconfSettings.value(QStringLiteral("DISPLAYMANAGER_AUTOLOGIN"), QStringLiteral("")).toString(); + + mainConfig.Autologin.User.set(sysconfigUser); + if ((daemonApp->first || mainConfig.Autologin.Relogin.get()) && !mainConfig.Autologin.User.get().isEmpty()) { // reset first flag -- 2.25.1
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor