87 lines
2.3 KiB
QML
87 lines
2.3 KiB
QML
import Quickshell // for PanelWindow
|
|
import QtQuick // for Text
|
|
import QtQuick.Shapes
|
|
import QtQuick.Controls
|
|
import QtQuick.Layouts
|
|
import Quickshell.Io
|
|
import Quickshell.Widgets
|
|
import Quickshell.Wayland
|
|
import Quickshell.Hyprland
|
|
import Quickshell.Services.Greetd
|
|
|
|
ClippingWrapperRectangle {
|
|
|
|
anchors.fill: parent
|
|
radius: 10
|
|
|
|
//color: "black"
|
|
color: Settings.special.background
|
|
|
|
ColumnLayout {
|
|
anchors.fill: parent
|
|
Text {
|
|
id: error
|
|
text: ""
|
|
//color: "red"
|
|
color: Settings.colors.color13
|
|
visible: false
|
|
}
|
|
Text {
|
|
text: "User"
|
|
//color: "white"
|
|
color: Settings.special.foreground
|
|
}
|
|
TextInput {
|
|
id: username
|
|
text: "guest"
|
|
//color: "white"
|
|
color: Settings.special.foreground
|
|
}
|
|
Text {
|
|
text: "Password"
|
|
//color: "white"
|
|
color: Settings.special.foreground
|
|
}
|
|
TextInput {
|
|
id: password
|
|
text: "test"
|
|
echoMode: TextInput.Password
|
|
//color: "white"
|
|
color: Settings.special.foreground
|
|
}
|
|
|
|
Button {
|
|
text: "Login"
|
|
|
|
onClicked: {
|
|
if(Greetd.available) {
|
|
Greetd.authMessage.connect((m, e, rr, er) => {
|
|
console.log(m)
|
|
if(e) {
|
|
if(er) {
|
|
error.visible = true
|
|
error.text = m
|
|
}
|
|
} else if(rr) {
|
|
console.log("send password")
|
|
Greetd.respond(password.text)
|
|
}
|
|
})
|
|
|
|
Greetd.authFailure.connect((m) => {
|
|
error.visible = true
|
|
error.text = m
|
|
})
|
|
|
|
Greetd.readyToLaunch.connect(() => {
|
|
console.log("readyToLaunch")
|
|
Greetd.launch([ "start-hyprland" ])
|
|
})
|
|
console.log("createSession")
|
|
Greetd.createSession(username.text)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|