mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
LockScreen: add allowPasswordWithFprintd option
This commit is contained in:
@@ -1111,6 +1111,8 @@
|
||||
"weather-show-in-calendar-label": "Display weather in calendar"
|
||||
},
|
||||
"lock-screen": {
|
||||
"allow-password-with-fprintd-description": "When fprintd (fingerprint authentication) is active, this option lets you still login using your password instead of a fingerprint",
|
||||
"allow-password-with-fprintd-label": "Allow password login with fprintd",
|
||||
"auto-start-auth-description": "e.g., automatically starts fingerprint authentication without requiring a key press or button click.",
|
||||
"auto-start-auth-label": "Auto-start authentication",
|
||||
"compact-lockscreen-description": "Show only the login input and system controls, hiding weather and media widgets.",
|
||||
|
||||
@@ -91,6 +91,7 @@
|
||||
"enableLockScreenCountdown": true,
|
||||
"lockScreenCountdownDuration": 10000,
|
||||
"autoStartAuth": false
|
||||
"allowPasswordWithFprintd": false
|
||||
},
|
||||
"ui": {
|
||||
"fontDefault": "",
|
||||
|
||||
@@ -845,6 +845,14 @@
|
||||
"tabLabel": "panels.lock-screen.title",
|
||||
"subTab": null
|
||||
},
|
||||
{
|
||||
"labelKey": "panels.lock-screen.allow-password-with-fprintd-label",
|
||||
"descriptionKey": "panels.lock-screen.allow-password-with-fprintd-description",
|
||||
"widget": "NToggle",
|
||||
"tab": 11,
|
||||
"tabLabel": "panels.lock-screen.title",
|
||||
"subTab": null
|
||||
},
|
||||
{
|
||||
"labelKey": "panels.lock-screen.show-session-buttons-label",
|
||||
"descriptionKey": "panels.lock-screen.show-session-buttons-description",
|
||||
|
||||
@@ -280,6 +280,7 @@ Singleton {
|
||||
property bool enableLockScreenCountdown: true
|
||||
property int lockScreenCountdownDuration: 10000
|
||||
property bool autoStartAuth: false
|
||||
property bool allowPasswordWithFprintd: false
|
||||
}
|
||||
|
||||
// ui
|
||||
|
||||
@@ -17,15 +17,12 @@ Scope {
|
||||
property bool showInfo: false
|
||||
property string errorMessage: ""
|
||||
property string infoMessage: ""
|
||||
property bool fprintdAvailable: false
|
||||
|
||||
readonly property string pamConfigDirectory: "/etc/pam.d"
|
||||
property string pamConfig: Quickshell.env("NOCTALIA_PAM_SERVICE") || "login"
|
||||
property bool pamReady: false
|
||||
|
||||
Component.onCompleted: {
|
||||
checkFprintdProc.running = true;
|
||||
|
||||
if (Quickshell.env("NOCTALIA_PAM_SERVICE")) {
|
||||
Logger.i("LockContext", "NOCTALIA_PAM_SERVICE is set, using system PAM config: /etc/pam.d/" + pamConfig);
|
||||
pamReady = true;
|
||||
@@ -85,7 +82,7 @@ Scope {
|
||||
if (!waitingForPassword) {
|
||||
pam.abort();
|
||||
}
|
||||
if (fprintdAvailable) {
|
||||
if (Settings.data.general.allowPasswordWithFprintd) {
|
||||
occupyFingerprintSensorProc.running = true;
|
||||
}
|
||||
} else {
|
||||
@@ -114,14 +111,6 @@ 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"]
|
||||
|
||||
@@ -33,6 +33,14 @@ ColumnLayout {
|
||||
defaultValue: Settings.getDefaultValue("general.autoStartAuth")
|
||||
}
|
||||
|
||||
NToggle {
|
||||
label: I18n.tr("panels.lock-screen.allow-password-with-fprintd-label")
|
||||
description: I18n.tr("panels.lock-screen.allow-password-with-fprintd-description")
|
||||
checked: Settings.data.general.allowPasswordWithFprintd
|
||||
onToggled: checked => Settings.data.general.allowPasswordWithFprintd = checked
|
||||
defaultValue: Settings.getDefaultValue("general.allowPasswordWithFprintd")
|
||||
}
|
||||
|
||||
NToggle {
|
||||
label: I18n.tr("panels.lock-screen.show-session-buttons-label")
|
||||
description: I18n.tr("panels.lock-screen.show-session-buttons-description")
|
||||
|
||||
Reference in New Issue
Block a user