last 7 months of qs changes

This commit is contained in:
outfoxxed 2025-01-06 00:13:19 -08:00
parent 2c64563ade
commit 4b90113a54
Signed by: outfoxxed
GPG key ID: 4C88A185FB89301E
103 changed files with 3467 additions and 1415 deletions

View file

@ -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();
}
}
}