remove config write
This commit is contained in:
+1
-11
@@ -37,17 +37,6 @@ Singleton {
|
|||||||
id: timer
|
id: timer
|
||||||
}
|
}
|
||||||
|
|
||||||
Timer {
|
|
||||||
running: true
|
|
||||||
interval: 5000
|
|
||||||
repeat: false
|
|
||||||
|
|
||||||
onTriggered: {
|
|
||||||
|
|
||||||
root.save();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Timer {
|
Timer {
|
||||||
id: saveTimer
|
id: saveTimer
|
||||||
|
|
||||||
@@ -120,6 +109,7 @@ Singleton {
|
|||||||
recolorLogo: lock.recolorLogo,
|
recolorLogo: lock.recolorLogo,
|
||||||
enableFprint: lock.enableFprint,
|
enableFprint: lock.enableFprint,
|
||||||
maxFprintTries: lock.maxFprintTries,
|
maxFprintTries: lock.maxFprintTries,
|
||||||
|
blurAmount: lock.blurAmount,
|
||||||
sizes: {
|
sizes: {
|
||||||
heightMult: lock.sizes.heightMult,
|
heightMult: lock.sizes.heightMult,
|
||||||
ratio: lock.sizes.ratio,
|
ratio: lock.sizes.ratio,
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ JsonObject {
|
|||||||
property bool enableFprint: true
|
property bool enableFprint: true
|
||||||
property int maxFprintTries: 3
|
property int maxFprintTries: 3
|
||||||
property Sizes sizes: Sizes {}
|
property Sizes sizes: Sizes {}
|
||||||
|
property int blurAmount: 40
|
||||||
|
|
||||||
component Sizes: JsonObject {
|
component Sizes: JsonObject {
|
||||||
property real heightMult: 0.7
|
property real heightMult: 0.7
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ Searcher {
|
|||||||
function setWallpaper(path: string): void {
|
function setWallpaper(path: string): void {
|
||||||
actualCurrent = path;
|
actualCurrent = path;
|
||||||
WallpaperPath.currentWallpaperPath = path;
|
WallpaperPath.currentWallpaperPath = path;
|
||||||
Quickshell.execDetached(["sh", "-c", `python3 ${Quickshell.shellPath("scripts/LockScreenBg.py")} --input_image=${root.actualCurrent} --output_path=${Paths.state}/lockscreen_bg.png`]);
|
Quickshell.execDetached(["sh", "-c", `python3 ${Quickshell.shellPath("scripts/LockScreenBg.py")} --input_image=${root.actualCurrent} --output_path=${Paths.state}/lockscreen_bg.png --blur_amount=${Config.lock.blurAmount}`]);
|
||||||
}
|
}
|
||||||
|
|
||||||
function preview(path: string): void {
|
function preview(path: string): void {
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ Item {
|
|||||||
radius: Appearance.rounding.normal
|
radius: Appearance.rounding.normal
|
||||||
|
|
||||||
function onClicked(): void {
|
function onClicked(): void {
|
||||||
|
console.log(root.modelData.path);
|
||||||
Wallpapers.setWallpaper(root.modelData.path);
|
Wallpapers.setWallpaper(root.modelData.path);
|
||||||
root.visibilities.launcher = false;
|
root.visibilities.launcher = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,22 +51,6 @@ ColumnLayout {
|
|||||||
font.family: Appearance.font.family.clock
|
font.family: Appearance.font.family.clock
|
||||||
font.bold: true
|
font.bold: true
|
||||||
}
|
}
|
||||||
|
|
||||||
Loader {
|
|
||||||
Layout.leftMargin: Appearance.spacing.small
|
|
||||||
Layout.alignment: Qt.AlignVCenter
|
|
||||||
|
|
||||||
active: Config.services.useTwelveHourClock
|
|
||||||
visible: active
|
|
||||||
|
|
||||||
sourceComponent: CustomText {
|
|
||||||
text: Time.amPmStr
|
|
||||||
color: DynamicColors.palette.m3primary
|
|
||||||
font.pointSize: Math.floor(Appearance.font.size.extraLarge * 2 * root.centerScale)
|
|
||||||
font.family: Appearance.font.family.clock
|
|
||||||
font.bold: true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CustomText {
|
CustomText {
|
||||||
|
|||||||
@@ -139,16 +139,10 @@ WlSessionLockSurface {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CachingImage {
|
Image {
|
||||||
id: background
|
id: background
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
asynchronous: true
|
source: WallpaperPath.lockscreenBg
|
||||||
path: WallpaperPath.currentWallpaperPath
|
|
||||||
opacity: 1
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
console.log(path);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
|
|||||||
@@ -1,95 +0,0 @@
|
|||||||
import Quickshell
|
|
||||||
import QtQuick
|
|
||||||
import QtQuick.Layouts
|
|
||||||
import qs.Modules
|
|
||||||
import qs.Components
|
|
||||||
import qs.Config
|
|
||||||
|
|
||||||
RowLayout {
|
|
||||||
id: root
|
|
||||||
|
|
||||||
property list<string> time: Time.longTime.split("")
|
|
||||||
|
|
||||||
CustomText {
|
|
||||||
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
|
|
||||||
animate: true
|
|
||||||
|
|
||||||
text: root.time[0]
|
|
||||||
font.pixelSize: 64
|
|
||||||
font.weight: Font.Normal
|
|
||||||
font.letterSpacing: 0.5
|
|
||||||
color: DynamicColors.palette.m3onSurface
|
|
||||||
}
|
|
||||||
CustomText {
|
|
||||||
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
|
|
||||||
animate: true
|
|
||||||
|
|
||||||
text: root.time[1]
|
|
||||||
font.pixelSize: 64
|
|
||||||
font.weight: Font.Normal
|
|
||||||
font.letterSpacing: 0.5
|
|
||||||
color: DynamicColors.palette.m3onSurface
|
|
||||||
}
|
|
||||||
CustomText {
|
|
||||||
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
|
|
||||||
Layout.bottomMargin: 8
|
|
||||||
animate: true
|
|
||||||
|
|
||||||
text: root.time[2]
|
|
||||||
font.pixelSize: 64
|
|
||||||
font.weight: Font.Normal
|
|
||||||
font.letterSpacing: 0.5
|
|
||||||
color: DynamicColors.palette.m3onSurface
|
|
||||||
}
|
|
||||||
CustomText {
|
|
||||||
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
|
|
||||||
animate: true
|
|
||||||
|
|
||||||
text: root.time[3]
|
|
||||||
font.pixelSize: 64
|
|
||||||
font.weight: Font.Normal
|
|
||||||
font.letterSpacing: 0.5
|
|
||||||
color: DynamicColors.palette.m3onSurface
|
|
||||||
}
|
|
||||||
CustomText {
|
|
||||||
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
|
|
||||||
animate: true
|
|
||||||
|
|
||||||
text: root.time[4]
|
|
||||||
font.pixelSize: 64
|
|
||||||
font.weight: Font.Normal
|
|
||||||
font.letterSpacing: 0.5
|
|
||||||
color: DynamicColors.palette.m3onSurface
|
|
||||||
}
|
|
||||||
CustomText {
|
|
||||||
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
|
|
||||||
Layout.bottomMargin: 8
|
|
||||||
animate: true
|
|
||||||
|
|
||||||
text: root.time[5]
|
|
||||||
font.pixelSize: 64
|
|
||||||
font.weight: Font.Normal
|
|
||||||
font.letterSpacing: 0.5
|
|
||||||
color: DynamicColors.palette.m3onSurface
|
|
||||||
}
|
|
||||||
CustomText {
|
|
||||||
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
|
|
||||||
animate: true
|
|
||||||
|
|
||||||
text: root.time[6]
|
|
||||||
font.pixelSize: 64
|
|
||||||
font.weight: Font.Normal
|
|
||||||
font.letterSpacing: 0.5
|
|
||||||
color: DynamicColors.palette.m3onSurface
|
|
||||||
}
|
|
||||||
CustomText {
|
|
||||||
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
|
|
||||||
animate: true
|
|
||||||
|
|
||||||
text: root.time[7]
|
|
||||||
font.pixelSize: 64
|
|
||||||
font.weight: Font.Normal
|
|
||||||
font.letterSpacing: 0.5
|
|
||||||
color: DynamicColors.palette.m3onSurface
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
from PIL import Image, ImageFilter
|
from PIL import Image, ImageFilter
|
||||||
import argparse
|
import argparse
|
||||||
|
|
||||||
def gen_blurred_image(input_image, output_path):
|
def gen_blurred_image(input_image, output_path, blur_amount):
|
||||||
img = Image.open(input_image)
|
img = Image.open(input_image)
|
||||||
size = img.size
|
size = img.size
|
||||||
img = img.resize((size[0] // 2, size[1] // 2), Image.NEAREST)
|
img = img.resize((size[0] // 2, size[1] // 2), Image.NEAREST)
|
||||||
|
|
||||||
img = img.filter(ImageFilter.GaussianBlur(40))
|
img = img.filter(ImageFilter.GaussianBlur(blur_amount))
|
||||||
# img = img.resize(size, Image.LANCZOS)
|
# img = img.resize(size, Image.LANCZOS)
|
||||||
|
|
||||||
img.save(output_path, "PNG")
|
img.save(output_path, "PNG")
|
||||||
@@ -15,7 +15,8 @@ if __name__ == "__main__":
|
|||||||
parser = argparse.ArgumentParser(description="Generate a blurred lock screen background image.")
|
parser = argparse.ArgumentParser(description="Generate a blurred lock screen background image.")
|
||||||
parser.add_argument("--input_image", type=str)
|
parser.add_argument("--input_image", type=str)
|
||||||
parser.add_argument("--output_path", type=str)
|
parser.add_argument("--output_path", type=str)
|
||||||
|
parser.add_argument("--blur_amount", type=int)
|
||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
gen_blurred_image(args.input_image, args.output_path)
|
gen_blurred_image(args.input_image, args.output_path, args.blur_amount)
|
||||||
|
|||||||
Reference in New Issue
Block a user