Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
63e93f5de0 | ||
|
|
5a5bbc5811 | ||
|
|
74967d798c |
4 changed files with 106 additions and 31 deletions
|
|
@ -107,6 +107,9 @@ programs.nova-shell.modules = {
|
||||||
disk.enable = false; # the number will only make you anxious
|
disk.enable = false; # the number will only make you anxious
|
||||||
power.enable = false; # if you enjoy living dangerously without a logout button
|
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.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
|
||||||
|
|
||||||
# modules with extra config
|
# modules with extra config
|
||||||
backlight.step = 2; # brightness adjustment %
|
backlight.step = 2; # brightness adjustment %
|
||||||
|
|
|
||||||
|
|
@ -96,11 +96,27 @@ in
|
||||||
"power"
|
"power"
|
||||||
"backgroundOverlay"
|
"backgroundOverlay"
|
||||||
"overviewBackdrop"
|
"overviewBackdrop"
|
||||||
"lock"
|
|
||||||
] (name: moduleOpt name { });
|
] (name: moduleOpt name { });
|
||||||
in
|
in
|
||||||
simpleModules
|
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;
|
||||||
|
description = "Show media controls on the lock screen.";
|
||||||
|
};
|
||||||
|
volume = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = true;
|
||||||
|
description = "Show volume slider on the lock screen.";
|
||||||
|
};
|
||||||
|
};
|
||||||
notifications = moduleOpt "notifications" {
|
notifications = moduleOpt "notifications" {
|
||||||
timeout = lib.mkOption {
|
timeout = lib.mkOption {
|
||||||
type = lib.types.int;
|
type = lib.types.int;
|
||||||
|
|
|
||||||
|
|
@ -15,12 +15,19 @@ WlSessionLockSurface {
|
||||||
|
|
||||||
color: M.Theme.base00
|
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
|
// Blur screenshot of desktop as background
|
||||||
ScreencopyView {
|
ScreencopyView {
|
||||||
id: background
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
captureSource: root.screen
|
captureSource: root.screen
|
||||||
opacity: 0
|
opacity: root._bgOpacity
|
||||||
|
visible: M.Modules.lock.screenshot ?? true
|
||||||
|
|
||||||
layer.enabled: true
|
layer.enabled: true
|
||||||
layer.effect: MultiEffect {
|
layer.effect: MultiEffect {
|
||||||
|
|
@ -29,19 +36,13 @@ WlSessionLockSurface {
|
||||||
blur: 1
|
blur: 1
|
||||||
blurMax: 64
|
blurMax: 64
|
||||||
}
|
}
|
||||||
|
|
||||||
NumberAnimation on opacity {
|
|
||||||
to: 1
|
|
||||||
duration: 400
|
|
||||||
easing.type: Easing.OutCubic
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Dim overlay
|
// Dim overlay
|
||||||
Rectangle {
|
Rectangle {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
color: Qt.rgba(M.Theme.base00.r, M.Theme.base00.g, M.Theme.base00.b, 0.4)
|
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
|
// Hex wave overlay
|
||||||
|
|
@ -49,15 +50,7 @@ WlSessionLockSurface {
|
||||||
id: hexWave
|
id: hexWave
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
running: root.lock.secure
|
running: root.lock.secure
|
||||||
opacity: background.opacity * 0.4
|
opacity: root._bgOpacity * 0.4
|
||||||
|
|
||||||
NumberAnimation on opacity {
|
|
||||||
id: _hexFadeIn
|
|
||||||
running: false
|
|
||||||
to: 0.4
|
|
||||||
duration: 600
|
|
||||||
easing.type: Easing.OutCubic
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Keyboard input via TextInput - engages Qt's full input pipeline including
|
// Keyboard input via TextInput - engages Qt's full input pipeline including
|
||||||
|
|
@ -203,7 +196,7 @@ WlSessionLockSurface {
|
||||||
color: Qt.rgba(M.Theme.base01.r, M.Theme.base01.g, M.Theme.base01.b, 0.7)
|
color: Qt.rgba(M.Theme.base01.r, M.Theme.base01.g, M.Theme.base01.b, 0.7)
|
||||||
border.color: Qt.rgba(M.Theme.base03.r, M.Theme.base03.g, M.Theme.base03.b, 0.3)
|
border.color: Qt.rgba(M.Theme.base03.r, M.Theme.base03.g, M.Theme.base03.b, 0.3)
|
||||||
border.width: 1
|
border.width: 1
|
||||||
visible: _mprisPlayer !== null
|
visible: (M.Modules.lock.mpris ?? true) && _mprisPlayer !== null
|
||||||
|
|
||||||
readonly property var _mprisPlayers: (Mpris.players.values ?? []).filter(p => p.trackTitle || p.playbackState === MprisPlaybackState.Playing || p.playbackState === MprisPlaybackState.Paused)
|
readonly property var _mprisPlayers: (Mpris.players.values ?? []).filter(p => p.trackTitle || p.playbackState === MprisPlaybackState.Playing || p.playbackState === MprisPlaybackState.Paused)
|
||||||
readonly property var _mprisPlayer: _mprisPlayers[0] ?? null
|
readonly property var _mprisPlayer: _mprisPlayers[0] ?? null
|
||||||
|
|
@ -233,7 +226,7 @@ WlSessionLockSurface {
|
||||||
color: Qt.rgba(M.Theme.base01.r, M.Theme.base01.g, M.Theme.base01.b, 0.7)
|
color: Qt.rgba(M.Theme.base01.r, M.Theme.base01.g, M.Theme.base01.b, 0.7)
|
||||||
border.color: Qt.rgba(M.Theme.base03.r, M.Theme.base03.g, M.Theme.base03.b, 0.3)
|
border.color: Qt.rgba(M.Theme.base03.r, M.Theme.base03.g, M.Theme.base03.b, 0.3)
|
||||||
border.width: 1
|
border.width: 1
|
||||||
visible: Pipewire.defaultAudioSink !== null
|
visible: (M.Modules.lock.volume ?? true) && Pipewire.defaultAudioSink !== null
|
||||||
|
|
||||||
PwObjectTracker {
|
PwObjectTracker {
|
||||||
objects: [Pipewire.defaultAudioSink]
|
objects: [Pipewire.defaultAudioSink]
|
||||||
|
|
@ -300,15 +293,8 @@ WlSessionLockSurface {
|
||||||
easing.type: Easing.InCubic
|
easing.type: Easing.InCubic
|
||||||
}
|
}
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
target: background
|
target: root
|
||||||
property: "opacity"
|
property: "_bgOpacity"
|
||||||
to: 0
|
|
||||||
duration: 300
|
|
||||||
easing.type: Easing.InCubic
|
|
||||||
}
|
|
||||||
NumberAnimation {
|
|
||||||
target: hexWave
|
|
||||||
property: "opacity"
|
|
||||||
to: 0
|
to: 0
|
||||||
duration: 300
|
duration: 300
|
||||||
easing.type: Easing.InCubic
|
easing.type: Easing.InCubic
|
||||||
|
|
@ -363,4 +349,71 @@ WlSessionLockSurface {
|
||||||
_shakeAnim.restart();
|
_shakeAnim.restart();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Screen corners - session lock surfaces render above all layer-shell,
|
||||||
|
// so the bar's ScreenCorners aren't visible. Draw our own.
|
||||||
|
component LockCorner: Canvas {
|
||||||
|
property int corner: 0
|
||||||
|
readonly property int _r: M.Theme.screenRadius
|
||||||
|
visible: _r > 0 && M.Modules.screenCorners.enable
|
||||||
|
width: _r
|
||||||
|
height: _r
|
||||||
|
z: 999
|
||||||
|
|
||||||
|
onPaint: {
|
||||||
|
const r = _r;
|
||||||
|
const ctx = getContext("2d");
|
||||||
|
ctx.clearRect(0, 0, r, r);
|
||||||
|
ctx.fillStyle = "black";
|
||||||
|
ctx.beginPath();
|
||||||
|
switch (corner) {
|
||||||
|
case 0:
|
||||||
|
ctx.moveTo(0, 0);
|
||||||
|
ctx.lineTo(r, 0);
|
||||||
|
ctx.arc(r, r, r, -Math.PI / 2, Math.PI, true);
|
||||||
|
ctx.closePath();
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
ctx.moveTo(r, 0);
|
||||||
|
ctx.lineTo(0, 0);
|
||||||
|
ctx.arc(0, r, r, -Math.PI / 2, 0, false);
|
||||||
|
ctx.closePath();
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
ctx.moveTo(0, r);
|
||||||
|
ctx.lineTo(0, 0);
|
||||||
|
ctx.arc(r, 0, r, Math.PI, Math.PI / 2, true);
|
||||||
|
ctx.closePath();
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
ctx.moveTo(r, r);
|
||||||
|
ctx.lineTo(r, 0);
|
||||||
|
ctx.arc(0, 0, r, 0, Math.PI / 2, false);
|
||||||
|
ctx.closePath();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
ctx.fill();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LockCorner {
|
||||||
|
corner: 0
|
||||||
|
anchors.top: parent.top
|
||||||
|
anchors.left: parent.left
|
||||||
|
}
|
||||||
|
LockCorner {
|
||||||
|
corner: 1
|
||||||
|
anchors.top: parent.top
|
||||||
|
anchors.right: parent.right
|
||||||
|
}
|
||||||
|
LockCorner {
|
||||||
|
corner: 2
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
anchors.left: parent.left
|
||||||
|
}
|
||||||
|
LockCorner {
|
||||||
|
corner: 3
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
anchors.right: parent.right
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,10 @@ QtObject {
|
||||||
enable: true
|
enable: true
|
||||||
})
|
})
|
||||||
property var lock: ({
|
property var lock: ({
|
||||||
enable: true
|
enable: true,
|
||||||
|
screenshot: true,
|
||||||
|
mpris: true,
|
||||||
|
volume: true
|
||||||
})
|
})
|
||||||
property var statsDaemon: ({
|
property var statsDaemon: ({
|
||||||
interval: -1
|
interval: -1
|
||||||
|
|
|
||||||
Reference in a new issue