Talk:SDDM

From Gentoo Wiki
Jump to:navigation Jump to:search
Note
Before creating a discussion or leaving a comment, please read about using talk pages. To create a new discussion, click here. Comments on an existing discussion should be signed using ~~~~:
A comment [[User:Larry|Larry]] 13:52, 13 May 2024 (UTC)
: A reply [[User:Sally|Sally]] 00:53, 12 January 2025 (UTC)
:: Your reply ~~~~

Video group

Talk status
This discussion is done.

The user 'sddm' needs to be in the 'video' group to prevent these kinds of errors:

/var/log/Xorg.0.log.old:[ 2058.998] (EE) /dev/dri/card0: failed to set DRM interface version 1.4: Permission denied /var/log/Xorg.0.log.old:[ 2061.229] (EE) intel(0): [drm] failed to set drm interface version: Permission denied [13].

Hi Adsicks ,
I have added a Troubleshooting section to the main article that should help with this error. In the future feel free to so such a thing yourself; if your not sure where to start see the Help link at the top of the wiki. Also, please be sure to sign the comments you leave on discussion pages. Kind regards, --Maffblaster (talk) 06:13, 1 May 2016 (UTC)

Translation

Talk status
This discussion is done.

Hi,

I'd like to translate this page into German, but it seems like this isn't possible at the moment. Can this be changed ?

Kind regards, H0rn (talk) 10:23, 26 April 2018 (UTC)H0rn

Well, after more than 5 years, article now can be translated. --Winterheart (talk) 16:27, 9 May 2023 (UTC)

Config files

Talk status
This discussion is still ongoing.

This article is a little confusing because it mixes 0.18 and pre-0.18 config file locations. I tried to fix it. I think maybe everything after Prior to 0.8 should be deleted (in that section). I just installed 0.18 and I didn't have to change anything in /usr/share/sddm/. It looks like ARM is maybe using an older version? I was too chicken to delete it. Garbanzo (talk) 06:01, 17 September 2018 (UTC)

How to make SDDM use VT7 (or any you chose) again…

I’ve written a little patch, that defaults SDDM to VT7 again, and lets you configure the VT with an option VT under [General] again:

