fix: add lock config scope

Also global lock settings
And fix some accesses
This commit is contained in:
2 * r + 2 * t 2026-04-13 00:25:16 +10:00
parent bbba6e162d
commit 8883156dd9
5 changed files with 67 additions and 60 deletions

View file

@ -11,7 +11,7 @@ Scope {
id: root
required property Lock lock
readonly property bool enabled: !Config.general.idle.inhibitWhenAudio || !Players.list.some(p => p.isPlaying)
readonly property bool enabled: !GlobalConfig.general.idle.inhibitWhenAudio || !Players.list.some(p => p.isPlaying)
function handleIdleAction(action: var): void {
if (!action)
@ -29,7 +29,7 @@ Scope {
LogindManager {
onAboutToSleep: {
if (Config.general.idle.lockBeforeSleep)
if (GlobalConfig.general.idle.lockBeforeSleep)
root.lock.lock.locked = true;
}
onLockRequested: root.lock.lock.locked = true
@ -37,7 +37,7 @@ Scope {
}
Variants {
model: Config.general.idle.timeouts
model: GlobalConfig.general.idle.timeouts
IdleMonitor {
required property var modelData

View file

@ -159,6 +159,12 @@ WlSessionLockSurface {
}
}
ConfigScope {
id: configScope
anchors.fill: parent
screen: root.screen
ScreencopyView {
id: background
@ -227,4 +233,5 @@ WlSessionLockSurface {
scale: 0
}
}
}
}

View file

@ -82,7 +82,7 @@ Scope {
property int errorTries
function checkAvail(): void {
if (!available || !Config.lock.enableFprint || !root.lock.secure) {
if (!available || !GlobalConfig.lock.enableFprint || !root.lock.secure) {
abort();
return;
}
@ -113,7 +113,7 @@ Scope {
// Isn't actually the real max tries as pam only reports completed
// when max tries is reached.
tries++;
if (tries < Config.lock.maxFprintTries) {
if (tries < GlobalConfig.lock.maxFprintTries) {
// Restart if not actually real max tries
root.fprintState = "fail";
start();
@ -188,6 +188,6 @@ Scope {
fprint.checkAvail();
}
target: Config.lock
target: GlobalConfig.lock
}
}

View file

@ -9,8 +9,8 @@ class LockConfig : public ConfigObject {
QML_ANONYMOUS
CONFIG_PROPERTY(bool, recolourLogo, false)
CONFIG_PROPERTY(bool, enableFprint, true)
CONFIG_PROPERTY(int, maxFprintTries, 3)
CONFIG_GLOBAL_PROPERTY(bool, enableFprint, true)
CONFIG_GLOBAL_PROPERTY(int, maxFprintTries, 3)
CONFIG_PROPERTY(bool, hideNotifs, false)
public:

View file

@ -19,7 +19,7 @@ Singleton {
readonly property string imagecache: `${cache}/imagecache`
readonly property string notifimagecache: `${imagecache}/notifs`
readonly property string wallsdir: Quickshell.env("CAELESTIA_WALLPAPERS_DIR") || absolutePath(Config.paths.wallpaperDir)
readonly property string wallsdir: Quickshell.env("CAELESTIA_WALLPAPERS_DIR") || absolutePath(GlobalConfig.paths.wallpaperDir)
readonly property string recsdir: Quickshell.env("CAELESTIA_RECORDINGS_DIR") || `${videos}/Recordings`
readonly property string libdir: Quickshell.env("CAELESTIA_LIB_DIR") || "/usr/lib/caelestia"