mirror of
https://github.com/end-4/dots-hyprland.git
synced 2026-06-05 23:09:26 -05:00
add option to use hyprlock instead of quickshell
This commit is contained in:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user