mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-28 15:32:50 -05:00
config: restructure, migration system, cache data
This commit is contained in:
122
Common/CacheData.qml
Normal file
122
Common/CacheData.qml
Normal file
@@ -0,0 +1,122 @@
|
|||||||
|
pragma Singleton
|
||||||
|
|
||||||
|
pragma ComponentBehavior: Bound
|
||||||
|
|
||||||
|
import QtCore
|
||||||
|
import QtQuick
|
||||||
|
import Quickshell
|
||||||
|
import Quickshell.Io
|
||||||
|
|
||||||
|
Singleton {
|
||||||
|
id: root
|
||||||
|
|
||||||
|
readonly property int cacheConfigVersion: 1
|
||||||
|
|
||||||
|
readonly property bool isGreeterMode: Quickshell.env("DMS_RUN_GREETER") === "1" || Quickshell.env("DMS_RUN_GREETER") === "true"
|
||||||
|
|
||||||
|
readonly property string _stateUrl: StandardPaths.writableLocation(StandardPaths.GenericCacheLocation)
|
||||||
|
readonly property string _stateDir: Paths.strip(_stateUrl)
|
||||||
|
|
||||||
|
property bool _loading: false
|
||||||
|
|
||||||
|
property string wallpaperLastPath: ""
|
||||||
|
property string profileLastPath: ""
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
if (!isGreeterMode) {
|
||||||
|
loadCache()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function loadCache() {
|
||||||
|
_loading = true
|
||||||
|
parseCache(cacheFile.text())
|
||||||
|
_loading = false
|
||||||
|
}
|
||||||
|
|
||||||
|
function parseCache(content) {
|
||||||
|
_loading = true
|
||||||
|
try {
|
||||||
|
if (content && content.trim()) {
|
||||||
|
const cache = JSON.parse(content)
|
||||||
|
|
||||||
|
wallpaperLastPath = cache.wallpaperLastPath !== undefined ? cache.wallpaperLastPath : ""
|
||||||
|
profileLastPath = cache.profileLastPath !== undefined ? cache.profileLastPath : ""
|
||||||
|
|
||||||
|
if (cache.configVersion === undefined) {
|
||||||
|
migrateFromUndefinedToV1(cache)
|
||||||
|
cleanupUnusedKeys()
|
||||||
|
saveCache()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.warn("CacheData: Failed to parse cache:", e.message)
|
||||||
|
} finally {
|
||||||
|
_loading = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function saveCache() {
|
||||||
|
if (_loading)
|
||||||
|
return
|
||||||
|
cacheFile.setText(JSON.stringify({
|
||||||
|
"wallpaperLastPath": wallpaperLastPath,
|
||||||
|
"profileLastPath": profileLastPath,
|
||||||
|
"configVersion": cacheConfigVersion
|
||||||
|
}, null, 2))
|
||||||
|
}
|
||||||
|
|
||||||
|
function migrateFromUndefinedToV1(cache) {
|
||||||
|
console.log("CacheData: Migrating configuration from undefined to version 1")
|
||||||
|
}
|
||||||
|
|
||||||
|
function cleanupUnusedKeys() {
|
||||||
|
const validKeys = [
|
||||||
|
"wallpaperLastPath",
|
||||||
|
"profileLastPath",
|
||||||
|
"configVersion"
|
||||||
|
]
|
||||||
|
|
||||||
|
try {
|
||||||
|
const content = cacheFile.text()
|
||||||
|
if (!content || !content.trim()) return
|
||||||
|
|
||||||
|
const cache = JSON.parse(content)
|
||||||
|
let needsSave = false
|
||||||
|
|
||||||
|
for (const key in cache) {
|
||||||
|
if (!validKeys.includes(key)) {
|
||||||
|
console.log("CacheData: Removing unused key:", key)
|
||||||
|
delete cache[key]
|
||||||
|
needsSave = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (needsSave) {
|
||||||
|
cacheFile.setText(JSON.stringify(cache, null, 2))
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.warn("CacheData: Failed to cleanup unused keys:", e.message)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FileView {
|
||||||
|
id: cacheFile
|
||||||
|
|
||||||
|
path: isGreeterMode ? "" : _stateDir + "/DankMaterialShell/cache.json"
|
||||||
|
blockLoading: true
|
||||||
|
blockWrites: true
|
||||||
|
atomicWrites: true
|
||||||
|
watchChanges: !isGreeterMode
|
||||||
|
onLoaded: {
|
||||||
|
if (!isGreeterMode) {
|
||||||
|
parseCache(cacheFile.text())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
onLoadFailed: error => {
|
||||||
|
if (!isGreeterMode) {
|
||||||
|
console.log("CacheData: No cache file found, starting fresh")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -9,15 +9,19 @@ import qs.Common
|
|||||||
import qs.Services
|
import qs.Services
|
||||||
|
|
||||||
Singleton {
|
Singleton {
|
||||||
|
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
|
readonly property int sessionConfigVersion: 1
|
||||||
|
|
||||||
readonly property bool isGreeterMode: Quickshell.env("DMS_RUN_GREETER") === "1" || Quickshell.env("DMS_RUN_GREETER") === "true"
|
readonly property bool isGreeterMode: Quickshell.env("DMS_RUN_GREETER") === "1" || Quickshell.env("DMS_RUN_GREETER") === "true"
|
||||||
|
property bool hasTriedDefaultSession: false
|
||||||
|
readonly property string _stateUrl: StandardPaths.writableLocation(StandardPaths.GenericStateLocation)
|
||||||
|
readonly property string _stateDir: Paths.strip(_stateUrl)
|
||||||
|
|
||||||
property bool isLightMode: false
|
property bool isLightMode: false
|
||||||
|
property bool doNotDisturb: false
|
||||||
|
|
||||||
property string wallpaperPath: ""
|
property string wallpaperPath: ""
|
||||||
property string wallpaperLastPath: ""
|
|
||||||
property string profileLastPath: ""
|
|
||||||
property bool perMonitorWallpaper: false
|
property bool perMonitorWallpaper: false
|
||||||
property var monitorWallpapers: ({})
|
property var monitorWallpapers: ({})
|
||||||
property bool perModeWallpaper: false
|
property bool perModeWallpaper: false
|
||||||
@@ -25,15 +29,20 @@ Singleton {
|
|||||||
property string wallpaperPathDark: ""
|
property string wallpaperPathDark: ""
|
||||||
property var monitorWallpapersLight: ({})
|
property var monitorWallpapersLight: ({})
|
||||||
property var monitorWallpapersDark: ({})
|
property var monitorWallpapersDark: ({})
|
||||||
property bool doNotDisturb: false
|
property string wallpaperTransition: "fade"
|
||||||
|
readonly property var availableWallpaperTransitions: ["none", "fade", "wipe", "disc", "stripes", "iris bloom", "pixelate", "portal"]
|
||||||
|
property var includedTransitions: availableWallpaperTransitions.filter(t => t !== "none")
|
||||||
|
|
||||||
|
property bool wallpaperCyclingEnabled: false
|
||||||
|
property string wallpaperCyclingMode: "interval"
|
||||||
|
property int wallpaperCyclingInterval: 300
|
||||||
|
property string wallpaperCyclingTime: "06:00"
|
||||||
|
property var monitorCyclingSettings: ({})
|
||||||
|
|
||||||
property bool nightModeEnabled: false
|
property bool nightModeEnabled: false
|
||||||
property int nightModeTemperature: 4500
|
property int nightModeTemperature: 4500
|
||||||
property bool nightModeAutoEnabled: false
|
property bool nightModeAutoEnabled: false
|
||||||
property string nightModeAutoMode: "time"
|
property string nightModeAutoMode: "time"
|
||||||
|
|
||||||
property bool hasTriedDefaultSession: false
|
|
||||||
readonly property string _stateUrl: StandardPaths.writableLocation(StandardPaths.GenericStateLocation)
|
|
||||||
readonly property string _stateDir: Paths.strip(_stateUrl)
|
|
||||||
property int nightModeStartHour: 18
|
property int nightModeStartHour: 18
|
||||||
property int nightModeStartMinute: 0
|
property int nightModeStartMinute: 0
|
||||||
property int nightModeEndHour: 6
|
property int nightModeEndHour: 6
|
||||||
@@ -41,39 +50,17 @@ Singleton {
|
|||||||
property real latitude: 0.0
|
property real latitude: 0.0
|
||||||
property real longitude: 0.0
|
property real longitude: 0.0
|
||||||
property string nightModeLocationProvider: ""
|
property string nightModeLocationProvider: ""
|
||||||
|
|
||||||
property var pinnedApps: []
|
property var pinnedApps: []
|
||||||
|
property var recentColors: []
|
||||||
|
property bool showThirdPartyPlugins: false
|
||||||
|
property string launchPrefix: ""
|
||||||
|
property string lastBrightnessDevice: ""
|
||||||
|
|
||||||
property int selectedGpuIndex: 0
|
property int selectedGpuIndex: 0
|
||||||
property bool nvidiaGpuTempEnabled: false
|
property bool nvidiaGpuTempEnabled: false
|
||||||
property bool nonNvidiaGpuTempEnabled: false
|
property bool nonNvidiaGpuTempEnabled: false
|
||||||
property var enabledGpuPciIds: []
|
property var enabledGpuPciIds: []
|
||||||
property bool wallpaperCyclingEnabled: false
|
|
||||||
property string wallpaperCyclingMode: "interval" // "interval" or "time"
|
|
||||||
property int wallpaperCyclingInterval: 300 // seconds (5 minutes)
|
|
||||||
property string wallpaperCyclingTime: "06:00" // HH:mm format
|
|
||||||
property var monitorCyclingSettings: ({})
|
|
||||||
property string lastBrightnessDevice: ""
|
|
||||||
property string launchPrefix: ""
|
|
||||||
property string wallpaperTransition: "fade"
|
|
||||||
readonly property var availableWallpaperTransitions: ["none", "fade", "wipe", "disc", "stripes", "iris bloom", "pixelate", "portal"]
|
|
||||||
property var includedTransitions: availableWallpaperTransitions.filter(t => t !== "none")
|
|
||||||
|
|
||||||
// Power management settings - AC Power
|
|
||||||
property int acMonitorTimeout: 0 // Never
|
|
||||||
property int acLockTimeout: 0 // Never
|
|
||||||
property int acSuspendTimeout: 0 // Never
|
|
||||||
property int acHibernateTimeout: 0 // Never
|
|
||||||
|
|
||||||
// Power management settings - Battery
|
|
||||||
property int batteryMonitorTimeout: 0 // Never
|
|
||||||
property int batteryLockTimeout: 0 // Never
|
|
||||||
property int batterySuspendTimeout: 0 // Never
|
|
||||||
property int batteryHibernateTimeout: 0 // Never
|
|
||||||
|
|
||||||
property bool lockBeforeSuspend: false
|
|
||||||
property bool loginctlLockIntegration: true
|
|
||||||
property var recentColors: []
|
|
||||||
property bool showThirdPartyPlugins: false
|
|
||||||
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
if (!isGreeterMode) {
|
if (!isGreeterMode) {
|
||||||
@@ -95,8 +82,6 @@ Singleton {
|
|||||||
var settings = JSON.parse(content)
|
var settings = JSON.parse(content)
|
||||||
isLightMode = settings.isLightMode !== undefined ? settings.isLightMode : false
|
isLightMode = settings.isLightMode !== undefined ? settings.isLightMode : false
|
||||||
wallpaperPath = settings.wallpaperPath !== undefined ? settings.wallpaperPath : ""
|
wallpaperPath = settings.wallpaperPath !== undefined ? settings.wallpaperPath : ""
|
||||||
wallpaperLastPath = settings.wallpaperLastPath !== undefined ? settings.wallpaperLastPath : ""
|
|
||||||
profileLastPath = settings.profileLastPath !== undefined ? settings.profileLastPath : ""
|
|
||||||
perMonitorWallpaper = settings.perMonitorWallpaper !== undefined ? settings.perMonitorWallpaper : false
|
perMonitorWallpaper = settings.perMonitorWallpaper !== undefined ? settings.perMonitorWallpaper : false
|
||||||
monitorWallpapers = settings.monitorWallpapers !== undefined ? settings.monitorWallpapers : {}
|
monitorWallpapers = settings.monitorWallpapers !== undefined ? settings.monitorWallpapers : {}
|
||||||
perModeWallpaper = settings.perModeWallpaper !== undefined ? settings.perModeWallpaper : false
|
perModeWallpaper = settings.perModeWallpaper !== undefined ? settings.perModeWallpaper : false
|
||||||
@@ -109,7 +94,6 @@ Singleton {
|
|||||||
nightModeTemperature = settings.nightModeTemperature !== undefined ? settings.nightModeTemperature : 4500
|
nightModeTemperature = settings.nightModeTemperature !== undefined ? settings.nightModeTemperature : 4500
|
||||||
nightModeAutoEnabled = settings.nightModeAutoEnabled !== undefined ? settings.nightModeAutoEnabled : false
|
nightModeAutoEnabled = settings.nightModeAutoEnabled !== undefined ? settings.nightModeAutoEnabled : false
|
||||||
nightModeAutoMode = settings.nightModeAutoMode !== undefined ? settings.nightModeAutoMode : "time"
|
nightModeAutoMode = settings.nightModeAutoMode !== undefined ? settings.nightModeAutoMode : "time"
|
||||||
// Handle legacy time format
|
|
||||||
if (settings.nightModeStartTime !== undefined) {
|
if (settings.nightModeStartTime !== undefined) {
|
||||||
const parts = settings.nightModeStartTime.split(":")
|
const parts = settings.nightModeStartTime.split(":")
|
||||||
nightModeStartHour = parseInt(parts[0]) || 18
|
nightModeStartHour = parseInt(parts[0]) || 18
|
||||||
@@ -143,20 +127,16 @@ Singleton {
|
|||||||
launchPrefix = settings.launchPrefix !== undefined ? settings.launchPrefix : ""
|
launchPrefix = settings.launchPrefix !== undefined ? settings.launchPrefix : ""
|
||||||
wallpaperTransition = settings.wallpaperTransition !== undefined ? settings.wallpaperTransition : "fade"
|
wallpaperTransition = settings.wallpaperTransition !== undefined ? settings.wallpaperTransition : "fade"
|
||||||
includedTransitions = settings.includedTransitions !== undefined ? settings.includedTransitions : availableWallpaperTransitions.filter(t => t !== "none")
|
includedTransitions = settings.includedTransitions !== undefined ? settings.includedTransitions : availableWallpaperTransitions.filter(t => t !== "none")
|
||||||
|
|
||||||
acMonitorTimeout = settings.acMonitorTimeout !== undefined ? settings.acMonitorTimeout : 0
|
|
||||||
acLockTimeout = settings.acLockTimeout !== undefined ? settings.acLockTimeout : 0
|
|
||||||
acSuspendTimeout = settings.acSuspendTimeout !== undefined ? settings.acSuspendTimeout : 0
|
|
||||||
acHibernateTimeout = settings.acHibernateTimeout !== undefined ? settings.acHibernateTimeout : 0
|
|
||||||
batteryMonitorTimeout = settings.batteryMonitorTimeout !== undefined ? settings.batteryMonitorTimeout : 0
|
|
||||||
batteryLockTimeout = settings.batteryLockTimeout !== undefined ? settings.batteryLockTimeout : 0
|
|
||||||
batterySuspendTimeout = settings.batterySuspendTimeout !== undefined ? settings.batterySuspendTimeout : 0
|
|
||||||
batteryHibernateTimeout = settings.batteryHibernateTimeout !== undefined ? settings.batteryHibernateTimeout : 0
|
|
||||||
lockBeforeSuspend = settings.lockBeforeSuspend !== undefined ? settings.lockBeforeSuspend : false
|
|
||||||
loginctlLockIntegration = settings.loginctlLockIntegration !== undefined ? settings.loginctlLockIntegration : true
|
|
||||||
recentColors = settings.recentColors !== undefined ? settings.recentColors : []
|
recentColors = settings.recentColors !== undefined ? settings.recentColors : []
|
||||||
showThirdPartyPlugins = settings.showThirdPartyPlugins !== undefined ? settings.showThirdPartyPlugins : false
|
showThirdPartyPlugins = settings.showThirdPartyPlugins !== undefined ? settings.showThirdPartyPlugins : false
|
||||||
|
|
||||||
|
if (settings.configVersion === undefined) {
|
||||||
|
migrateFromUndefinedToV1(settings)
|
||||||
|
saveSettings()
|
||||||
|
} else if (settings.configVersion === sessionConfigVersion) {
|
||||||
|
cleanupUnusedKeys()
|
||||||
|
}
|
||||||
|
|
||||||
if (!isGreeterMode) {
|
if (!isGreeterMode) {
|
||||||
if (typeof Theme !== "undefined") {
|
if (typeof Theme !== "undefined") {
|
||||||
Theme.generateSystemThemesFromCurrentTheme()
|
Theme.generateSystemThemesFromCurrentTheme()
|
||||||
@@ -173,8 +153,6 @@ Singleton {
|
|||||||
settingsFile.setText(JSON.stringify({
|
settingsFile.setText(JSON.stringify({
|
||||||
"isLightMode": isLightMode,
|
"isLightMode": isLightMode,
|
||||||
"wallpaperPath": wallpaperPath,
|
"wallpaperPath": wallpaperPath,
|
||||||
"wallpaperLastPath": wallpaperLastPath,
|
|
||||||
"profileLastPath": profileLastPath,
|
|
||||||
"perMonitorWallpaper": perMonitorWallpaper,
|
"perMonitorWallpaper": perMonitorWallpaper,
|
||||||
"monitorWallpapers": monitorWallpapers,
|
"monitorWallpapers": monitorWallpapers,
|
||||||
"perModeWallpaper": perModeWallpaper,
|
"perModeWallpaper": perModeWallpaper,
|
||||||
@@ -208,101 +186,109 @@ Singleton {
|
|||||||
"launchPrefix": launchPrefix,
|
"launchPrefix": launchPrefix,
|
||||||
"wallpaperTransition": wallpaperTransition,
|
"wallpaperTransition": wallpaperTransition,
|
||||||
"includedTransitions": includedTransitions,
|
"includedTransitions": includedTransitions,
|
||||||
"acMonitorTimeout": acMonitorTimeout,
|
|
||||||
"acLockTimeout": acLockTimeout,
|
|
||||||
"acSuspendTimeout": acSuspendTimeout,
|
|
||||||
"acHibernateTimeout": acHibernateTimeout,
|
|
||||||
"batteryMonitorTimeout": batteryMonitorTimeout,
|
|
||||||
"batteryLockTimeout": batteryLockTimeout,
|
|
||||||
"batterySuspendTimeout": batterySuspendTimeout,
|
|
||||||
"batteryHibernateTimeout": batteryHibernateTimeout,
|
|
||||||
"lockBeforeSuspend": lockBeforeSuspend,
|
|
||||||
"loginctlLockIntegration": loginctlLockIntegration,
|
|
||||||
"recentColors": recentColors,
|
"recentColors": recentColors,
|
||||||
"showThirdPartyPlugins": showThirdPartyPlugins
|
"showThirdPartyPlugins": showThirdPartyPlugins,
|
||||||
|
"configVersion": sessionConfigVersion
|
||||||
}, null, 2))
|
}, null, 2))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function migrateFromUndefinedToV1(settings) {
|
||||||
|
console.log("SessionData: Migrating configuration from undefined to version 1")
|
||||||
|
if (typeof SettingsData !== "undefined") {
|
||||||
|
if (settings.acMonitorTimeout !== undefined) {
|
||||||
|
SettingsData.setAcMonitorTimeout(settings.acMonitorTimeout)
|
||||||
|
}
|
||||||
|
if (settings.acLockTimeout !== undefined) {
|
||||||
|
SettingsData.setAcLockTimeout(settings.acLockTimeout)
|
||||||
|
}
|
||||||
|
if (settings.acSuspendTimeout !== undefined) {
|
||||||
|
SettingsData.setAcSuspendTimeout(settings.acSuspendTimeout)
|
||||||
|
}
|
||||||
|
if (settings.acHibernateTimeout !== undefined) {
|
||||||
|
SettingsData.setAcHibernateTimeout(settings.acHibernateTimeout)
|
||||||
|
}
|
||||||
|
if (settings.batteryMonitorTimeout !== undefined) {
|
||||||
|
SettingsData.setBatteryMonitorTimeout(settings.batteryMonitorTimeout)
|
||||||
|
}
|
||||||
|
if (settings.batteryLockTimeout !== undefined) {
|
||||||
|
SettingsData.setBatteryLockTimeout(settings.batteryLockTimeout)
|
||||||
|
}
|
||||||
|
if (settings.batterySuspendTimeout !== undefined) {
|
||||||
|
SettingsData.setBatterySuspendTimeout(settings.batterySuspendTimeout)
|
||||||
|
}
|
||||||
|
if (settings.batteryHibernateTimeout !== undefined) {
|
||||||
|
SettingsData.setBatteryHibernateTimeout(settings.batteryHibernateTimeout)
|
||||||
|
}
|
||||||
|
if (settings.lockBeforeSuspend !== undefined) {
|
||||||
|
SettingsData.setLockBeforeSuspend(settings.lockBeforeSuspend)
|
||||||
|
}
|
||||||
|
if (settings.loginctlLockIntegration !== undefined) {
|
||||||
|
SettingsData.setLoginctlLockIntegration(settings.loginctlLockIntegration)
|
||||||
|
}
|
||||||
|
if (settings.launchPrefix !== undefined) {
|
||||||
|
SettingsData.setLaunchPrefix(settings.launchPrefix)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (typeof CacheData !== "undefined") {
|
||||||
|
if (settings.wallpaperLastPath !== undefined) {
|
||||||
|
CacheData.wallpaperLastPath = settings.wallpaperLastPath
|
||||||
|
}
|
||||||
|
if (settings.profileLastPath !== undefined) {
|
||||||
|
CacheData.profileLastPath = settings.profileLastPath
|
||||||
|
}
|
||||||
|
CacheData.saveCache()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function cleanupUnusedKeys() {
|
||||||
|
const validKeys = [
|
||||||
|
"isLightMode", "wallpaperPath", "perMonitorWallpaper", "monitorWallpapers", "perModeWallpaper",
|
||||||
|
"wallpaperPathLight", "wallpaperPathDark", "monitorWallpapersLight",
|
||||||
|
"monitorWallpapersDark", "doNotDisturb", "nightModeEnabled",
|
||||||
|
"nightModeTemperature", "nightModeAutoEnabled", "nightModeAutoMode",
|
||||||
|
"nightModeStartHour", "nightModeStartMinute", "nightModeEndHour",
|
||||||
|
"nightModeEndMinute", "latitude", "longitude", "nightModeLocationProvider",
|
||||||
|
"pinnedApps", "selectedGpuIndex", "nvidiaGpuTempEnabled",
|
||||||
|
"nonNvidiaGpuTempEnabled", "enabledGpuPciIds", "wallpaperCyclingEnabled",
|
||||||
|
"wallpaperCyclingMode", "wallpaperCyclingInterval", "wallpaperCyclingTime",
|
||||||
|
"monitorCyclingSettings", "lastBrightnessDevice", "wallpaperTransition",
|
||||||
|
"includedTransitions", "recentColors", "showThirdPartyPlugins", "configVersion"
|
||||||
|
]
|
||||||
|
|
||||||
|
try {
|
||||||
|
const content = settingsFile.text()
|
||||||
|
if (!content || !content.trim()) return
|
||||||
|
|
||||||
|
const settings = JSON.parse(content)
|
||||||
|
let needsSave = false
|
||||||
|
|
||||||
|
for (const key in settings) {
|
||||||
|
if (!validKeys.includes(key)) {
|
||||||
|
console.log("SessionData: Removing unused key:", key)
|
||||||
|
delete settings[key]
|
||||||
|
needsSave = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (needsSave) {
|
||||||
|
settingsFile.setText(JSON.stringify(settings, null, 2))
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.warn("SessionData: Failed to cleanup unused keys:", e.message)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function setLightMode(lightMode) {
|
function setLightMode(lightMode) {
|
||||||
isLightMode = lightMode
|
isLightMode = lightMode
|
||||||
syncWallpaperForCurrentMode()
|
syncWallpaperForCurrentMode()
|
||||||
saveSettings()
|
saveSettings()
|
||||||
}
|
}
|
||||||
|
|
||||||
function syncWallpaperForCurrentMode() {
|
|
||||||
if (!perModeWallpaper) return
|
|
||||||
|
|
||||||
if (perMonitorWallpaper) {
|
|
||||||
monitorWallpapers = isLightMode ? Object.assign({}, monitorWallpapersLight) : Object.assign({}, monitorWallpapersDark)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
wallpaperPath = isLightMode ? wallpaperPathLight : wallpaperPathDark
|
|
||||||
}
|
|
||||||
|
|
||||||
function setDoNotDisturb(enabled) {
|
function setDoNotDisturb(enabled) {
|
||||||
doNotDisturb = enabled
|
doNotDisturb = enabled
|
||||||
saveSettings()
|
saveSettings()
|
||||||
}
|
}
|
||||||
|
|
||||||
function setNightModeEnabled(enabled) {
|
|
||||||
nightModeEnabled = enabled
|
|
||||||
saveSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
function setNightModeTemperature(temperature) {
|
|
||||||
nightModeTemperature = temperature
|
|
||||||
saveSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
function setNightModeAutoEnabled(enabled) {
|
|
||||||
console.log("SessionData: Setting nightModeAutoEnabled to", enabled)
|
|
||||||
nightModeAutoEnabled = enabled
|
|
||||||
saveSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
function setNightModeAutoMode(mode) {
|
|
||||||
nightModeAutoMode = mode
|
|
||||||
saveSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
function setNightModeStartHour(hour) {
|
|
||||||
nightModeStartHour = hour
|
|
||||||
saveSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
function setNightModeStartMinute(minute) {
|
|
||||||
nightModeStartMinute = minute
|
|
||||||
saveSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
function setNightModeEndHour(hour) {
|
|
||||||
nightModeEndHour = hour
|
|
||||||
saveSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
function setNightModeEndMinute(minute) {
|
|
||||||
nightModeEndMinute = minute
|
|
||||||
saveSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
function setLatitude(lat) {
|
|
||||||
console.log("SessionData: Setting latitude to", lat)
|
|
||||||
latitude = lat
|
|
||||||
saveSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
function setLongitude(lng) {
|
|
||||||
console.log("SessionData: Setting longitude to", lng)
|
|
||||||
longitude = lng
|
|
||||||
saveSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
function setNightModeLocationProvider(provider) {
|
|
||||||
nightModeLocationProvider = provider
|
|
||||||
saveSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
function setWallpaperPath(path) {
|
function setWallpaperPath(path) {
|
||||||
wallpaperPath = path
|
wallpaperPath = path
|
||||||
saveSettings()
|
saveSettings()
|
||||||
@@ -353,141 +339,6 @@ Singleton {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function setWallpaperLastPath(path) {
|
|
||||||
wallpaperLastPath = path
|
|
||||||
saveSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
function setProfileLastPath(path) {
|
|
||||||
profileLastPath = path
|
|
||||||
saveSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
function setPinnedApps(apps) {
|
|
||||||
pinnedApps = apps
|
|
||||||
saveSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
function addRecentColor(color) {
|
|
||||||
const colorStr = color.toString()
|
|
||||||
let recent = recentColors.slice()
|
|
||||||
recent = recent.filter(c => c !== colorStr)
|
|
||||||
recent.unshift(colorStr)
|
|
||||||
if (recent.length > 5) recent = recent.slice(0, 5)
|
|
||||||
recentColors = recent
|
|
||||||
saveSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
function addPinnedApp(appId) {
|
|
||||||
if (!appId)
|
|
||||||
return
|
|
||||||
var currentPinned = [...pinnedApps]
|
|
||||||
if (currentPinned.indexOf(appId) === -1) {
|
|
||||||
currentPinned.push(appId)
|
|
||||||
setPinnedApps(currentPinned)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function removePinnedApp(appId) {
|
|
||||||
if (!appId)
|
|
||||||
return
|
|
||||||
var currentPinned = pinnedApps.filter(id => id !== appId)
|
|
||||||
setPinnedApps(currentPinned)
|
|
||||||
}
|
|
||||||
|
|
||||||
function isPinnedApp(appId) {
|
|
||||||
return appId && pinnedApps.indexOf(appId) !== -1
|
|
||||||
}
|
|
||||||
|
|
||||||
function setSelectedGpuIndex(index) {
|
|
||||||
selectedGpuIndex = index
|
|
||||||
saveSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
function setNvidiaGpuTempEnabled(enabled) {
|
|
||||||
nvidiaGpuTempEnabled = enabled
|
|
||||||
saveSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
function setNonNvidiaGpuTempEnabled(enabled) {
|
|
||||||
nonNvidiaGpuTempEnabled = enabled
|
|
||||||
saveSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
function setEnabledGpuPciIds(pciIds) {
|
|
||||||
enabledGpuPciIds = pciIds
|
|
||||||
saveSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
function setWallpaperCyclingEnabled(enabled) {
|
|
||||||
wallpaperCyclingEnabled = enabled
|
|
||||||
saveSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
function setWallpaperCyclingMode(mode) {
|
|
||||||
wallpaperCyclingMode = mode
|
|
||||||
saveSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
function setWallpaperCyclingInterval(interval) {
|
|
||||||
wallpaperCyclingInterval = interval
|
|
||||||
saveSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
function setWallpaperCyclingTime(time) {
|
|
||||||
wallpaperCyclingTime = time
|
|
||||||
saveSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
function getMonitorCyclingSettings(screenName) {
|
|
||||||
return monitorCyclingSettings[screenName] || {
|
|
||||||
enabled: false,
|
|
||||||
mode: "interval",
|
|
||||||
interval: 300,
|
|
||||||
time: "06:00"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function setMonitorCyclingEnabled(screenName, enabled) {
|
|
||||||
var newSettings = Object.assign({}, monitorCyclingSettings)
|
|
||||||
if (!newSettings[screenName]) {
|
|
||||||
newSettings[screenName] = { enabled: false, mode: "interval", interval: 300, time: "06:00" }
|
|
||||||
}
|
|
||||||
newSettings[screenName].enabled = enabled
|
|
||||||
monitorCyclingSettings = newSettings
|
|
||||||
saveSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
function setMonitorCyclingMode(screenName, mode) {
|
|
||||||
var newSettings = Object.assign({}, monitorCyclingSettings)
|
|
||||||
if (!newSettings[screenName]) {
|
|
||||||
newSettings[screenName] = { enabled: false, mode: "interval", interval: 300, time: "06:00" }
|
|
||||||
}
|
|
||||||
newSettings[screenName].mode = mode
|
|
||||||
monitorCyclingSettings = newSettings
|
|
||||||
saveSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
function setMonitorCyclingInterval(screenName, interval) {
|
|
||||||
var newSettings = Object.assign({}, monitorCyclingSettings)
|
|
||||||
if (!newSettings[screenName]) {
|
|
||||||
newSettings[screenName] = { enabled: false, mode: "interval", interval: 300, time: "06:00" }
|
|
||||||
}
|
|
||||||
newSettings[screenName].interval = interval
|
|
||||||
monitorCyclingSettings = newSettings
|
|
||||||
saveSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
function setMonitorCyclingTime(screenName, time) {
|
|
||||||
var newSettings = Object.assign({}, monitorCyclingSettings)
|
|
||||||
if (!newSettings[screenName]) {
|
|
||||||
newSettings[screenName] = { enabled: false, mode: "interval", interval: 300, time: "06:00" }
|
|
||||||
}
|
|
||||||
newSettings[screenName].time = time
|
|
||||||
monitorCyclingSettings = newSettings
|
|
||||||
saveSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
function setPerMonitorWallpaper(enabled) {
|
function setPerMonitorWallpaper(enabled) {
|
||||||
perMonitorWallpaper = enabled
|
perMonitorWallpaper = enabled
|
||||||
if (enabled && perModeWallpaper) {
|
if (enabled && perModeWallpaper) {
|
||||||
@@ -579,15 +430,167 @@ Singleton {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getMonitorWallpaper(screenName) {
|
function setWallpaperTransition(transition) {
|
||||||
if (!perMonitorWallpaper) {
|
wallpaperTransition = transition
|
||||||
return wallpaperPath
|
saveSettings()
|
||||||
}
|
|
||||||
return monitorWallpapers[screenName] || wallpaperPath
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function setLastBrightnessDevice(device) {
|
function setWallpaperCyclingEnabled(enabled) {
|
||||||
lastBrightnessDevice = device
|
wallpaperCyclingEnabled = enabled
|
||||||
|
saveSettings()
|
||||||
|
}
|
||||||
|
|
||||||
|
function setWallpaperCyclingMode(mode) {
|
||||||
|
wallpaperCyclingMode = mode
|
||||||
|
saveSettings()
|
||||||
|
}
|
||||||
|
|
||||||
|
function setWallpaperCyclingInterval(interval) {
|
||||||
|
wallpaperCyclingInterval = interval
|
||||||
|
saveSettings()
|
||||||
|
}
|
||||||
|
|
||||||
|
function setWallpaperCyclingTime(time) {
|
||||||
|
wallpaperCyclingTime = time
|
||||||
|
saveSettings()
|
||||||
|
}
|
||||||
|
|
||||||
|
function setMonitorCyclingEnabled(screenName, enabled) {
|
||||||
|
var newSettings = Object.assign({}, monitorCyclingSettings)
|
||||||
|
if (!newSettings[screenName]) {
|
||||||
|
newSettings[screenName] = { enabled: false, mode: "interval", interval: 300, time: "06:00" }
|
||||||
|
}
|
||||||
|
newSettings[screenName].enabled = enabled
|
||||||
|
monitorCyclingSettings = newSettings
|
||||||
|
saveSettings()
|
||||||
|
}
|
||||||
|
|
||||||
|
function setMonitorCyclingMode(screenName, mode) {
|
||||||
|
var newSettings = Object.assign({}, monitorCyclingSettings)
|
||||||
|
if (!newSettings[screenName]) {
|
||||||
|
newSettings[screenName] = { enabled: false, mode: "interval", interval: 300, time: "06:00" }
|
||||||
|
}
|
||||||
|
newSettings[screenName].mode = mode
|
||||||
|
monitorCyclingSettings = newSettings
|
||||||
|
saveSettings()
|
||||||
|
}
|
||||||
|
|
||||||
|
function setMonitorCyclingInterval(screenName, interval) {
|
||||||
|
var newSettings = Object.assign({}, monitorCyclingSettings)
|
||||||
|
if (!newSettings[screenName]) {
|
||||||
|
newSettings[screenName] = { enabled: false, mode: "interval", interval: 300, time: "06:00" }
|
||||||
|
}
|
||||||
|
newSettings[screenName].interval = interval
|
||||||
|
monitorCyclingSettings = newSettings
|
||||||
|
saveSettings()
|
||||||
|
}
|
||||||
|
|
||||||
|
function setMonitorCyclingTime(screenName, time) {
|
||||||
|
var newSettings = Object.assign({}, monitorCyclingSettings)
|
||||||
|
if (!newSettings[screenName]) {
|
||||||
|
newSettings[screenName] = { enabled: false, mode: "interval", interval: 300, time: "06:00" }
|
||||||
|
}
|
||||||
|
newSettings[screenName].time = time
|
||||||
|
monitorCyclingSettings = newSettings
|
||||||
|
saveSettings()
|
||||||
|
}
|
||||||
|
|
||||||
|
function setNightModeEnabled(enabled) {
|
||||||
|
nightModeEnabled = enabled
|
||||||
|
saveSettings()
|
||||||
|
}
|
||||||
|
|
||||||
|
function setNightModeTemperature(temperature) {
|
||||||
|
nightModeTemperature = temperature
|
||||||
|
saveSettings()
|
||||||
|
}
|
||||||
|
|
||||||
|
function setNightModeAutoEnabled(enabled) {
|
||||||
|
console.log("SessionData: Setting nightModeAutoEnabled to", enabled)
|
||||||
|
nightModeAutoEnabled = enabled
|
||||||
|
saveSettings()
|
||||||
|
}
|
||||||
|
|
||||||
|
function setNightModeAutoMode(mode) {
|
||||||
|
nightModeAutoMode = mode
|
||||||
|
saveSettings()
|
||||||
|
}
|
||||||
|
|
||||||
|
function setNightModeStartHour(hour) {
|
||||||
|
nightModeStartHour = hour
|
||||||
|
saveSettings()
|
||||||
|
}
|
||||||
|
|
||||||
|
function setNightModeStartMinute(minute) {
|
||||||
|
nightModeStartMinute = minute
|
||||||
|
saveSettings()
|
||||||
|
}
|
||||||
|
|
||||||
|
function setNightModeEndHour(hour) {
|
||||||
|
nightModeEndHour = hour
|
||||||
|
saveSettings()
|
||||||
|
}
|
||||||
|
|
||||||
|
function setNightModeEndMinute(minute) {
|
||||||
|
nightModeEndMinute = minute
|
||||||
|
saveSettings()
|
||||||
|
}
|
||||||
|
|
||||||
|
function setLatitude(lat) {
|
||||||
|
console.log("SessionData: Setting latitude to", lat)
|
||||||
|
latitude = lat
|
||||||
|
saveSettings()
|
||||||
|
}
|
||||||
|
|
||||||
|
function setLongitude(lng) {
|
||||||
|
console.log("SessionData: Setting longitude to", lng)
|
||||||
|
longitude = lng
|
||||||
|
saveSettings()
|
||||||
|
}
|
||||||
|
|
||||||
|
function setNightModeLocationProvider(provider) {
|
||||||
|
nightModeLocationProvider = provider
|
||||||
|
saveSettings()
|
||||||
|
}
|
||||||
|
|
||||||
|
function setPinnedApps(apps) {
|
||||||
|
pinnedApps = apps
|
||||||
|
saveSettings()
|
||||||
|
}
|
||||||
|
|
||||||
|
function addPinnedApp(appId) {
|
||||||
|
if (!appId)
|
||||||
|
return
|
||||||
|
var currentPinned = [...pinnedApps]
|
||||||
|
if (currentPinned.indexOf(appId) === -1) {
|
||||||
|
currentPinned.push(appId)
|
||||||
|
setPinnedApps(currentPinned)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function removePinnedApp(appId) {
|
||||||
|
if (!appId)
|
||||||
|
return
|
||||||
|
var currentPinned = pinnedApps.filter(id => id !== appId)
|
||||||
|
setPinnedApps(currentPinned)
|
||||||
|
}
|
||||||
|
|
||||||
|
function isPinnedApp(appId) {
|
||||||
|
return appId && pinnedApps.indexOf(appId) !== -1
|
||||||
|
}
|
||||||
|
|
||||||
|
function addRecentColor(color) {
|
||||||
|
const colorStr = color.toString()
|
||||||
|
let recent = recentColors.slice()
|
||||||
|
recent = recent.filter(c => c !== colorStr)
|
||||||
|
recent.unshift(colorStr)
|
||||||
|
if (recent.length > 5) recent = recent.slice(0, 5)
|
||||||
|
recentColors = recent
|
||||||
|
saveSettings()
|
||||||
|
}
|
||||||
|
|
||||||
|
function setShowThirdPartyPlugins(enabled) {
|
||||||
|
showThirdPartyPlugins = enabled
|
||||||
saveSettings()
|
saveSettings()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -596,64 +599,56 @@ Singleton {
|
|||||||
saveSettings()
|
saveSettings()
|
||||||
}
|
}
|
||||||
|
|
||||||
function setWallpaperTransition(transition) {
|
function setLastBrightnessDevice(device) {
|
||||||
wallpaperTransition = transition
|
lastBrightnessDevice = device
|
||||||
saveSettings()
|
saveSettings()
|
||||||
}
|
}
|
||||||
|
|
||||||
function setAcMonitorTimeout(timeout) {
|
function setSelectedGpuIndex(index) {
|
||||||
acMonitorTimeout = timeout
|
selectedGpuIndex = index
|
||||||
saveSettings()
|
saveSettings()
|
||||||
}
|
}
|
||||||
|
|
||||||
function setAcLockTimeout(timeout) {
|
function setNvidiaGpuTempEnabled(enabled) {
|
||||||
acLockTimeout = timeout
|
nvidiaGpuTempEnabled = enabled
|
||||||
saveSettings()
|
saveSettings()
|
||||||
}
|
}
|
||||||
|
|
||||||
function setAcSuspendTimeout(timeout) {
|
function setNonNvidiaGpuTempEnabled(enabled) {
|
||||||
acSuspendTimeout = timeout
|
nonNvidiaGpuTempEnabled = enabled
|
||||||
saveSettings()
|
saveSettings()
|
||||||
}
|
}
|
||||||
|
|
||||||
function setBatteryMonitorTimeout(timeout) {
|
function setEnabledGpuPciIds(pciIds) {
|
||||||
batteryMonitorTimeout = timeout
|
enabledGpuPciIds = pciIds
|
||||||
saveSettings()
|
saveSettings()
|
||||||
}
|
}
|
||||||
|
|
||||||
function setBatteryLockTimeout(timeout) {
|
function syncWallpaperForCurrentMode() {
|
||||||
batteryLockTimeout = timeout
|
if (!perModeWallpaper) return
|
||||||
saveSettings()
|
|
||||||
|
if (perMonitorWallpaper) {
|
||||||
|
monitorWallpapers = isLightMode ? Object.assign({}, monitorWallpapersLight) : Object.assign({}, monitorWallpapersDark)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
wallpaperPath = isLightMode ? wallpaperPathLight : wallpaperPathDark
|
||||||
}
|
}
|
||||||
|
|
||||||
function setBatterySuspendTimeout(timeout) {
|
function getMonitorWallpaper(screenName) {
|
||||||
batterySuspendTimeout = timeout
|
if (!perMonitorWallpaper) {
|
||||||
saveSettings()
|
return wallpaperPath
|
||||||
|
}
|
||||||
|
return monitorWallpapers[screenName] || wallpaperPath
|
||||||
}
|
}
|
||||||
|
|
||||||
function setAcHibernateTimeout(timeout) {
|
function getMonitorCyclingSettings(screenName) {
|
||||||
acHibernateTimeout = timeout
|
return monitorCyclingSettings[screenName] || {
|
||||||
saveSettings()
|
enabled: false,
|
||||||
}
|
mode: "interval",
|
||||||
|
interval: 300,
|
||||||
function setBatteryHibernateTimeout(timeout) {
|
time: "06:00"
|
||||||
batteryHibernateTimeout = timeout
|
}
|
||||||
saveSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
function setLockBeforeSuspend(enabled) {
|
|
||||||
lockBeforeSuspend = enabled
|
|
||||||
saveSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
function setLoginctlLockIntegration(enabled) {
|
|
||||||
loginctlLockIntegration = enabled
|
|
||||||
saveSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
function setShowThirdPartyPlugins(enabled) {
|
|
||||||
showThirdPartyPlugins = enabled
|
|
||||||
saveSettings()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
FileView {
|
FileView {
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -78,7 +78,7 @@ Singleton {
|
|||||||
property var matugenColors: ({})
|
property var matugenColors: ({})
|
||||||
property var customThemeData: null
|
property var customThemeData: null
|
||||||
|
|
||||||
readonly property string stateDir: Paths.strip(StandardPaths.writableLocation(StandardPaths.CacheLocation).toString()) + "/dankshell"
|
readonly property string stateDir: Paths.strip(StandardPaths.writableLocation(StandardPaths.CacheLocation).toString()) + "/DankMaterialShell"
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
Quickshell.execDetached(["mkdir", "-p", stateDir])
|
Quickshell.execDetached(["mkdir", "-p", stateDir])
|
||||||
|
|||||||
@@ -48,15 +48,17 @@ DankModal {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getLastPath() {
|
function getLastPath() {
|
||||||
const lastPath = browserType === "wallpaper" ? SessionData.wallpaperLastPath : browserType === "profile" ? SessionData.profileLastPath : ""
|
const lastPath = browserType === "wallpaper" ? CacheData.wallpaperLastPath : browserType === "profile" ? CacheData.profileLastPath : ""
|
||||||
return (lastPath && lastPath !== "") ? lastPath : homeDir
|
return (lastPath && lastPath !== "") ? lastPath : homeDir
|
||||||
}
|
}
|
||||||
|
|
||||||
function saveLastPath(path) {
|
function saveLastPath(path) {
|
||||||
if (browserType === "wallpaper") {
|
if (browserType === "wallpaper") {
|
||||||
SessionData.setWallpaperLastPath(path)
|
CacheData.wallpaperLastPath = path
|
||||||
|
CacheData.saveCache()
|
||||||
} else if (browserType === "profile") {
|
} else if (browserType === "profile") {
|
||||||
SessionData.setProfileLastPath(path)
|
CacheData.profileLastPath = path
|
||||||
|
CacheData.saveCache()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -80,11 +80,11 @@ Item {
|
|||||||
width: parent.width
|
width: parent.width
|
||||||
text: I18n.tr("Enable loginctl lock integration")
|
text: I18n.tr("Enable loginctl lock integration")
|
||||||
description: I18n.tr("Bind lock screen to dbus signals from loginctl. Disable if using an external lock screen")
|
description: I18n.tr("Bind lock screen to dbus signals from loginctl. Disable if using an external lock screen")
|
||||||
checked: SessionService.loginctlAvailable && SessionData.loginctlLockIntegration
|
checked: SessionService.loginctlAvailable && SettingsData.loginctlLockIntegration
|
||||||
enabled: SessionService.loginctlAvailable
|
enabled: SessionService.loginctlAvailable
|
||||||
onToggled: checked => {
|
onToggled: checked => {
|
||||||
if (SessionService.loginctlAvailable) {
|
if (SessionService.loginctlAvailable) {
|
||||||
SessionData.setLoginctlLockIntegration(checked)
|
SettingsData.setLoginctlLockIntegration(checked)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -93,9 +93,9 @@ Item {
|
|||||||
width: parent.width
|
width: parent.width
|
||||||
text: I18n.tr("Lock before suspend")
|
text: I18n.tr("Lock before suspend")
|
||||||
description: I18n.tr("Automatically lock the screen when the system prepares to suspend")
|
description: I18n.tr("Automatically lock the screen when the system prepares to suspend")
|
||||||
checked: SessionData.lockBeforeSuspend
|
checked: SettingsData.lockBeforeSuspend
|
||||||
visible: SessionService.loginctlAvailable && SessionData.loginctlLockIntegration
|
visible: SessionService.loginctlAvailable && SettingsData.loginctlLockIntegration
|
||||||
onToggled: checked => SessionData.setLockBeforeSuspend(checked)
|
onToggled: checked => SettingsData.setLockBeforeSuspend(checked)
|
||||||
}
|
}
|
||||||
|
|
||||||
DankToggle {
|
DankToggle {
|
||||||
@@ -169,14 +169,14 @@ Item {
|
|||||||
Connections {
|
Connections {
|
||||||
target: powerCategory
|
target: powerCategory
|
||||||
function onCurrentIndexChanged() {
|
function onCurrentIndexChanged() {
|
||||||
const currentTimeout = powerCategory.currentIndex === 0 ? SessionData.acLockTimeout : SessionData.batteryLockTimeout
|
const currentTimeout = powerCategory.currentIndex === 0 ? SettingsData.acLockTimeout : SettingsData.batteryLockTimeout
|
||||||
const index = lockDropdown.timeoutValues.indexOf(currentTimeout)
|
const index = lockDropdown.timeoutValues.indexOf(currentTimeout)
|
||||||
lockDropdown.currentValue = index >= 0 ? lockDropdown.timeoutOptions[index] : "Never"
|
lockDropdown.currentValue = index >= 0 ? lockDropdown.timeoutOptions[index] : "Never"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
const currentTimeout = powerCategory.currentIndex === 0 ? SessionData.acLockTimeout : SessionData.batteryLockTimeout
|
const currentTimeout = powerCategory.currentIndex === 0 ? SettingsData.acLockTimeout : SettingsData.batteryLockTimeout
|
||||||
const index = timeoutValues.indexOf(currentTimeout)
|
const index = timeoutValues.indexOf(currentTimeout)
|
||||||
currentValue = index >= 0 ? timeoutOptions[index] : "Never"
|
currentValue = index >= 0 ? timeoutOptions[index] : "Never"
|
||||||
}
|
}
|
||||||
@@ -186,9 +186,9 @@ Item {
|
|||||||
if (index >= 0) {
|
if (index >= 0) {
|
||||||
const timeout = timeoutValues[index]
|
const timeout = timeoutValues[index]
|
||||||
if (powerCategory.currentIndex === 0) {
|
if (powerCategory.currentIndex === 0) {
|
||||||
SessionData.setAcLockTimeout(timeout)
|
SettingsData.setAcLockTimeout(timeout)
|
||||||
} else {
|
} else {
|
||||||
SessionData.setBatteryLockTimeout(timeout)
|
SettingsData.setBatteryLockTimeout(timeout)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -205,14 +205,14 @@ Item {
|
|||||||
Connections {
|
Connections {
|
||||||
target: powerCategory
|
target: powerCategory
|
||||||
function onCurrentIndexChanged() {
|
function onCurrentIndexChanged() {
|
||||||
const currentTimeout = powerCategory.currentIndex === 0 ? SessionData.acMonitorTimeout : SessionData.batteryMonitorTimeout
|
const currentTimeout = powerCategory.currentIndex === 0 ? SettingsData.acMonitorTimeout : SettingsData.batteryMonitorTimeout
|
||||||
const index = monitorDropdown.timeoutValues.indexOf(currentTimeout)
|
const index = monitorDropdown.timeoutValues.indexOf(currentTimeout)
|
||||||
monitorDropdown.currentValue = index >= 0 ? monitorDropdown.timeoutOptions[index] : "Never"
|
monitorDropdown.currentValue = index >= 0 ? monitorDropdown.timeoutOptions[index] : "Never"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
const currentTimeout = powerCategory.currentIndex === 0 ? SessionData.acMonitorTimeout : SessionData.batteryMonitorTimeout
|
const currentTimeout = powerCategory.currentIndex === 0 ? SettingsData.acMonitorTimeout : SettingsData.batteryMonitorTimeout
|
||||||
const index = timeoutValues.indexOf(currentTimeout)
|
const index = timeoutValues.indexOf(currentTimeout)
|
||||||
currentValue = index >= 0 ? timeoutOptions[index] : "Never"
|
currentValue = index >= 0 ? timeoutOptions[index] : "Never"
|
||||||
}
|
}
|
||||||
@@ -222,9 +222,9 @@ Item {
|
|||||||
if (index >= 0) {
|
if (index >= 0) {
|
||||||
const timeout = timeoutValues[index]
|
const timeout = timeoutValues[index]
|
||||||
if (powerCategory.currentIndex === 0) {
|
if (powerCategory.currentIndex === 0) {
|
||||||
SessionData.setAcMonitorTimeout(timeout)
|
SettingsData.setAcMonitorTimeout(timeout)
|
||||||
} else {
|
} else {
|
||||||
SessionData.setBatteryMonitorTimeout(timeout)
|
SettingsData.setBatteryMonitorTimeout(timeout)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -241,14 +241,14 @@ Item {
|
|||||||
Connections {
|
Connections {
|
||||||
target: powerCategory
|
target: powerCategory
|
||||||
function onCurrentIndexChanged() {
|
function onCurrentIndexChanged() {
|
||||||
const currentTimeout = powerCategory.currentIndex === 0 ? SessionData.acSuspendTimeout : SessionData.batterySuspendTimeout
|
const currentTimeout = powerCategory.currentIndex === 0 ? SettingsData.acSuspendTimeout : SettingsData.batterySuspendTimeout
|
||||||
const index = suspendDropdown.timeoutValues.indexOf(currentTimeout)
|
const index = suspendDropdown.timeoutValues.indexOf(currentTimeout)
|
||||||
suspendDropdown.currentValue = index >= 0 ? suspendDropdown.timeoutOptions[index] : "Never"
|
suspendDropdown.currentValue = index >= 0 ? suspendDropdown.timeoutOptions[index] : "Never"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
const currentTimeout = powerCategory.currentIndex === 0 ? SessionData.acSuspendTimeout : SessionData.batterySuspendTimeout
|
const currentTimeout = powerCategory.currentIndex === 0 ? SettingsData.acSuspendTimeout : SettingsData.batterySuspendTimeout
|
||||||
const index = timeoutValues.indexOf(currentTimeout)
|
const index = timeoutValues.indexOf(currentTimeout)
|
||||||
currentValue = index >= 0 ? timeoutOptions[index] : "Never"
|
currentValue = index >= 0 ? timeoutOptions[index] : "Never"
|
||||||
}
|
}
|
||||||
@@ -258,9 +258,9 @@ Item {
|
|||||||
if (index >= 0) {
|
if (index >= 0) {
|
||||||
const timeout = timeoutValues[index]
|
const timeout = timeoutValues[index]
|
||||||
if (powerCategory.currentIndex === 0) {
|
if (powerCategory.currentIndex === 0) {
|
||||||
SessionData.setAcSuspendTimeout(timeout)
|
SettingsData.setAcSuspendTimeout(timeout)
|
||||||
} else {
|
} else {
|
||||||
SessionData.setBatterySuspendTimeout(timeout)
|
SettingsData.setBatterySuspendTimeout(timeout)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -278,14 +278,14 @@ Item {
|
|||||||
Connections {
|
Connections {
|
||||||
target: powerCategory
|
target: powerCategory
|
||||||
function onCurrentIndexChanged() {
|
function onCurrentIndexChanged() {
|
||||||
const currentTimeout = powerCategory.currentIndex === 0 ? SessionData.acHibernateTimeout : SessionData.batteryHibernateTimeout
|
const currentTimeout = powerCategory.currentIndex === 0 ? SettingsData.acHibernateTimeout : SettingsData.batteryHibernateTimeout
|
||||||
const index = hibernateDropdown.timeoutValues.indexOf(currentTimeout)
|
const index = hibernateDropdown.timeoutValues.indexOf(currentTimeout)
|
||||||
hibernateDropdown.currentValue = index >= 0 ? hibernateDropdown.timeoutOptions[index] : "Never"
|
hibernateDropdown.currentValue = index >= 0 ? hibernateDropdown.timeoutOptions[index] : "Never"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
const currentTimeout = powerCategory.currentIndex === 0 ? SessionData.acHibernateTimeout : SessionData.batteryHibernateTimeout
|
const currentTimeout = powerCategory.currentIndex === 0 ? SettingsData.acHibernateTimeout : SettingsData.batteryHibernateTimeout
|
||||||
const index = timeoutValues.indexOf(currentTimeout)
|
const index = timeoutValues.indexOf(currentTimeout)
|
||||||
currentValue = index >= 0 ? timeoutOptions[index] : "Never"
|
currentValue = index >= 0 ? timeoutOptions[index] : "Never"
|
||||||
}
|
}
|
||||||
@@ -295,9 +295,9 @@ Item {
|
|||||||
if (index >= 0) {
|
if (index >= 0) {
|
||||||
const timeout = timeoutValues[index]
|
const timeout = timeoutValues[index]
|
||||||
if (powerCategory.currentIndex === 0) {
|
if (powerCategory.currentIndex === 0) {
|
||||||
SessionData.setAcHibernateTimeout(timeout)
|
SettingsData.setAcHibernateTimeout(timeout)
|
||||||
} else {
|
} else {
|
||||||
SessionData.setBatteryHibernateTimeout(timeout)
|
SettingsData.setBatteryHibernateTimeout(timeout)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -168,7 +168,7 @@ Item {
|
|||||||
if (screenName && currentWallpaper && currentWallpaper.startsWith("we:")) {
|
if (screenName && currentWallpaper && currentWallpaper.startsWith("we:")) {
|
||||||
const cacheHome = StandardPaths.writableLocation(StandardPaths.CacheLocation).toString()
|
const cacheHome = StandardPaths.writableLocation(StandardPaths.CacheLocation).toString()
|
||||||
const baseDir = Paths.strip(cacheHome)
|
const baseDir = Paths.strip(cacheHome)
|
||||||
const screenshotPath = baseDir + "/dankshell/we_screenshots" + "/" + currentWallpaper.substring(3) + ".jpg"
|
const screenshotPath = baseDir + "/DankMaterialShell/we_screenshots" + "/" + currentWallpaper.substring(3) + ".jpg"
|
||||||
return screenshotPath
|
return screenshotPath
|
||||||
}
|
}
|
||||||
return (currentWallpaper && !currentWallpaper.startsWith("#")) ? currentWallpaper : ""
|
return (currentWallpaper && !currentWallpaper.startsWith("#")) ? currentWallpaper : ""
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ Scope {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function lock() {
|
function lock() {
|
||||||
if (!processingExternalEvent && SessionData.loginctlLockIntegration && DMSService.isConnected) {
|
if (!processingExternalEvent && SettingsData.loginctlLockIntegration && DMSService.isConnected) {
|
||||||
DMSService.lockSession(response => {
|
DMSService.lockSession(response => {
|
||||||
if (response.error) {
|
if (response.error) {
|
||||||
console.warn("Lock: Failed to call loginctl.lock:", response.error)
|
console.warn("Lock: Failed to call loginctl.lock:", response.error)
|
||||||
@@ -32,7 +32,7 @@ Scope {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function unlock() {
|
function unlock() {
|
||||||
if (!processingExternalEvent && SessionData.loginctlLockIntegration && DMSService.isConnected) {
|
if (!processingExternalEvent && SettingsData.loginctlLockIntegration && DMSService.isConnected) {
|
||||||
DMSService.unlockSession(response => {
|
DMSService.unlockSession(response => {
|
||||||
if (response.error) {
|
if (response.error) {
|
||||||
console.warn("Lock: Failed to call loginctl.unlock:", response.error)
|
console.warn("Lock: Failed to call loginctl.unlock:", response.error)
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ Item {
|
|||||||
if (screenName && currentWallpaper && currentWallpaper.startsWith("we:")) {
|
if (screenName && currentWallpaper && currentWallpaper.startsWith("we:")) {
|
||||||
const cacheHome = StandardPaths.writableLocation(StandardPaths.CacheLocation).toString()
|
const cacheHome = StandardPaths.writableLocation(StandardPaths.CacheLocation).toString()
|
||||||
const baseDir = Paths.strip(cacheHome)
|
const baseDir = Paths.strip(cacheHome)
|
||||||
const screenshotPath = baseDir + "/dankshell/we_screenshots" + "/" + currentWallpaper.substring(3) + ".jpg"
|
const screenshotPath = baseDir + "/DankMaterialShell/we_screenshots" + "/" + currentWallpaper.substring(3) + ".jpg"
|
||||||
return screenshotPath
|
return screenshotPath
|
||||||
}
|
}
|
||||||
return (currentWallpaper && !currentWallpaper.startsWith("#")) ? currentWallpaper : ""
|
return (currentWallpaper && !currentWallpaper.startsWith("#")) ? currentWallpaper : ""
|
||||||
|
|||||||
@@ -448,10 +448,10 @@ Item {
|
|||||||
|
|
||||||
DankTextField {
|
DankTextField {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
text: SessionData.launchPrefix
|
text: SettingsData.launchPrefix
|
||||||
placeholderText: "Enter launch prefix (e.g., 'uwsm-app')"
|
placeholderText: "Enter launch prefix (e.g., 'uwsm-app')"
|
||||||
onTextEdited: {
|
onTextEdited: {
|
||||||
SessionData.setLaunchPrefix(text)
|
SettingsData.setLaunchPrefix(text)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ Item {
|
|||||||
if (pendingSceneId !== "") {
|
if (pendingSceneId !== "") {
|
||||||
const cacheHome = StandardPaths.writableLocation(StandardPaths.CacheLocation).toString()
|
const cacheHome = StandardPaths.writableLocation(StandardPaths.CacheLocation).toString()
|
||||||
const baseDir = Paths.strip(cacheHome)
|
const baseDir = Paths.strip(cacheHome)
|
||||||
const outDir = baseDir + "/dankshell/we_screenshots"
|
const outDir = baseDir + "/DankMaterialShell/we_screenshots"
|
||||||
const outPath = outDir + "/" + pendingSceneId + ".jpg"
|
const outPath = outDir + "/" + pendingSceneId + ".jpg"
|
||||||
|
|
||||||
Quickshell.execDetached(["mkdir", "-p", outDir])
|
Quickshell.execDetached(["mkdir", "-p", outDir])
|
||||||
|
|||||||
@@ -23,10 +23,10 @@ Singleton {
|
|||||||
property bool _enableGate: true
|
property bool _enableGate: true
|
||||||
|
|
||||||
readonly property bool isOnBattery: BatteryService.batteryAvailable && !BatteryService.isPluggedIn
|
readonly property bool isOnBattery: BatteryService.batteryAvailable && !BatteryService.isPluggedIn
|
||||||
readonly property int monitorTimeout: isOnBattery ? SessionData.batteryMonitorTimeout : SessionData.acMonitorTimeout
|
readonly property int monitorTimeout: isOnBattery ? SettingsData.batteryMonitorTimeout : SettingsData.acMonitorTimeout
|
||||||
readonly property int lockTimeout: isOnBattery ? SessionData.batteryLockTimeout : SessionData.acLockTimeout
|
readonly property int lockTimeout: isOnBattery ? SettingsData.batteryLockTimeout : SettingsData.acLockTimeout
|
||||||
readonly property int suspendTimeout: isOnBattery ? SessionData.batterySuspendTimeout : SessionData.acSuspendTimeout
|
readonly property int suspendTimeout: isOnBattery ? SettingsData.batterySuspendTimeout : SettingsData.acSuspendTimeout
|
||||||
readonly property int hibernateTimeout: isOnBattery ? SessionData.batteryHibernateTimeout : SessionData.acHibernateTimeout
|
readonly property int hibernateTimeout: isOnBattery ? SettingsData.batteryHibernateTimeout : SettingsData.acHibernateTimeout
|
||||||
|
|
||||||
onMonitorTimeoutChanged: _rearmIdleMonitors()
|
onMonitorTimeoutChanged: _rearmIdleMonitors()
|
||||||
onLockTimeoutChanged: _rearmIdleMonitors()
|
onLockTimeoutChanged: _rearmIdleMonitors()
|
||||||
@@ -139,7 +139,7 @@ Singleton {
|
|||||||
Connections {
|
Connections {
|
||||||
target: SessionService
|
target: SessionService
|
||||||
function onPrepareForSleep() {
|
function onPrepareForSleep() {
|
||||||
if (SessionData.lockBeforeSuspend) {
|
if (SettingsData.lockBeforeSuspend) {
|
||||||
root.lockRequested()
|
root.lockRequested()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ Singleton {
|
|||||||
detectHibernateProcess.running = true
|
detectHibernateProcess.running = true
|
||||||
detectPrimeRunProcess.running = true
|
detectPrimeRunProcess.running = true
|
||||||
console.log("SessionService: Native inhibitor available:", nativeInhibitorAvailable)
|
console.log("SessionService: Native inhibitor available:", nativeInhibitorAvailable)
|
||||||
if (!SessionData.loginctlLockIntegration) {
|
if (!SettingsData.loginctlLockIntegration) {
|
||||||
console.log("SessionService: loginctl lock integration disabled by user")
|
console.log("SessionService: loginctl lock integration disabled by user")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -142,8 +142,8 @@ Singleton {
|
|||||||
if (usePrimeRun && hasPrimeRun) {
|
if (usePrimeRun && hasPrimeRun) {
|
||||||
cmd = ["prime-run"].concat(cmd)
|
cmd = ["prime-run"].concat(cmd)
|
||||||
}
|
}
|
||||||
if (SessionData.launchPrefix && SessionData.launchPrefix.length > 0) {
|
if (SettingsData.launchPrefix && SettingsData.launchPrefix.length > 0) {
|
||||||
const launchPrefix = SessionData.launchPrefix.trim().split(" ")
|
const launchPrefix = SettingsData.launchPrefix.trim().split(" ")
|
||||||
cmd = launchPrefix.concat(cmd)
|
cmd = launchPrefix.concat(cmd)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -158,8 +158,8 @@ Singleton {
|
|||||||
if (usePrimeRun && hasPrimeRun) {
|
if (usePrimeRun && hasPrimeRun) {
|
||||||
cmd = ["prime-run"].concat(cmd)
|
cmd = ["prime-run"].concat(cmd)
|
||||||
}
|
}
|
||||||
if (SessionData.launchPrefix && SessionData.launchPrefix.length > 0) {
|
if (SettingsData.launchPrefix && SettingsData.launchPrefix.length > 0) {
|
||||||
const launchPrefix = SessionData.launchPrefix.trim().split(" ")
|
const launchPrefix = SettingsData.launchPrefix.trim().split(" ")
|
||||||
cmd = launchPrefix.concat(cmd)
|
cmd = launchPrefix.concat(cmd)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -297,7 +297,7 @@ Singleton {
|
|||||||
target: SessionData
|
target: SessionData
|
||||||
|
|
||||||
function onLoginctlLockIntegrationChanged() {
|
function onLoginctlLockIntegrationChanged() {
|
||||||
if (SessionData.loginctlLockIntegration) {
|
if (SettingsData.loginctlLockIntegration) {
|
||||||
if (socketPath && socketPath.length > 0 && loginctlAvailable) {
|
if (socketPath && socketPath.length > 0 && loginctlAvailable) {
|
||||||
if (!stateInitialized) {
|
if (!stateInitialized) {
|
||||||
stateInitialized = true
|
stateInitialized = true
|
||||||
@@ -311,7 +311,7 @@ Singleton {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function onLockBeforeSuspendChanged() {
|
function onLockBeforeSuspendChanged() {
|
||||||
if (SessionData.loginctlLockIntegration) {
|
if (SettingsData.loginctlLockIntegration) {
|
||||||
syncLockBeforeSuspend()
|
syncLockBeforeSuspend()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -319,7 +319,7 @@ Singleton {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: DMSService
|
target: DMSService
|
||||||
enabled: SessionData.loginctlLockIntegration
|
enabled: SettingsData.loginctlLockIntegration
|
||||||
|
|
||||||
function onLoginctlStateUpdate(data) {
|
function onLoginctlStateUpdate(data) {
|
||||||
updateLoginctlState(data)
|
updateLoginctlState(data)
|
||||||
@@ -341,7 +341,7 @@ Singleton {
|
|||||||
|
|
||||||
if (DMSService.capabilities.includes("loginctl")) {
|
if (DMSService.capabilities.includes("loginctl")) {
|
||||||
loginctlAvailable = true
|
loginctlAvailable = true
|
||||||
if (SessionData.loginctlLockIntegration && !stateInitialized) {
|
if (SettingsData.loginctlLockIntegration && !stateInitialized) {
|
||||||
stateInitialized = true
|
stateInitialized = true
|
||||||
getLoginctlState()
|
getLoginctlState()
|
||||||
syncLockBeforeSuspend()
|
syncLockBeforeSuspend()
|
||||||
@@ -366,12 +366,12 @@ Singleton {
|
|||||||
if (!loginctlAvailable) return
|
if (!loginctlAvailable) return
|
||||||
|
|
||||||
DMSService.sendRequest("loginctl.setLockBeforeSuspend", {
|
DMSService.sendRequest("loginctl.setLockBeforeSuspend", {
|
||||||
enabled: SessionData.lockBeforeSuspend
|
enabled: SettingsData.lockBeforeSuspend
|
||||||
}, response => {
|
}, response => {
|
||||||
if (response.error) {
|
if (response.error) {
|
||||||
console.warn("SessionService: Failed to sync lock before suspend:", response.error)
|
console.warn("SessionService: Failed to sync lock before suspend:", response.error)
|
||||||
} else {
|
} else {
|
||||||
console.log("SessionService: Synced lock before suspend:", SessionData.lockBeforeSuspend)
|
console.log("SessionService: Synced lock before suspend:", SettingsData.lockBeforeSuspend)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user