lockscreen background
This commit is contained in:
@@ -40,16 +40,6 @@ Scope {
|
|||||||
implicitHeight: 34
|
implicitHeight: 34
|
||||||
}
|
}
|
||||||
|
|
||||||
NotificationCenter {
|
|
||||||
bar: bar
|
|
||||||
}
|
|
||||||
|
|
||||||
Process {
|
|
||||||
id: ncProcess
|
|
||||||
command: ["sh", "-c", `qs -p ${bar.root}/shell.qml ipc call root showCenter`]
|
|
||||||
running: false
|
|
||||||
}
|
|
||||||
|
|
||||||
anchors {
|
anchors {
|
||||||
top: true
|
top: true
|
||||||
left: true
|
left: true
|
||||||
|
|||||||
@@ -2,4 +2,5 @@ import Quickshell.Io
|
|||||||
|
|
||||||
JsonObject {
|
JsonObject {
|
||||||
property bool fixLockScreen: false
|
property bool fixLockScreen: false
|
||||||
|
property bool useWallpaper: true
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,6 +39,10 @@ Singleton {
|
|||||||
|
|
||||||
signal configReloaded
|
signal configReloaded
|
||||||
|
|
||||||
|
function getActiveScreen(): ShellScreen {
|
||||||
|
return Quickshell.screens.find(screen => root.monitorFor(screen) === root.focusedMonitor)
|
||||||
|
}
|
||||||
|
|
||||||
function dispatch(request: string): void {
|
function dispatch(request: string): void {
|
||||||
Hyprland.dispatch(request);
|
Hyprland.dispatch(request);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ WlSessionLockSurface {
|
|||||||
|
|
||||||
property string buffer
|
property string buffer
|
||||||
|
|
||||||
color: overlay.visible ? "black" : "transparent"
|
color: "transparent"
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: root.pam
|
target: root.pam
|
||||||
@@ -38,7 +38,7 @@ WlSessionLockSurface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Timer {
|
Timer {
|
||||||
interval: 100
|
interval: 5
|
||||||
running: true
|
running: true
|
||||||
repeat: false
|
repeat: false
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
@@ -62,6 +62,7 @@ WlSessionLockSurface {
|
|||||||
onTextChanged: text = ""
|
onTextChanged: text = ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ScreencopyView {
|
ScreencopyView {
|
||||||
id: background
|
id: background
|
||||||
|
|
||||||
@@ -70,23 +71,31 @@ WlSessionLockSurface {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
captureSource: root.screen
|
captureSource: root.screen
|
||||||
opacity: 1
|
opacity: 1
|
||||||
|
visible: !Config.lock.useWallpaper
|
||||||
|
|
||||||
layer.enabled: true
|
layer.enabled: true
|
||||||
layer.effect: MultiEffect {
|
layer.effect: MultiEffect {
|
||||||
autoPaddingEnabled: false
|
autoPaddingEnabled: false
|
||||||
blurEnabled: true
|
blurEnabled: true
|
||||||
blur: 2
|
blur: 0.8
|
||||||
blurMax: 32
|
blurMax: 64
|
||||||
blurMultiplier: 0
|
blurMultiplier: 1
|
||||||
|
brightness: 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Image {
|
Image {
|
||||||
// id: backgroundImage
|
id: backgroundImage
|
||||||
// anchors.fill: parent
|
anchors.fill: parent
|
||||||
// asynchronous: true
|
asynchronous: false
|
||||||
// source: root.backgroundImage
|
cache: false
|
||||||
// }
|
source: WallpaperPath.lockscreenBg
|
||||||
|
visible: Config.lock.useWallpaper
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
console.log(source);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: overlay
|
id: overlay
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import Quickshell.Hyprland
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import qs.Config
|
import qs.Config
|
||||||
import qs.Helpers
|
import qs.Helpers
|
||||||
@@ -32,7 +33,7 @@ Item {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
onClicked: {
|
onClicked: {
|
||||||
ncProcess.running = true
|
Hyprland.dispatch("global zshell-nc:toggle-nc");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,18 +24,29 @@ PanelWindow {
|
|||||||
WlrLayershell.namespace: "ZShell-Notifs"
|
WlrLayershell.namespace: "ZShell-Notifs"
|
||||||
WlrLayershell.layer: WlrLayer.Overlay
|
WlrLayershell.layer: WlrLayer.Overlay
|
||||||
WlrLayershell.keyboardFocus: WlrKeyboardFocus.OnDemand
|
WlrLayershell.keyboardFocus: WlrKeyboardFocus.OnDemand
|
||||||
required property PanelWindow bar
|
|
||||||
property bool centerShown: false
|
property bool centerShown: false
|
||||||
property alias posX: backgroundRect.x
|
property alias posX: backgroundRect.x
|
||||||
visible: false
|
visible: false
|
||||||
|
|
||||||
mask: Region { item: backgroundRect }
|
mask: Region { item: backgroundRect }
|
||||||
|
|
||||||
IpcHandler {
|
Connections {
|
||||||
id: ipcHandler
|
target: Hypr
|
||||||
target: "root"
|
|
||||||
|
|
||||||
function showCenter(): void { root.centerShown = !root.centerShown; }
|
function onFocusedMonitorChanged(): void {
|
||||||
|
if ( !root.centerShown ) {
|
||||||
|
root.screen = Hypr.getActiveScreen();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
GlobalShortcut {
|
||||||
|
appid: "zshell-nc"
|
||||||
|
name: "toggle-nc"
|
||||||
|
onPressed: {
|
||||||
|
root.screen = Hypr.getActiveScreen();
|
||||||
|
root.centerShown = !root.centerShown;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onVisibleChanged: {
|
onVisibleChanged: {
|
||||||
@@ -72,8 +83,8 @@ PanelWindow {
|
|||||||
id: showAnimation
|
id: showAnimation
|
||||||
target: backgroundRect
|
target: backgroundRect
|
||||||
property: "x"
|
property: "x"
|
||||||
to: Math.round(root.bar.screen.width - backgroundRect.implicitWidth - 10)
|
to: Math.round(root.screen.width - backgroundRect.implicitWidth - 10)
|
||||||
from: root.bar.screen.width
|
from: root.screen.width
|
||||||
duration: MaterialEasing.expressiveEffectsTime
|
duration: MaterialEasing.expressiveEffectsTime
|
||||||
easing.bezierCurve: MaterialEasing.expressiveEffects
|
easing.bezierCurve: MaterialEasing.expressiveEffects
|
||||||
onStopped: {
|
onStopped: {
|
||||||
@@ -85,8 +96,8 @@ PanelWindow {
|
|||||||
id: closeAnimation
|
id: closeAnimation
|
||||||
target: backgroundRect
|
target: backgroundRect
|
||||||
property: "x"
|
property: "x"
|
||||||
from: root.bar.screen.width - backgroundRect.implicitWidth - 10
|
from: root.screen.width - backgroundRect.implicitWidth - 10
|
||||||
to: root.bar.screen.width
|
to: root.screen.width
|
||||||
duration: MaterialEasing.expressiveEffectsTime
|
duration: MaterialEasing.expressiveEffectsTime
|
||||||
easing.bezierCurve: MaterialEasing.expressiveEffects
|
easing.bezierCurve: MaterialEasing.expressiveEffects
|
||||||
}
|
}
|
||||||
@@ -102,7 +113,7 @@ PanelWindow {
|
|||||||
|
|
||||||
TrackedNotification {
|
TrackedNotification {
|
||||||
centerShown: root.centerShown
|
centerShown: root.centerShown
|
||||||
bar: root.bar
|
screen: root.screen
|
||||||
}
|
}
|
||||||
|
|
||||||
ShadowRect {
|
ShadowRect {
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ import qs.Effects
|
|||||||
PanelWindow {
|
PanelWindow {
|
||||||
id: root
|
id: root
|
||||||
color: "transparent"
|
color: "transparent"
|
||||||
screen: root.bar.screen
|
|
||||||
|
|
||||||
anchors {
|
anchors {
|
||||||
top: true
|
top: true
|
||||||
@@ -28,10 +27,9 @@ PanelWindow {
|
|||||||
exclusionMode: ExclusionMode.Ignore
|
exclusionMode: ExclusionMode.Ignore
|
||||||
property list<Region> notifRegions: []
|
property list<Region> notifRegions: []
|
||||||
required property bool centerShown
|
required property bool centerShown
|
||||||
required property PanelWindow bar
|
|
||||||
property color textColor: Config.useDynamicColors ? DynamicColors.palette.m3onSurface : "white"
|
property color textColor: Config.useDynamicColors ? DynamicColors.palette.m3onSurface : "white"
|
||||||
property color backgroundColor: Config.useDynamicColors ? DynamicColors.tPalette.m3surface : Config.baseBgColor
|
property color backgroundColor: Config.useDynamicColors ? DynamicColors.tPalette.m3surface : Config.baseBgColor
|
||||||
visible: Hyprland.monitorFor(screen).focused
|
// visible: Hyprland.monitorFor(screen).focused
|
||||||
|
|
||||||
ListView {
|
ListView {
|
||||||
id: notifListView
|
id: notifListView
|
||||||
@@ -44,7 +42,7 @@ PanelWindow {
|
|||||||
}
|
}
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
x: root.centerShown ? root.bar.width - width - 420 : root.bar.width - width - 20
|
x: root.centerShown ? root.screen.width - width - 420 : root.screen.width - width - 20
|
||||||
z: 0
|
z: 0
|
||||||
anchors.topMargin: 54
|
anchors.topMargin: 54
|
||||||
width: 400
|
width: 400
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
uniform sampler2D image;
|
||||||
|
|
||||||
|
out vec4 FragmentColor;
|
||||||
|
|
||||||
|
uniform float offset[3] = float[](0.0, 1.3846153846, 3.2307692308);
|
||||||
|
uniform float weight[3] = float[](0.2270270270, 0.3162162162, 0.0702702703);
|
||||||
|
|
||||||
|
void main(void) {
|
||||||
|
|
||||||
|
FragmentColor = texture2D(image, vec2(gl_FragCoord) / 1024.0) * weight[0];
|
||||||
|
|
||||||
|
for (int i=1; i<3; i++) {
|
||||||
|
|
||||||
|
FragmentColor +=
|
||||||
|
texture2D(image, (vec2(gl_FragCoord) + vec2(0.0, offset[i])) / 1024.0)
|
||||||
|
* weight[i];
|
||||||
|
|
||||||
|
FragmentColor +=
|
||||||
|
texture2D(image, (vec2(gl_FragCoord) - vec2(0.0, offset[i])) / 1024.0)
|
||||||
|
* weight[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,8 +3,11 @@ import argparse
|
|||||||
|
|
||||||
def gen_blurred_image(input_image, output_path):
|
def gen_blurred_image(input_image, output_path):
|
||||||
img = Image.open(input_image)
|
img = Image.open(input_image)
|
||||||
|
size = img.size
|
||||||
|
img = img.resize((size[0] // 2, size[1] // 2), Image.NEAREST)
|
||||||
|
|
||||||
img = img.filter(ImageFilter.GaussianBlur(40))
|
img = img.filter(ImageFilter.GaussianBlur(40))
|
||||||
|
# img = img.resize(size, Image.LANCZOS)
|
||||||
|
|
||||||
img.save(output_path, "PNG")
|
img.save(output_path, "PNG")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user