greeter: init greeter

This commit is contained in:
kossLAN 2025-06-20 12:16:19 -04:00
parent be06bf0f86
commit fc9ced0bbe
Signed by: kossLAN
SSH key fingerprint: SHA256:bdV0x+wdQHGJ6LgmstH3KV8OpWY+OOFmJcPcB0wQPV8
6 changed files with 126 additions and 37 deletions

View file

@ -0,0 +1,39 @@
import QtQuick
import Quickshell
import Quickshell.Services.Greetd
import "../lockscreen"
Scope {
id: root
signal launch
property LockState state: LockState {
onTryUnlock: {
this.unlockInProgress = true;
// TODO: env var for user
Greetd.createSession("koss");
}
}
Connections {
target: Greetd
function onAuthMessage(message: string, error: bool, responseRequired: bool, echoResponse: bool) {
if (responseRequired) {
Greetd.respond(root.state.currentText);
} // else ignore - only supporting passwords
}
function onAuthFailure() {
root.state.currentText = "";
root.state.failed();
root.state.unlockInProgress = false;
}
function onReadyToLaunch() {
root.state.unlockInProgress = false;
root.launch();
}
}
}

34
shell/greeter/shell.qml Normal file
View file

@ -0,0 +1,34 @@
pragma ComponentBehavior: Bound
import Quickshell
import Quickshell.Wayland
import Quickshell.Services.Greetd
import "../lockscreen"
ShellRoot {
id: root
GreeterContext {
id: context
onLaunch: {
lock.locked = false;
Greetd.launch(["hyprland"]);
}
}
WlSessionLock {
id: lock
locked: true
WlSessionLockSurface {
LockSurface {
state: context.state
// TODO: env var for wallpaper
wallpaper: "root:resources/wallpapers/wallhaven-96y9qk.jpg"
anchors.fill: parent
}
}
}
}