diff --git a/README.md b/README.md index ba11722..924edcf 100644 --- a/README.md +++ b/README.md @@ -107,6 +107,7 @@ programs.nova-shell.modules = { disk.enable = false; # the number will only make you anxious power.enable = false; # if you enjoy living dangerously without a logout button lock.enable = false; # if you prefer your session unlocked and your secrets free + lock.screenshot = false; # disable blurred desktop screenshot background lock.mpris = false; # hide media controls on the lock screen lock.volume = false; # hide volume slider on the lock screen diff --git a/nix/hm-module.nix b/nix/hm-module.nix index 6114608..8b1879b 100644 --- a/nix/hm-module.nix +++ b/nix/hm-module.nix @@ -101,6 +101,11 @@ in simpleModules // { lock = moduleOpt "lock" { + screenshot = lib.mkOption { + type = lib.types.bool; + default = true; + description = "Show blurred desktop screenshot as lock screen background."; + }; mpris = lib.mkOption { type = lib.types.bool; default = true; diff --git a/shell/lock/LockSurface.qml b/shell/lock/LockSurface.qml index 56dc9dc..4c7394d 100644 --- a/shell/lock/LockSurface.qml +++ b/shell/lock/LockSurface.qml @@ -15,12 +15,19 @@ WlSessionLockSurface { color: M.Theme.base00 + property real _bgOpacity: 0 + NumberAnimation on _bgOpacity { + to: 1 + duration: 400 + easing.type: Easing.OutCubic + } + // Blur screenshot of desktop as background ScreencopyView { - id: background anchors.fill: parent captureSource: root.screen - opacity: 0 + opacity: root._bgOpacity + visible: M.Modules.lock.screenshot ?? true layer.enabled: true layer.effect: MultiEffect { @@ -29,19 +36,13 @@ WlSessionLockSurface { blur: 1 blurMax: 64 } - - NumberAnimation on opacity { - to: 1 - duration: 400 - easing.type: Easing.OutCubic - } } // Dim overlay Rectangle { anchors.fill: parent color: Qt.rgba(M.Theme.base00.r, M.Theme.base00.g, M.Theme.base00.b, 0.4) - opacity: background.opacity + opacity: root._bgOpacity } // Hex wave overlay @@ -49,15 +50,7 @@ WlSessionLockSurface { id: hexWave anchors.fill: parent running: root.lock.secure - opacity: background.opacity * 0.4 - - NumberAnimation on opacity { - id: _hexFadeIn - running: false - to: 0.4 - duration: 600 - easing.type: Easing.OutCubic - } + opacity: root._bgOpacity * 0.4 } // Keyboard input via TextInput - engages Qt's full input pipeline including @@ -300,15 +293,8 @@ WlSessionLockSurface { easing.type: Easing.InCubic } NumberAnimation { - target: background - property: "opacity" - to: 0 - duration: 300 - easing.type: Easing.InCubic - } - NumberAnimation { - target: hexWave - property: "opacity" + target: root + property: "_bgOpacity" to: 0 duration: 300 easing.type: Easing.InCubic diff --git a/shell/services/Modules.qml b/shell/services/Modules.qml index 4a0c826..eab237b 100644 --- a/shell/services/Modules.qml +++ b/shell/services/Modules.qml @@ -94,6 +94,7 @@ QtObject { }) property var lock: ({ enable: true, + screenshot: true, mpris: true, volume: true })