60 lines
1.0 KiB
QML
60 lines
1.0 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.Pam
|
|
|
|
Scope {
|
|
|
|
id: root
|
|
|
|
property string pass
|
|
|
|
property bool busy: false
|
|
|
|
property bool failed: false
|
|
|
|
signal shouldUnlock()
|
|
|
|
onPassChanged: failed = false
|
|
|
|
function doUnlock() {
|
|
if(pass == "") return;
|
|
|
|
root.busy = true
|
|
pam.start()
|
|
}
|
|
|
|
PamContext {
|
|
|
|
id: pam
|
|
|
|
onPamMessage: {
|
|
if (this.responseRequired) {
|
|
this.respond(root.pass);
|
|
}
|
|
}
|
|
|
|
onCompleted: result => {
|
|
if (result == PamResult.Success) {
|
|
root.shouldUnlock()
|
|
console.log("auth Success")
|
|
root.pass = "";
|
|
} else {
|
|
root.pass = "";
|
|
root.failed = true;
|
|
abort()
|
|
}
|
|
|
|
root.busy = false;
|
|
}
|
|
|
|
config: "aurora-lock.conf"
|
|
}
|
|
}
|