FILE /etc/portage/patches/x11-misc/sddm/VT_configurable_again.patch
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 690ee70..bdd01ac 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -189,7 +189,7 @@ set(SYSTEM_CONFIG_DIR           "${CMAKE_INSTALL_PREFIX}/lib/sddm/sddm.conf.d"
 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-qt${QT_MAJOR_VERSION}" CACHE PATH      "Components translations directory")
-set(SDDM_INITIAL_VT             "1"                                                 CACHE STRING    "Initial tty to use")
+set(SDDM_INITIAL_VT             "7"                                                 CACHE STRING    "Initial tty to use")
 
 
 # Autodetect UID_MIN and UID_MAX from /etc/login.defs
diff --git a/data/man/sddm.conf.rst.in b/data/man/sddm.conf.rst.in
index 0d00919..356205f 100644
--- a/data/man/sddm.conf.rst.in
+++ b/data/man/sddm.conf.rst.in
@@ -47,6 +47,10 @@ OPTIONS
        Default value is "x11".
        For `x11-user` you might need to configure Xorg.wrap(1).
 
+`VT=`
+        The VT that SDDM **MUST** start on.
+        Default value is @SDDM_INITITIAL_VT@
+
 `HaltCommand=`
        Halt command.
        Default value is "@HALT_COMMAND@".
@@ -150,12 +154,6 @@ OPTIONS
        is "x11", otherwise as sddm user.
        Default value is "@DATA_INSTALL_DIR@/scripts/Xstop".
 
-`MinimumVT=`
-       Minimum virtual terminal number that will be used
-       by the first display. Virtual terminal number will
-       increase as new displays added.
-       This setting is no longer available since SDDM v0.20.
-
 `EnableHiDPI=`
        Enables Qt's automatic HiDPI scaling.
        Can be either "true" or "false".
diff --git a/src/common/Configuration.h b/src/common/Configuration.h
index 4c3572d..43d0643 100644
--- a/src/common/Configuration.h
+++ b/src/common/Configuration.h
@@ -40,6 +40,7 @@ namespace SDDM {
         // TODO: Change default to x11-user in a future release
         Entry(DisplayServer,       QString,     _S("x11"),                                      _S("Which display server should be used.\n"
                                                                                                    "Valid values are: x11, x11-user, wayland. Wayland support is experimental"));
+        Entry(VT,                  int,         DEFAULT_VT,                                     _S("The VT that SDDM MUST start on."));
         Entry(HaltCommand,         QString,     _S(HALT_COMMAND),                               _S("Halt command"));
         Entry(RebootCommand,       QString,     _S(REBOOT_COMMAND),                             _S("Reboot command"));
         Entry(Numlock,             NumState,    NUM_NONE,                                       _S("Initial NumLock state. Can be on, off or none.\n"
diff --git a/src/daemon/Display.cpp b/src/daemon/Display.cpp
index 1a0a369..e4b2fb7 100644
--- a/src/daemon/Display.cpp
+++ b/src/daemon/Display.cpp
@@ -77,14 +77,8 @@ namespace SDDM {
     }
 
     int fetchAvailableVt() {
-        if (!isTtyInUse(QStringLiteral("tty" STRINGIFY(SDDM_INITIAL_VT)))) {
-            return SDDM_INITIAL_VT;
-        }
-        const auto vt = VirtualTerminal::currentVt();
-        if (vt > 0 && !isTtyInUse(QStringLiteral("tty%1").arg(vt))) {
-            return vt;
-        }
-        return VirtualTerminal::setUpNewVt();
+        return mainConfig.VT.get();
     }
 
     Display::DisplayServerType Display::defaultDisplayServerType()
@@ -114,24 +108,16 @@ namespace SDDM {
         m_greeter(new Greeter(this))
     {
         // Create display server
+        if (seat()->canTTY()) { m_terminalId = fetchAvailableVt(); }
         switch (m_displayServerType) {
         case X11DisplayServerType:
-            if (seat()->canTTY()) {
-                m_terminalId = VirtualTerminal::setUpNewVt();
-            }
             m_displayServer = new XorgDisplayServer(this);
             break;
         case X11UserDisplayServerType:
-            if (seat()->canTTY()) {
-                m_terminalId = fetchAvailableVt();
-            }
             m_displayServer = new XorgUserDisplayServer(this);
             m_greeter->setDisplayServerCommand(XorgUserDisplayServer::command(this));
             break;
         case WaylandDisplayServerType:
-            if (seat()->canTTY()) {
-                m_terminalId = fetchAvailableVt();
-            }
             m_displayServer = new WaylandDisplayServer(this);
             m_greeter->setDisplayServerCommand(mainConfig.Wayland.CompositorCommand.get());
             break;
diff --git a/README.md b/README.md
index 6f393cb..f79e3a0 100644
--- a/README.md
+++ b/README.md
@@ -51,10 +51,9 @@ might be experienced.
 ## VIRTUAL TERMINALS
 
 SDDM is assumed to start at the tty specified by the cmake variable
-SDDM_INITIAL_VT which is an integer and defaults to 1.
+SDDM_INITIAL_VT which is an integer and defaults to 7.
 
-If SDDM_INITIAL_VT wasn't available, SDDM will use the next available one
-instead.
+If SDDM_INITIAL_VT wasn't available, SDDM will use VT 7 instead.
 
 You can override SDDM_INITIAL_VT if you want to have a different one if,
 for example, you were planning on using tty1 for something else.
diff --git a/src/common/Constants.h.in b/src/common/Constants.h.in
index 405da5e..9eb6319 100644
--- a/src/common/Constants.h.in
+++ b/src/common/Constants.h.in
@@ -45,4 +45,6 @@
 #define HALT_COMMAND "@HALT_COMMAND@"
 #define REBOOT_COMMAND "@REBOOT_COMMAND@"
 
+#define DEFAULT_VT                  @SDDM_INITIAL_VT@
+
 #endif // SDDM_CONSTANTS_H