last 7 months of qs changes
This commit is contained in:
parent
2c64563ade
commit
4b90113a54
103 changed files with 3467 additions and 1415 deletions
|
|
@ -0,0 +1,44 @@
|
|||
import Quickshell
|
||||
import Quickshell.Services.Pam
|
||||
|
||||
Scope {
|
||||
id: root
|
||||
signal unlocked();
|
||||
|
||||
property LockState state: LockState {
|
||||
onTryPasswordUnlock: {
|
||||
root.state.isUnlocking = true;
|
||||
pam.start();
|
||||
}
|
||||
}
|
||||
|
||||
PamContext {
|
||||
id: pam
|
||||
configDirectory: "pam"
|
||||
config: "password.conf"
|
||||
|
||||
onPamMessage: {
|
||||
if (this.responseRequired) {
|
||||
this.respond(root.state.currentText);
|
||||
} else if (this.messageIsError) {
|
||||
root.state.currentText = "";
|
||||
root.state.failed = true;
|
||||
root.state.error = this.message;
|
||||
} // else ignore
|
||||
}
|
||||
|
||||
onCompleted: status => {
|
||||
const success = status == PamResult.Success;
|
||||
|
||||
if (!success) {
|
||||
root.state.currentText = "";
|
||||
root.state.error = "Invalid password";
|
||||
}
|
||||
|
||||
root.state.failed = !success;
|
||||
root.state.isUnlocking = false;
|
||||
|
||||
if (success) root.unlocked();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue