import QtQuick 2.0 import SddmComponents 2.0 Rectangle { id: root property int sessionIndex: session.index property string fontFamily: config.font ? config.font : "FiraCode Nerd Font" property color bg: "#282828" property color bg1: "#3c3836" property color bg2: "#504945" property color bg3: "#665c54" property color fg: "#ebdbb2" property color fg1: "#d5c4a1" property color red: "#cc241d" property color green: "#98971a" property color yellow: "#d79921" property color orange: "#d65d0e" property color purple: "#b16286" property color aqua: "#689d6a" property string clockText: Qt.formatDateTime(new Date(), "hh:mm ddd dd MMM") width: 1920 height: 1080 color: bg Component.onCompleted: { if (name.text == "") name.focus = true; else password.focus = true; } TextConstants { id: textConstants } Connections { function onLoginSucceeded() { promptMessage.text = textConstants.loginSucceeded; promptMessage.color = green; } function onLoginFailed() { password.text = ""; promptMessage.text = textConstants.loginFailed; promptMessage.color = red; } function onInformationMessage(message) { promptMessage.text = message; promptMessage.color = orange; } target: sddm } Timer { interval: 1000 running: true repeat: true onTriggered: root.clockText = Qt.formatDateTime(new Date(), "hh:mm ddd dd MMM") } Background { anchors.fill: parent source: config.background fillMode: Image.PreserveAspectCrop } Rectangle { anchors.fill: parent color: "#99282828" } Rectangle { id: topbar anchors.top: parent.top anchors.left: parent.left anchors.right: parent.right height: 42 color: bg Rectangle { anchors.left: parent.left anchors.right: parent.right anchors.bottom: parent.bottom height: 1 color: bg2 } Text { anchors.left: parent.left anchors.leftMargin: 16 anchors.verticalCenter: parent.verticalCenter text: "void / i3" color: yellow font.family: fontFamily font.pixelSize: 14 font.bold: true } Text { anchors.right: parent.right anchors.rightMargin: 16 anchors.verticalCenter: parent.verticalCenter text: root.clockText color: fg font.family: fontFamily font.pixelSize: 13 font.bold: true } } Rectangle { id: panel width: Math.min(430, parent.width - 80) height: 356 anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter radius: 6 color: "#e6282828" border.width: 1 border.color: bg3 Column { anchors.fill: parent anchors.margins: 22 spacing: 12 Text { width: parent.width text: textConstants.welcomeText.arg(sddm.hostName) color: fg elide: Text.ElideRight horizontalAlignment: Text.AlignHCenter font.family: fontFamily font.pixelSize: 18 font.bold: true } Text { width: parent.width text: textConstants.userName color: fg1 font.family: fontFamily font.pixelSize: 12 font.bold: true } TextBox { id: name width: parent.width height: 34 text: userModel.lastUser color: bg1 borderColor: bg3 focusColor: yellow hoverColor: aqua textColor: fg radius: 4 font.family: fontFamily font.pixelSize: 14 KeyNavigation.backtab: rebootButton KeyNavigation.tab: password Keys.onPressed: { if (event.key === Qt.Key_Return || event.key === Qt.Key_Enter) { sddm.login(name.text, password.text, sessionIndex); event.accepted = true; } } } Text { width: parent.width text: textConstants.password color: fg1 font.family: fontFamily font.pixelSize: 12 font.bold: true } PasswordBox { id: password width: parent.width height: 34 color: bg1 borderColor: bg3 focusColor: yellow hoverColor: aqua textColor: fg radius: 4 font.family: fontFamily font.pixelSize: 14 tooltipFG: fg tooltipBG: bg1 KeyNavigation.backtab: name KeyNavigation.tab: session Keys.onPressed: { if (event.key === Qt.Key_Return || event.key === Qt.Key_Enter) { sddm.login(name.text, password.text, sessionIndex); event.accepted = true; } } } Row { width: parent.width height: 34 spacing: 10 ComboBox { id: session width: Math.floor((parent.width - parent.spacing) * 0.62) height: parent.height model: sessionModel index: sessionModel.lastIndex color: bg1 menuColor: bg1 borderColor: bg3 focusColor: yellow hoverColor: aqua textColor: fg arrowColor: bg2 font.family: fontFamily font.pixelSize: 13 KeyNavigation.backtab: password KeyNavigation.tab: layoutBox } LayoutBox { id: layoutBox width: parent.width - session.width - parent.spacing height: parent.height color: bg1 menuColor: bg1 borderColor: bg3 focusColor: yellow hoverColor: aqua textColor: fg arrowColor: bg2 font.family: fontFamily font.pixelSize: 13 KeyNavigation.backtab: session KeyNavigation.tab: loginButton } } Text { id: promptMessage width: parent.width height: 18 text: textConstants.prompt color: fg1 elide: Text.ElideRight horizontalAlignment: Text.AlignHCenter font.family: fontFamily font.pixelSize: 11 } Row { width: parent.width height: 34 spacing: 8 Button { id: loginButton width: Math.floor((parent.width - (parent.spacing * 2)) / 3) height: parent.height text: textConstants.login color: yellow activeColor: orange pressedColor: green textColor: bg font.family: fontFamily font.pixelSize: 13 onClicked: sddm.login(name.text, password.text, sessionIndex) KeyNavigation.backtab: layoutBox KeyNavigation.tab: shutdownButton } Button { id: shutdownButton width: loginButton.width height: parent.height text: textConstants.shutdown color: bg2 activeColor: red pressedColor: red textColor: fg font.family: fontFamily font.pixelSize: 13 onClicked: sddm.powerOff() KeyNavigation.backtab: loginButton KeyNavigation.tab: rebootButton } Button { id: rebootButton width: parent.width - loginButton.width - shutdownButton.width - (parent.spacing * 2) height: parent.height text: textConstants.reboot color: bg2 activeColor: orange pressedColor: orange textColor: fg font.family: fontFamily font.pixelSize: 13 onClicked: sddm.reboot() KeyNavigation.backtab: shutdownButton KeyNavigation.tab: name } } } } }