diff --git a/nix/hm-module.nix b/nix/hm-module.nix index 8480617..f20a3eb 100644 --- a/nix/hm-module.nix +++ b/nix/hm-module.nix @@ -126,6 +126,11 @@ in default = true; description = "Show weather summary on the lock screen."; }; + threatEffect = lib.mkOption { + type = lib.types.bool; + default = true; + description = "Show red vignette and chromatic aberration on failed password attempts."; + }; }; notifications = moduleOpt "notifications" { timeout = lib.mkOption { diff --git a/shell/lock/LockSurface.qml b/shell/lock/LockSurface.qml index ef46721..f4ba93f 100644 --- a/shell/lock/LockSurface.qml +++ b/shell/lock/LockSurface.qml @@ -16,7 +16,8 @@ WlSessionLockSurface { property real _unlockFade: 1 // Threat level: 0.0-1.0 based on fail count (5 fails = max) - readonly property real _threat: Math.min(1.0, root.auth.failCount / 5) + readonly property bool _threatEnabled: S.Modules.lock.threatEffect ?? true + readonly property real _threat: _threatEnabled ? Math.min(1.0, root.auth.failCount / 5) : 0 property real _heartbeat: 0 // All visual content wrapped for threat shader @@ -321,7 +322,7 @@ WlSessionLockSurface { SequentialAnimation { id: _heartbeatAnim loops: Animation.Infinite - running: root.auth.failCount >= 3 && root.lock.secure + running: root._threatEnabled && root.auth.failCount >= 3 && root.lock.secure // Systole (sharp spike) NumberAnimation { diff --git a/shell/services/Modules.qml b/shell/services/Modules.qml index f9ea948..897a38e 100644 --- a/shell/services/Modules.qml +++ b/shell/services/Modules.qml @@ -99,7 +99,8 @@ QtObject { notifications: true, mpris: true, volume: true, - weather: true + weather: true, + threatEffect: true }) property var statsDaemon: ({ interval: -1