Update: Added support for user's full name (GECOS) and removed AllowUppercaseLettersInUsernames option in config, fixed many typos.

This commit is contained in:
Keyitdev
2026-07-06 17:50:44 +02:00
parent 17a4461b6c
commit 292c87b770
19 changed files with 201 additions and 136 deletions
+54 -9
View File
@@ -15,6 +15,31 @@ Column {
property ComboBox exposeSession: sessionSelect.exposeSession
property bool failed
function triggerLogin() {
var typedUser = username.text
var targetUser = typedUser
if (config.UseRealName == "true") {
for (var i = 0; i < userRegistry.list.length; i++) {
var u = userRegistry.list[i]
if (typedUser === u.realName || typedUser === u.name) {
targetUser = u.name
break
}
}
} else {
for (var j = 0; j < userRegistry.list.length; j++) {
var u2 = userRegistry.list[j]
if (typedUser === u2.name) {
targetUser = u2.name
break
}
}
}
sddm.login(targetUser, password.text, sessionSelect.selectedSession)
}
Item {
id: errorMessageField
@@ -81,10 +106,13 @@ Column {
model: userModel
currentIndex: model.lastIndex
textRole: "name"
textRole: config.UseRealName == "true" ? "realName" : "name"
valueRole: "name"
hoverEnabled: true
displayText: config.UseRealName == "true" ? (currentText ? currentText : currentValue) : currentText
onActivated: {
username.text = currentText
username.text = displayText
}
property var popkey: config.RightToLeftLayout == "true" ? Qt.Key_Right : Qt.Key_Left
@@ -106,9 +134,9 @@ Column {
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
text: model.name
text: config.UseRealName == "true" ? (model.realName || model.name) : model.name
font.pointSize: root.font.pointSize * 0.8
font.capitalization: Font.AllLowercase
font.capitalization: Font.MixedCase
font.family: root.font.family
color: config.DropdownTextColor
}
@@ -220,10 +248,10 @@ Column {
horizontalAlignment: TextInput.AlignHCenter
z: 1
text: config.ForceLastUser == "true" ? selectUser.currentText : null
text: config.ForceLastUser == "true" ? selectUser.displayText : null
color: config.LoginFieldTextColor
font.bold: true
font.capitalization: config.AllowUppercaseLettersInUsernames == "false" ? Font.AllLowercase : Font.MixedCase
font.capitalization: Font.MixedCase
placeholderText: config.TranslatePlaceholderUsername || textConstants.userName
placeholderTextColor: config.PlaceholderTextColor
selectByMouse: true
@@ -242,7 +270,7 @@ Column {
radius: config.RoundCorners || 0
}
onAccepted: config.AllowUppercaseLettersInUsernames == "false" ? sddm.login(username.text.toLowerCase(), password.text, sessionSelect.selectedSession) : sddm.login(username.text, password.text, sessionSelect.selectedSession)
onAccepted: triggerLogin()
KeyNavigation.down: passwordIcon
states: [
@@ -369,7 +397,7 @@ Column {
border.width: parent.activeFocus ? 2 : 1
radius: config.RoundCorners || 0
}
onAccepted: config.AllowUppercaseLettersInUsernames == "false" ? sddm.login(username.text.toLowerCase(), password.text, sessionSelect.selectedSession) : sddm.login(username.text, password.text, sessionSelect.selectedSession)
onAccepted: triggerLogin()
KeyNavigation.down: loginButton
}
@@ -502,7 +530,7 @@ Column {
}
]
onClicked: config.AllowUppercaseLettersInUsernames == "false" ? sddm.login(username.text.toLowerCase(), password.text, sessionSelect.selectedSession) : sddm.login(username.text, password.text, sessionSelect.selectedSession)
onClicked: triggerLogin()
Keys.onReturnPressed: clicked()
Keys.onEnterPressed: clicked()
@@ -510,6 +538,23 @@ Column {
}
}
Item {
id: userRegistry
visible: false
property var list: []
Repeater {
model: userModel
Item {
Component.onCompleted: {
var currentList = userRegistry.list
currentList.push({ "name": model.name, "realName": model.realName || "" })
userRegistry.list = currentList
}
}
}
}
Connections {
target: sddm
function onLoginSucceeded() {}
+8 -6
View File
@@ -23,7 +23,7 @@ DateFormat="dddd d MMMM"
# Default Locale.LongFormat.
HeaderText=""
# You can put somehting fun.
# You can put something fun.
#################### Background ####################
@@ -49,7 +49,7 @@ DimBackground="0.0"
CropBackground="true"
# Default false.
# Crop or fit background.
# Connected with: BackgroundHorizontalAlignment and BackgroundVerticalAlignment dosn't work when set to true.
# Connected with: BackgroundHorizontalAlignment and BackgroundVerticalAlignment doesn't work when set to true.
BackgroundHorizontalAlignment="center"
# Default: center, Options: left, center, right.
# Horizontal position of the background picture.
@@ -130,16 +130,18 @@ HideVirtualKeyboard="false"
HideSystemButtons="false"
HideLoginButton="false"
UseRealName="true"
# If set to true, the user's real name (GECOS) is displayed instead of the account username. Users can log in using either their username or real name. If set to false, users can log in only with their username.
# Warning: If two or more accounts have the same real name, they cannot be distinguished during login. In that case, it is recommended to set this option to `false`.
ForceLastUser="true"
# If set to true last successfully logged in user appeares automatically in the username field.
# If set to true last successfully logged in user appears automatically in the username field.
PasswordFocus="true"
# Automaticaly focuses password field.
# Automatically focuses password field.
HideCompletePassword="true"
# Hides the password while typing.
AllowEmptyPassword="false"
# Enable login for users without a password.
AllowUppercaseLettersInUsernames="false"
# Do not change this! Uppercase letters are generally not allowed in usernames. This option is only for systems that differ from this standard!
BypassSystemButtonsChecks="false"
# Skips checking if sddm can perform shutdown, restart, suspend or hibernate, always displays all system buttons.
RightToLeftLayout="false"
+8 -6
View File
@@ -23,7 +23,7 @@ DateFormat="dddd d"
# Default Locale.LongFormat.
HeaderText=""
# You can put somehting fun.
# You can put something fun.
#################### Background ####################
@@ -49,7 +49,7 @@ DimBackground="0.0"
CropBackground="true"
# Default false.
# Crop or fit background.
# Connected with: BackgroundHorizontalAlignment and BackgroundVerticalAlignment dosn't work when set to true.
# Connected with: BackgroundHorizontalAlignment and BackgroundVerticalAlignment doesn't work when set to true.
BackgroundHorizontalAlignment="center"
# Default: center, Options: left, center, right.
# Horizontal position of the background picture.
@@ -130,16 +130,18 @@ HideVirtualKeyboard="false"
HideSystemButtons="false"
HideLoginButton="false"
UseRealName="true"
# If set to true, the user's real name (GECOS) is displayed instead of the account username. Users can log in using either their username or real name. If set to false, users can log in only with their username.
# Warning: If two or more accounts have the same real name, they cannot be distinguished during login. In that case, it is recommended to set this option to `false`.
ForceLastUser="true"
# If set to true last successfully logged in user appeares automatically in the username field.
# If set to true last successfully logged in user appears automatically in the username field.
PasswordFocus="true"
# Automaticaly focuses password field.
# Automatically focuses password field.
HideCompletePassword="true"
# Hides the password while typing.
AllowEmptyPassword="false"
# Enable login for users without a password.
AllowUppercaseLettersInUsernames="false"
# Do not change this! Uppercase letters are generally not allowed in usernames. This option is only for systems that differ from this standard!
BypassSystemButtonsChecks="false"
# Skips checking if sddm can perform shutdown, restart, suspend or hibernate, always displays all system buttons.
RightToLeftLayout="false"
+8 -6
View File
@@ -23,7 +23,7 @@ DateFormat="M/dd 2077"
# Default Locale.LongFormat.
HeaderText="Loading ..."
# You can put somehting fun.
# You can put something fun.
#################### Background ####################
@@ -49,7 +49,7 @@ DimBackground="0.0"
CropBackground="true"
# Default false.
# Crop or fit background.
# Connected with: BackgroundHorizontalAlignment and BackgroundVerticalAlignment dosn't work when set to true.
# Connected with: BackgroundHorizontalAlignment and BackgroundVerticalAlignment doesn't work when set to true.
BackgroundHorizontalAlignment="center"
# Default: center, Options: left, center, right.
# Horizontal position of the background picture.
@@ -130,16 +130,18 @@ HideVirtualKeyboard="true"
HideSystemButtons="true"
HideLoginButton="false"
UseRealName="true"
# If set to true, the user's real name (GECOS) is displayed instead of the account username. Users can log in using either their username or real name. If set to false, users can log in only with their username.
# Warning: If two or more accounts have the same real name, they cannot be distinguished during login. In that case, it is recommended to set this option to `false`.
ForceLastUser="true"
# If set to true last successfully logged in user appeares automatically in the username field.
# If set to true last successfully logged in user appears automatically in the username field.
PasswordFocus="true"
# Automaticaly focuses password field.
# Automatically focuses password field.
HideCompletePassword="true"
# Hides the password while typing.
AllowEmptyPassword="false"
# Enable login for users without a password.
AllowUppercaseLettersInUsernames="true"
# Do not change this! Uppercase letters are generally not allowed in usernames. This option is only for systems that differ from this standard!
BypassSystemButtonsChecks="false"
# Skips checking if sddm can perform shutdown, restart, suspend or hibernate, always displays all system buttons.
RightToLeftLayout="false"
+8 -6
View File
@@ -23,7 +23,7 @@ DateFormat="dddd d"
# Default Locale.LongFormat.
HeaderText=""
# You can put somehting fun.
# You can put something fun.
#################### Background ####################
@@ -49,7 +49,7 @@ DimBackground="0.0"
CropBackground="true"
# Default false.
# Crop or fit background.
# Connected with: BackgroundHorizontalAlignment and BackgroundVerticalAlignment dosn't work when set to true.
# Connected with: BackgroundHorizontalAlignment and BackgroundVerticalAlignment doesn't work when set to true.
BackgroundHorizontalAlignment="center"
# Default: center, Options: left, center, right.
# Horizontal position of the background picture.
@@ -130,16 +130,18 @@ HideVirtualKeyboard="false"
HideSystemButtons="true"
HideLoginButton="false"
UseRealName="true"
# If set to true, the user's real name (GECOS) is displayed instead of the account username. Users can log in using either their username or real name. If set to false, users can log in only with their username.
# Warning: If two or more accounts have the same real name, they cannot be distinguished during login. In that case, it is recommended to set this option to `false`.
ForceLastUser="true"
# If set to true last successfully logged in user appeares automatically in the username field.
# If set to true last successfully logged in user appears automatically in the username field.
PasswordFocus="true"
# Automaticaly focuses password field.
# Automatically focuses password field.
HideCompletePassword="true"
# Hides the password while typing.
AllowEmptyPassword="false"
# Enable login for users without a password.
AllowUppercaseLettersInUsernames="false"
# Do not change this! Uppercase letters are generally not allowed in usernames. This option is only for systems that differ from this standard!
BypassSystemButtonsChecks="false"
# Skips checking if sddm can perform shutdown, restart, suspend or hibernate, always displays all system buttons.
RightToLeftLayout="false"
+8 -6
View File
@@ -23,7 +23,7 @@ DateFormat="dddd d"
# Default Locale.LongFormat.
HeaderText=""
# You can put somehting fun.
# You can put something fun.
#################### Background ####################
@@ -49,7 +49,7 @@ DimBackground="0.0"
CropBackground="true"
# Default false.
# Crop or fit background.
# Connected with: BackgroundHorizontalAlignment and BackgroundVerticalAlignment dosn't work when set to true.
# Connected with: BackgroundHorizontalAlignment and BackgroundVerticalAlignment doesn't work when set to true.
BackgroundHorizontalAlignment="center"
# Default: center, Options: left, center, right.
# Horizontal position of the background picture.
@@ -130,16 +130,18 @@ HideVirtualKeyboard="false"
HideSystemButtons="false"
HideLoginButton="false"
UseRealName="true"
# If set to true, the user's real name (GECOS) is displayed instead of the account username. Users can log in using either their username or real name. If set to false, users can log in only with their username.
# Warning: If two or more accounts have the same real name, they cannot be distinguished during login. In that case, it is recommended to set this option to `false`.
ForceLastUser="true"
# If set to true last successfully logged in user appeares automatically in the username field.
# If set to true last successfully logged in user appears automatically in the username field.
PasswordFocus="true"
# Automaticaly focuses password field.
# Automatically focuses password field.
HideCompletePassword="true"
# Hides the password while typing.
AllowEmptyPassword="false"
# Enable login for users without a password.
AllowUppercaseLettersInUsernames="false"
# Do not change this! Uppercase letters are generally not allowed in usernames. This option is only for systems that differ from this standard!
BypassSystemButtonsChecks="false"
# Skips checking if sddm can perform shutdown, restart, suspend or hibernate, always displays all system buttons.
RightToLeftLayout="false"
+8 -6
View File
@@ -23,7 +23,7 @@ DateFormat="dddd d"
# Default Locale.LongFormat.
HeaderText=""
# You can put somehting fun.
# You can put something fun.
#################### Background ####################
@@ -49,7 +49,7 @@ DimBackground="0.0"
CropBackground="true"
# Default false.
# Crop or fit background.
# Connected with: BackgroundHorizontalAlignment and BackgroundVerticalAlignment dosn't work when set to true.
# Connected with: BackgroundHorizontalAlignment and BackgroundVerticalAlignment doesn't work when set to true.
BackgroundHorizontalAlignment="center"
# Default: center, Options: left, center, right.
# Horizontal position of the background picture.
@@ -130,16 +130,18 @@ HideVirtualKeyboard="false"
HideSystemButtons="false"
HideLoginButton="false"
UseRealName="true"
# If set to true, the user's real name (GECOS) is displayed instead of the account username. Users can log in using either their username or real name. If set to false, users can log in only with their username.
# Warning: If two or more accounts have the same real name, they cannot be distinguished during login. In that case, it is recommended to set this option to `false`.
ForceLastUser="true"
# If set to true last successfully logged in user appeares automatically in the username field.
# If set to true last successfully logged in user appears automatically in the username field.
PasswordFocus="true"
# Automaticaly focuses password field.
# Automatically focuses password field.
HideCompletePassword="true"
# Hides the password while typing.
AllowEmptyPassword="false"
# Enable login for users without a password.
AllowUppercaseLettersInUsernames="false"
# Do not change this! Uppercase letters are generally not allowed in usernames. This option is only for systems that differ from this standard!
BypassSystemButtonsChecks="false"
# Skips checking if sddm can perform shutdown, restart, suspend or hibernate, always displays all system buttons.
RightToLeftLayout="false"
+8 -6
View File
@@ -23,7 +23,7 @@ DateFormat="dddd d"
# Default Locale.LongFormat.
HeaderText=""
# You can put somehting fun.
# You can put something fun.
#################### Background ####################
@@ -49,7 +49,7 @@ DimBackground="0.0"
CropBackground="true"
# Default false.
# Crop or fit background.
# Connected with: BackgroundHorizontalAlignment and BackgroundVerticalAlignment dosn't work when set to true.
# Connected with: BackgroundHorizontalAlignment and BackgroundVerticalAlignment doesn't work when set to true.
BackgroundHorizontalAlignment="center"
# Default: center, Options: left, center, right.
# Horizontal position of the background picture.
@@ -130,16 +130,18 @@ HideVirtualKeyboard="true"
HideSystemButtons="true"
HideLoginButton="true"
UseRealName="true"
# If set to true, the user's real name (GECOS) is displayed instead of the account username. Users can log in using either their username or real name. If set to false, users can log in only with their username.
# Warning: If two or more accounts have the same real name, they cannot be distinguished during login. In that case, it is recommended to set this option to `false`.
ForceLastUser="true"
# If set to true last successfully logged in user appeares automatically in the username field.
# If set to true last successfully logged in user appears automatically in the username field.
PasswordFocus="true"
# Automaticaly focuses password field.
# Automatically focuses password field.
HideCompletePassword="true"
# Hides the password while typing.
AllowEmptyPassword="false"
# Enable login for users without a password.
AllowUppercaseLettersInUsernames="false"
# Do not change this! Uppercase letters are generally not allowed in usernames. This option is only for systems that differ from this standard!
BypassSystemButtonsChecks="false"
# Skips checking if sddm can perform shutdown, restart, suspend or hibernate, always displays all system buttons.
RightToLeftLayout="false"
+8 -6
View File
@@ -23,7 +23,7 @@ DateFormat="dddd d"
# Default Locale.LongFormat.
HeaderText=""
# You can put somehting fun.
# You can put something fun.
#################### Background ####################
@@ -49,7 +49,7 @@ DimBackground="0.0"
CropBackground="true"
# Default false.
# Crop or fit background.
# Connected with: BackgroundHorizontalAlignment and BackgroundVerticalAlignment dosn't work when set to true.
# Connected with: BackgroundHorizontalAlignment and BackgroundVerticalAlignment doesn't work when set to true.
BackgroundHorizontalAlignment="center"
# Default: center, Options: left, center, right.
# Horizontal position of the background picture.
@@ -130,16 +130,18 @@ HideVirtualKeyboard="true"
HideSystemButtons="true"
HideLoginButton="true"
UseRealName="true"
# If set to true, the user's real name (GECOS) is displayed instead of the account username. Users can log in using either their username or real name. If set to false, users can log in only with their username.
# Warning: If two or more accounts have the same real name, they cannot be distinguished during login. In that case, it is recommended to set this option to `false`.
ForceLastUser="true"
# If set to true last successfully logged in user appeares automatically in the username field.
# If set to true last successfully logged in user appears automatically in the username field.
PasswordFocus="true"
# Automaticaly focuses password field.
# Automatically focuses password field.
HideCompletePassword="true"
# Hides the password while typing.
AllowEmptyPassword="false"
# Enable login for users without a password.
AllowUppercaseLettersInUsernames="false"
# Do not change this! Uppercase letters are generally not allowed in usernames. This option is only for systems that differ from this standard!
BypassSystemButtonsChecks="false"
# Skips checking if sddm can perform shutdown, restart, suspend or hibernate, always displays all system buttons.
RightToLeftLayout="false"
+8 -6
View File
@@ -23,7 +23,7 @@ DateFormat="dddd d"
# Default Locale.LongFormat.
HeaderText=""
# You can put somehting fun.
# You can put something fun.
#################### Background ####################
@@ -49,7 +49,7 @@ DimBackground="0.0"
CropBackground="true"
# Default false.
# Crop or fit background.
# Connected with: BackgroundHorizontalAlignment and BackgroundVerticalAlignment dosn't work when set to true.
# Connected with: BackgroundHorizontalAlignment and BackgroundVerticalAlignment doesn't work when set to true.
BackgroundHorizontalAlignment="center"
# Default: center, Options: left, center, right.
# Horizontal position of the background picture.
@@ -130,16 +130,18 @@ HideVirtualKeyboard="true"
HideSystemButtons="true"
HideLoginButton="false"
UseRealName="true"
# If set to true, the user's real name (GECOS) is displayed instead of the account username. Users can log in using either their username or real name. If set to false, users can log in only with their username.
# Warning: If two or more accounts have the same real name, they cannot be distinguished during login. In that case, it is recommended to set this option to `false`.
ForceLastUser="true"
# If set to true last successfully logged in user appeares automatically in the username field.
# If set to true last successfully logged in user appears automatically in the username field.
PasswordFocus="true"
# Automaticaly focuses password field.
# Automatically focuses password field.
HideCompletePassword="true"
# Hides the password while typing.
AllowEmptyPassword="false"
# Enable login for users without a password.
AllowUppercaseLettersInUsernames="false"
# Do not change this! Uppercase letters are generally not allowed in usernames. This option is only for systems that differ from this standard!
BypassSystemButtonsChecks="false"
# Skips checking if sddm can perform shutdown, restart, suspend or hibernate, always displays all system buttons.
RightToLeftLayout="false"
+8 -6
View File
@@ -23,7 +23,7 @@ DateFormat="dddd d"
# Default Locale.LongFormat.
HeaderText=""
# You can put somehting fun.
# You can put something fun.
#################### Background ####################
@@ -49,7 +49,7 @@ DimBackground="0.0"
CropBackground="true"
# Default false.
# Crop or fit background.
# Connected with: BackgroundHorizontalAlignment and BackgroundVerticalAlignment dosn't work when set to true.
# Connected with: BackgroundHorizontalAlignment and BackgroundVerticalAlignment doesn't work when set to true.
BackgroundHorizontalAlignment="center"
# Default: center, Options: left, center, right.
# Horizontal position of the background picture.
@@ -130,16 +130,18 @@ HideVirtualKeyboard="false"
HideSystemButtons="false"
HideLoginButton="false"
UseRealName="true"
# If set to true, the user's real name (GECOS) is displayed instead of the account username. Users can log in using either their username or real name. If set to false, users can log in only with their username.
# Warning: If two or more accounts have the same real name, they cannot be distinguished during login. In that case, it is recommended to set this option to `false`.
ForceLastUser="true"
# If set to true last successfully logged in user appeares automatically in the username field.
# If set to true last successfully logged in user appears automatically in the username field.
PasswordFocus="true"
# Automaticaly focuses password field.
# Automatically focuses password field.
HideCompletePassword="true"
# Hides the password while typing.
AllowEmptyPassword="false"
# Enable login for users without a password.
AllowUppercaseLettersInUsernames="false"
# Do not change this! Uppercase letters are generally not allowed in usernames. This option is only for systems that differ from this standard!
BypassSystemButtonsChecks="false"
# Skips checking if sddm can perform shutdown, restart, suspend or hibernate, always displays all system buttons.
RightToLeftLayout="false"
+1 -1
View File
@@ -5,7 +5,7 @@ Author=keyitdev
Website=https://github.com/Keyitdev/sddm-astronaut-theme
License=GPL-3.0-or-later
Type=sddm-theme
Version=1.3
Version=1.4
ConfigFile=Themes/astronaut.conf
Screenshot=Previews/astronaut.png
MainScript=Main.qml