forked from Shinonome/dots-hyprland
add option to use hyprlock instead of quickshell
This commit is contained in:
@@ -28,23 +28,6 @@ Singleton {
|
|||||||
property bool superReleaseMightTrigger: true
|
property bool superReleaseMightTrigger: true
|
||||||
property bool workspaceShowNumbers: false
|
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: {
|
onSidebarRightOpenChanged: {
|
||||||
if (GlobalStates.sidebarRightOpen) {
|
if (GlobalStates.sidebarRightOpen) {
|
||||||
Notifications.timeoutAll();
|
Notifications.timeoutAll();
|
||||||
|
|||||||
@@ -299,6 +299,7 @@ Singleton {
|
|||||||
}
|
}
|
||||||
|
|
||||||
property JsonObject lock: JsonObject {
|
property JsonObject lock: JsonObject {
|
||||||
|
property bool useHyprlock: false
|
||||||
property bool launchOnStartup: false
|
property bool launchOnStartup: false
|
||||||
property JsonObject blur: JsonObject {
|
property JsonObject blur: JsonObject {
|
||||||
property bool enable: false
|
property bool enable: false
|
||||||
|
|||||||
@@ -112,6 +112,10 @@ Scope {
|
|||||||
description: "Locks the screen"
|
description: "Locks the screen"
|
||||||
|
|
||||||
onPressed: {
|
onPressed: {
|
||||||
|
if (Config.options.lock.useHyprlock) {
|
||||||
|
Quickshell.execDetached(["hyprlock"])
|
||||||
|
return;
|
||||||
|
}
|
||||||
GlobalStates.screenLocked = true;
|
GlobalStates.screenLocked = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -125,4 +129,23 @@ Scope {
|
|||||||
lockContext.shouldReFocus();
|
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"
|
icon: "lock"
|
||||||
title: Translation.tr("Lock screen")
|
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 {
|
ConfigSwitch {
|
||||||
buttonIcon: "account_circle"
|
buttonIcon: "account_circle"
|
||||||
text: Translation.tr('Launch on startup')
|
text: Translation.tr('Launch on startup')
|
||||||
|
|||||||
Reference in New Issue
Block a user