add option to use hyprlock instead of quickshell

This commit is contained in:
end-4
2025-10-13 12:16:42 +02:00
parent b0cfcaff3d
commit 02192368d2
4 changed files with 36 additions and 17 deletions
-17
View File
@@ -28,23 +28,6 @@ Singleton {
property bool superReleaseMightTrigger: true
property bool workspaceShowNumbers: false
Connections {
target: Config
function onReadyChanged() {
if (Config.options.lock.launchOnStartup && Config.ready && Persistent.ready && Persistent.isNewHyprlandInstance) {
GlobalStates.screenLocked = true;
}
}
}
Connections {
target: Persistent
function onReadyChanged() {
if (Config.options.lock.launchOnStartup && Config.ready && Persistent.ready && Persistent.isNewHyprlandInstance) {
GlobalStates.screenLocked = true;
}
}
}
onSidebarRightOpenChanged: {
if (GlobalStates.sidebarRightOpen) {
Notifications.timeoutAll();
@@ -299,6 +299,7 @@ Singleton {
}
property JsonObject lock: JsonObject {
property bool useHyprlock: false
property bool launchOnStartup: false
property JsonObject blur: JsonObject {
property bool enable: false
@@ -112,6 +112,10 @@ Scope {
description: "Locks the screen"
onPressed: {
if (Config.options.lock.useHyprlock) {
Quickshell.execDetached(["hyprlock"])
return;
}
GlobalStates.screenLocked = true;
}
}
@@ -125,4 +129,23 @@ Scope {
lockContext.shouldReFocus();
}
}
Connections {
target: Config
function onReadyChanged() {
print("lock after config")
if (Config.options.lock.launchOnStartup && Config.ready && Persistent.ready && Persistent.isNewHyprlandInstance) {
Hyprland.dispatch("global quickshell:lock")
}
}
}
Connections {
target: Persistent
function onReadyChanged() {
print("lock after persistent")
if (Config.options.lock.launchOnStartup && Config.ready && Persistent.ready && Persistent.isNewHyprlandInstance) {
Hyprland.dispatch("global quickshell:lock")
}
}
}
}
@@ -462,6 +462,18 @@ ContentPage {
icon: "lock"
title: Translation.tr("Lock screen")
ConfigSwitch {
buttonIcon: "water_drop"
text: Translation.tr('Use Hyprlock (instead of Quickshell)')
checked: Config.options.lock.useHyprlock
onCheckedChanged: {
Config.options.lock.useHyprlock = checked;
}
StyledToolTip {
text: Translation.tr("If you want to somehow use fingerprint unlock...")
}
}
ConfigSwitch {
buttonIcon: "account_circle"
text: Translation.tr('Launch on startup')