mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
LockScreen: fingerprint auth without key or button
This commit is contained in:
@@ -1115,8 +1115,8 @@ Singleton {
|
||||
Quickshell.execDetached(["mkdir", "-p", pamConfigDir]);
|
||||
|
||||
// Generate the PAM config file content
|
||||
var configContent = "#auth sufficient pam_fprintd.so max-tries=1\n";
|
||||
configContent += "# only uncomment this if you have a fingerprint reader\n";
|
||||
var configContent = "auth sufficient pam_fprintd.so timeout=-1\n";
|
||||
configContent += "auth sufficient /run/current-system/sw/lib/security/pam_fprintd.so timeout=-1 # for NixOS\n";
|
||||
configContent += "auth required pam_unix.so\n";
|
||||
|
||||
// Write the config file using heredoc to avoid escaping issues
|
||||
|
||||
@@ -36,9 +36,13 @@ Scope {
|
||||
infoMessage = "";
|
||||
showFailure = false;
|
||||
errorMessage = "";
|
||||
if (!waitingForPassword) {
|
||||
pam.abort();
|
||||
}
|
||||
occupyFingerprintSensorProc.running = true;
|
||||
} else {
|
||||
occupyFingerprintSensorProc.running = false;
|
||||
pam.start();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,17 +55,12 @@ Scope {
|
||||
|
||||
if (waitingForPassword) {
|
||||
pam.respond(currentText);
|
||||
unlockInProgress = true;
|
||||
waitingForPassword = false;
|
||||
showInfo = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (root.unlockInProgress) {
|
||||
Logger.i("LockContext", "Unlock already in progress, ignoring duplicate attempt");
|
||||
return;
|
||||
}
|
||||
|
||||
root.unlockInProgress = true;
|
||||
errorMessage = "";
|
||||
showFailure = false;
|
||||
|
||||
|
||||
@@ -267,7 +267,7 @@ Loader {
|
||||
width: 0
|
||||
height: 0
|
||||
visible: false
|
||||
enabled: !lockContext.unlockInProgress || lockContext.waitingForPassword
|
||||
enabled: !lockContext.unlockInProgress
|
||||
font.pointSize: Style.fontSizeM
|
||||
color: Color.mPrimary
|
||||
echoMode: TextInput.Password
|
||||
|
||||
@@ -20,6 +20,10 @@ Item {
|
||||
required property var keyboardLayout
|
||||
required property TextInput passwordInput
|
||||
|
||||
Component.onCompleted: {
|
||||
doUnlock();
|
||||
}
|
||||
|
||||
function doUnlock() {
|
||||
if (lockControl) {
|
||||
lockControl.tryUnlock();
|
||||
@@ -620,7 +624,7 @@ Item {
|
||||
radius: Math.min(Style.iRadiusL, width / 2)
|
||||
color: eyeButtonArea.containsMouse ? Color.mPrimary : "transparent"
|
||||
visible: passwordInput.text.length > 0
|
||||
enabled: !lockContext || !lockContext.unlockInProgress || lockContext.waitingForPassword
|
||||
enabled: !lockContext || !lockContext.unlockInProgress
|
||||
|
||||
NIcon {
|
||||
anchors.centerIn: parent
|
||||
@@ -664,7 +668,7 @@ Item {
|
||||
color: submitButtonArea.containsMouse ? Color.mPrimary : "transparent"
|
||||
border.color: Color.mPrimary
|
||||
border.width: Style.borderS
|
||||
enabled: !lockControl || !lockControl.unlockInProgress || lockControl.waitingForPassword
|
||||
enabled: !lockContext || !lockContext.unlockInProgress
|
||||
|
||||
NIcon {
|
||||
anchors.centerIn: parent
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
{
|
||||
version ? "dirty",
|
||||
pamConfig ? "login",
|
||||
extraPackages ? [ ],
|
||||
runtimeDeps ? [
|
||||
brightnessctl
|
||||
@@ -90,7 +89,6 @@ stdenvNoCC.mkDerivation {
|
||||
|
||||
preFixup = ''
|
||||
qtWrapperArgs+=(
|
||||
--set NOCTALIA_PAM_CONFIG ${pamConfig}
|
||||
--prefix PATH : ${lib.makeBinPath (runtimeDeps ++ extraPackages)}
|
||||
--add-flags "-p $out/share/noctalia-shell"
|
||||
${lib.optionalString calendarSupport "--prefix GI_TYPELIB_PATH : ${giTypelibPath}"}
|
||||
|
||||
Reference in New Issue
Block a user