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.Pam Item { id: root property bool locked: false onLockedChanged: lock.locked = locked required property string bg_path property color fieldColor: ctx.failed ? "red" : Pywal.colors.color1 IpcHandler { target: "lockscreen" function lock() { lock.locked = true; } function unlock() { lock.locked = false; } } LockCtx { id: ctx onShouldUnlock: lock.locked = false } WlSessionLock { id: lock locked: root.locked onLockedChanged: { root.locked = locked } WlSessionLockSurface { color: "transparent" Image { anchors.fill: parent source: Qt.resolvedUrl(bg_path) ClippingWrapperRectangle { anchors.centerIn: parent radius: 10 color: Pywal.special.background RowLayout { ClippingWrapperRectangle { color: root.fieldColor implicitWidth: 200 TextInput { text: "" onTextChanged: { ctx.pass = text } horizontalAlignment: TextInput.AlignHCenter font.pointSize: 30 //echoMode: TextInput.Password color: Pywal.special.foreground } } Button { text: "unlock" onClicked: { ctx.doUnlock() } } Button { text: "exit" onClicked: root.locked = false } } } } } } }