mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
LockContext: add fprintd availability check
This commit is contained in:
@@ -18,11 +18,14 @@ Scope {
|
||||
property string errorMessage: ""
|
||||
property string infoMessage: ""
|
||||
property bool pamAvailable: typeof PamContext !== "undefined"
|
||||
property bool fprintdAvailable: false
|
||||
|
||||
readonly property string pamConfigDirectory: Quickshell.env("NOCTALIA_PAM_CONFIG") ? "/etc/pam.d" : Settings.configDir + "pam"
|
||||
readonly property string pamConfig: Quickshell.env("NOCTALIA_PAM_CONFIG") || "password.conf"
|
||||
|
||||
Component.onCompleted: {
|
||||
checkFprintdProc.running = true;
|
||||
|
||||
if (Quickshell.env("NOCTALIA_PAM_CONFIG")) {
|
||||
Logger.i("LockContext", "NOCTALIA_PAM_CONFIG is set, using system PAM config: /etc/pam.d/" + pamConfig);
|
||||
} else {
|
||||
@@ -36,7 +39,9 @@ Scope {
|
||||
infoMessage = "";
|
||||
showFailure = false;
|
||||
errorMessage = "";
|
||||
occupyFingerprintSensorProc.running = true;
|
||||
if (fprintdAvailable) {
|
||||
occupyFingerprintSensorProc.running = true;
|
||||
}
|
||||
} else {
|
||||
occupyFingerprintSensorProc.running = false;
|
||||
}
|
||||
@@ -69,6 +74,14 @@ Scope {
|
||||
pam.start();
|
||||
}
|
||||
|
||||
Process {
|
||||
id: checkFprintdProc
|
||||
command: ["sh", "-c", "command -v fprintd-verify"]
|
||||
onExited: function (exitCode) {
|
||||
fprintdAvailable = (exitCode === 0);
|
||||
}
|
||||
}
|
||||
|
||||
Process {
|
||||
id: occupyFingerprintSensorProc
|
||||
command: ["fprintd-verify"]
|
||||
|
||||
Reference in New Issue
Block a user