From 666d451f4b063bb86775bd9da1a3af1211efc072 Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Sun, 12 Apr 2026 23:02:00 +1000 Subject: [PATCH] fix: global config use for rest of global props --- modules/BatteryMonitor.qml | 4 +- .../bar/popouts/kblayout/KbLayoutModel.qml | 2 +- .../controlcenter/launcher/LauncherPane.qml | 24 ++++++------ modules/controlcenter/launcher/Settings.qml | 16 ++++---- .../controlcenter/network/NetworkSettings.qml | 8 ++-- modules/controlcenter/network/VpnDetails.qml | 18 ++++----- modules/controlcenter/network/VpnList.qml | 38 +++++++++---------- modules/controlcenter/network/VpnSettings.qml | 20 +++++----- .../notifications/NotificationsPane.qml | 26 ++++++------- modules/launcher/Content.qml | 2 +- modules/launcher/services/Actions.qml | 4 +- modules/launcher/services/Apps.qml | 6 +-- modules/launcher/services/M3Variants.qml | 2 +- modules/launcher/services/Schemes.qml | 2 +- modules/notifications/Notification.qml | 2 +- modules/utilities/cards/Toggles.qml | 2 +- services/Audio.qml | 4 +- services/GameMode.qml | 4 +- services/Hypr.qml | 6 +-- services/NotifData.qml | 6 +-- services/Notifs.qml | 4 +- services/Players.qml | 2 +- services/VPN.qml | 6 +-- services/Wallpapers.qml | 2 +- 24 files changed, 105 insertions(+), 105 deletions(-) diff --git a/modules/BatteryMonitor.qml b/modules/BatteryMonitor.qml index b6412283..d0327ba0 100644 --- a/modules/BatteryMonitor.qml +++ b/modules/BatteryMonitor.qml @@ -12,10 +12,10 @@ Scope { Connections { function onOnBatteryChanged(): void { if (UPower.onBattery) { - if (Config.utilities.toasts.chargingChanged) + if (GlobalConfig.utilities.toasts.chargingChanged) Toaster.toast(qsTr("Charger unplugged"), qsTr("Battery is discharging"), "power_off"); } else { - if (Config.utilities.toasts.chargingChanged) + if (GlobalConfig.utilities.toasts.chargingChanged) Toaster.toast(qsTr("Charger plugged in"), qsTr("Battery is charging"), "power"); for (const level of root.warnLevels) level.warned = false; diff --git a/modules/bar/popouts/kblayout/KbLayoutModel.qml b/modules/bar/popouts/kblayout/KbLayoutModel.qml index b6535847..f62d0b98 100644 --- a/modules/bar/popouts/kblayout/KbLayoutModel.qml +++ b/modules/bar/popouts/kblayout/KbLayoutModel.qml @@ -106,7 +106,7 @@ Item { arr = arr.filter(i => i.layoutIndex !== activeIndex); arr.forEach(i => _visibleModel.append(i)); - if (!Config.utilities.toasts.kbLimit) + if (!GlobalConfig.utilities.toasts.kbLimit) return; if (_layoutsModel.count > 4) { diff --git a/modules/controlcenter/launcher/LauncherPane.qml b/modules/controlcenter/launcher/LauncherPane.qml index e5353fba..70649bce 100644 --- a/modules/controlcenter/launcher/LauncherPane.qml +++ b/modules/controlcenter/launcher/LauncherPane.qml @@ -37,8 +37,8 @@ Item { const appId = root.selectedApp.id || root.selectedApp.entry?.id; - root.hideFromLauncherChecked = Config.launcher.hiddenApps && Config.launcher.hiddenApps.length > 0 && Strings.testRegexList(Config.launcher.hiddenApps, appId); - root.favouriteChecked = Config.launcher.favouriteApps && Config.launcher.favouriteApps.length > 0 && Strings.testRegexList(Config.launcher.favouriteApps, appId); + root.hideFromLauncherChecked = GlobalConfig.launcher.hiddenApps && GlobalConfig.launcher.hiddenApps.length > 0 && Strings.testRegexList(GlobalConfig.launcher.hiddenApps, appId); + root.favouriteChecked = GlobalConfig.launcher.favouriteApps && GlobalConfig.launcher.favouriteApps.length > 0 && Strings.testRegexList(GlobalConfig.launcher.favouriteApps, appId); } function saveHiddenApps(isHidden) { @@ -48,7 +48,7 @@ Item { const appId = root.selectedApp.id || root.selectedApp.entry?.id; - const hiddenApps = Config.launcher.hiddenApps ? [...Config.launcher.hiddenApps] : []; + const hiddenApps = GlobalConfig.launcher.hiddenApps ? [...GlobalConfig.launcher.hiddenApps] : []; if (isHidden) { if (!hiddenApps.includes(appId)) { @@ -128,7 +128,7 @@ Item { id: allAppsDb path: `${Paths.state}/apps.sqlite` - favouriteApps: Config.launcher.favouriteApps + favouriteApps: GlobalConfig.launcher.favouriteApps entries: DesktopEntries.applications.values } @@ -358,8 +358,8 @@ Item { } Loader { - readonly property bool isHidden: modelData ? Strings.testRegexList(Config.launcher.hiddenApps, modelData.id) : false - readonly property bool isFav: modelData ? Strings.testRegexList(Config.launcher.favouriteApps, modelData.id) : false + readonly property bool isHidden: modelData ? Strings.testRegexList(GlobalConfig.launcher.hiddenApps, modelData.id) : false + readonly property bool isFav: modelData ? Strings.testRegexList(GlobalConfig.launcher.favouriteApps, modelData.id) : false Layout.alignment: Qt.AlignVCenter asynchronous: true @@ -422,8 +422,8 @@ Item { onDisplayedAppChanged: { if (displayedApp) { const appId = displayedApp.id || displayedApp.entry?.id; - root.hideFromLauncherChecked = Config.launcher.hiddenApps && Config.launcher.hiddenApps.length > 0 && Strings.testRegexList(Config.launcher.hiddenApps, appId); - root.favouriteChecked = Config.launcher.favouriteApps && Config.launcher.favouriteApps.length > 0 && Strings.testRegexList(Config.launcher.favouriteApps, appId); + root.hideFromLauncherChecked = GlobalConfig.launcher.hiddenApps && GlobalConfig.launcher.hiddenApps.length > 0 && Strings.testRegexList(GlobalConfig.launcher.hiddenApps, appId); + root.favouriteChecked = GlobalConfig.launcher.favouriteApps && GlobalConfig.launcher.favouriteApps.length > 0 && Strings.testRegexList(GlobalConfig.launcher.favouriteApps, appId); } else { root.hideFromLauncherChecked = false; root.favouriteChecked = false; @@ -606,14 +606,14 @@ Item { // * app isn't in favouriteApps array but marked as favourite anyway // ^^^ This means that this app is favourited because of a regex check // this button can not toggle regexed apps - enabled: appDetailsLayout.displayedApp !== null && !root.hideFromLauncherChecked && (Config.launcher.favouriteApps.indexOf(appDetailsLayout.displayedApp.id || appDetailsLayout.displayedApp.entry?.id) !== -1 || !root.favouriteChecked) + enabled: appDetailsLayout.displayedApp !== null && !root.hideFromLauncherChecked && (GlobalConfig.launcher.favouriteApps.indexOf(appDetailsLayout.displayedApp.id || appDetailsLayout.displayedApp.entry?.id) !== -1 || !root.favouriteChecked) opacity: enabled ? 1 : 0.6 onToggled: checked => { root.favouriteChecked = checked; const app = appDetailsLayout.displayedApp; if (app) { const appId = app.id || app.entry?.id; - const favouriteApps = Config.launcher.favouriteApps ? [...Config.launcher.favouriteApps] : []; + const favouriteApps = GlobalConfig.launcher.favouriteApps ? [...GlobalConfig.launcher.favouriteApps] : []; if (checked) { if (!favouriteApps.includes(appId)) { favouriteApps.push(appId); @@ -638,14 +638,14 @@ Item { // * app isn't in hiddenApps array but marked as hidden anyway // ^^^ This means that this app is hidden because of a regex check // this button can not toggle regexed apps - enabled: appDetailsLayout.displayedApp !== null && !root.favouriteChecked && (Config.launcher.hiddenApps.indexOf(appDetailsLayout.displayedApp.id || appDetailsLayout.displayedApp.entry?.id) !== -1 || !root.hideFromLauncherChecked) + enabled: appDetailsLayout.displayedApp !== null && !root.favouriteChecked && (GlobalConfig.launcher.hiddenApps.indexOf(appDetailsLayout.displayedApp.id || appDetailsLayout.displayedApp.entry?.id) !== -1 || !root.hideFromLauncherChecked) opacity: enabled ? 1 : 0.6 onToggled: checked => { root.hideFromLauncherChecked = checked; const app = appDetailsLayout.displayedApp; if (app) { const appId = app.id || app.entry?.id; - const hiddenApps = Config.launcher.hiddenApps ? [...Config.launcher.hiddenApps] : []; + const hiddenApps = GlobalConfig.launcher.hiddenApps ? [...GlobalConfig.launcher.hiddenApps] : []; if (checked) { if (!hiddenApps.includes(appId)) { hiddenApps.push(appId); diff --git a/modules/controlcenter/launcher/Settings.qml b/modules/controlcenter/launcher/Settings.qml index 657c4a28..f0181230 100644 --- a/modules/controlcenter/launcher/Settings.qml +++ b/modules/controlcenter/launcher/Settings.qml @@ -47,7 +47,7 @@ ColumnLayout { ToggleRow { label: qsTr("Vim keybinds") - checked: Config.launcher.vimKeybinds + checked: GlobalConfig.launcher.vimKeybinds toggle.onToggled: { GlobalConfig.launcher.vimKeybinds = checked; } @@ -55,7 +55,7 @@ ColumnLayout { ToggleRow { label: qsTr("Enable dangerous actions") - checked: Config.launcher.enableDangerousActions + checked: GlobalConfig.launcher.enableDangerousActions toggle.onToggled: { GlobalConfig.launcher.enableDangerousActions = checked; } @@ -119,7 +119,7 @@ ColumnLayout { SectionContainer { ToggleRow { label: qsTr("Apps") - checked: Config.launcher.useFuzzy.apps + checked: GlobalConfig.launcher.useFuzzy.apps toggle.onToggled: { GlobalConfig.launcher.useFuzzy.apps = checked; } @@ -127,7 +127,7 @@ ColumnLayout { ToggleRow { label: qsTr("Actions") - checked: Config.launcher.useFuzzy.actions + checked: GlobalConfig.launcher.useFuzzy.actions toggle.onToggled: { GlobalConfig.launcher.useFuzzy.actions = checked; } @@ -135,7 +135,7 @@ ColumnLayout { ToggleRow { label: qsTr("Schemes") - checked: Config.launcher.useFuzzy.schemes + checked: GlobalConfig.launcher.useFuzzy.schemes toggle.onToggled: { GlobalConfig.launcher.useFuzzy.schemes = checked; } @@ -143,7 +143,7 @@ ColumnLayout { ToggleRow { label: qsTr("Variants") - checked: Config.launcher.useFuzzy.variants + checked: GlobalConfig.launcher.useFuzzy.variants toggle.onToggled: { GlobalConfig.launcher.useFuzzy.variants = checked; } @@ -151,7 +151,7 @@ ColumnLayout { ToggleRow { label: qsTr("Wallpapers") - checked: Config.launcher.useFuzzy.wallpapers + checked: GlobalConfig.launcher.useFuzzy.wallpapers toggle.onToggled: { GlobalConfig.launcher.useFuzzy.wallpapers = checked; } @@ -202,7 +202,7 @@ ColumnLayout { PropertyRow { label: qsTr("Total hidden") - value: qsTr("%1").arg(Config.launcher.hiddenApps ? Config.launcher.hiddenApps.length : 0) + value: qsTr("%1").arg(GlobalConfig.launcher.hiddenApps ? GlobalConfig.launcher.hiddenApps.length : 0) } } } diff --git a/modules/controlcenter/network/NetworkSettings.qml b/modules/controlcenter/network/NetworkSettings.qml index 5ed755fe..d8700ecd 100644 --- a/modules/controlcenter/network/NetworkSettings.qml +++ b/modules/controlcenter/network/NetworkSettings.qml @@ -65,15 +65,15 @@ ColumnLayout { Layout.topMargin: Tokens.spacing.large title: qsTr("VPN") description: qsTr("VPN provider settings") - visible: Config.utilities.vpn.enabled || Config.utilities.vpn.provider.length > 0 + visible: GlobalConfig.utilities.vpn.enabled || GlobalConfig.utilities.vpn.provider.length > 0 } SectionContainer { - visible: Config.utilities.vpn.enabled || Config.utilities.vpn.provider.length > 0 + visible: GlobalConfig.utilities.vpn.enabled || GlobalConfig.utilities.vpn.provider.length > 0 ToggleRow { label: qsTr("VPN enabled") - checked: Config.utilities.vpn.enabled + checked: GlobalConfig.utilities.vpn.enabled toggle.onToggled: { GlobalConfig.utilities.vpn.enabled = checked; } @@ -82,7 +82,7 @@ ColumnLayout { PropertyRow { showTopMargin: true label: qsTr("Providers") - value: qsTr("%1").arg(Config.utilities.vpn.provider.length) + value: qsTr("%1").arg(GlobalConfig.utilities.vpn.provider.length) } TextButton { diff --git a/modules/controlcenter/network/VpnDetails.qml b/modules/controlcenter/network/VpnDetails.qml index f0197f9c..c146554f 100644 --- a/modules/controlcenter/network/VpnDetails.qml +++ b/modules/controlcenter/network/VpnDetails.qml @@ -21,7 +21,7 @@ DeviceDetails { readonly property bool providerEnabled: { if (!vpnProvider || vpnProvider.index === undefined) return false; - const provider = Config.utilities.vpn.provider[vpnProvider.index]; + const provider = GlobalConfig.utilities.vpn.provider[vpnProvider.index]; return provider && typeof provider === "object" && provider.enabled === true; } @@ -55,8 +55,8 @@ DeviceDetails { const index = root.vpnProvider.index; // Copy providers and update enabled state - for (let i = 0; i < Config.utilities.vpn.provider.length; i++) { - const p = Config.utilities.vpn.provider[i]; + for (let i = 0; i < GlobalConfig.utilities.vpn.provider.length; i++) { + const p = GlobalConfig.utilities.vpn.provider[i]; if (typeof p === "object") { const newProvider = { name: p.name, @@ -115,7 +115,7 @@ DeviceDetails { inactiveOnColour: Colours.palette.m3onSecondaryContainer onClicked: { - const provider = Config.utilities.vpn.provider[root.vpnProvider.index]; + const provider = GlobalConfig.utilities.vpn.provider[root.vpnProvider.index]; editVpnDialog.editIndex = root.vpnProvider.index; editVpnDialog.providerName = root.vpnProvider.name; editVpnDialog.displayName = root.vpnProvider.displayName; @@ -134,9 +134,9 @@ DeviceDetails { onClicked: { const providers = []; - for (let i = 0; i < Config.utilities.vpn.provider.length; i++) { + for (let i = 0; i < GlobalConfig.utilities.vpn.provider.length; i++) { if (i !== root.vpnProvider.index) { - providers.push(Config.utilities.vpn.provider[i]); + providers.push(GlobalConfig.utilities.vpn.provider[i]); } } GlobalConfig.utilities.vpn.provider = providers; @@ -500,10 +500,10 @@ DeviceDetails { onClicked: { const providers = []; - const oldProvider = Config.utilities.vpn.provider[editVpnDialog.editIndex]; + const oldProvider = GlobalConfig.utilities.vpn.provider[editVpnDialog.editIndex]; const wasEnabled = typeof oldProvider === "object" ? (oldProvider.enabled !== false) : true; - for (let i = 0; i < Config.utilities.vpn.provider.length; i++) { + for (let i = 0; i < GlobalConfig.utilities.vpn.provider.length; i++) { if (i === editVpnDialog.editIndex) { const hasCommands = editVpnDialog.connectCmd.length > 0 && editVpnDialog.disconnectCmd.length > 0; const newProvider = { @@ -520,7 +520,7 @@ DeviceDetails { providers.push(newProvider); } else { - const p = Config.utilities.vpn.provider[i]; + const p = GlobalConfig.utilities.vpn.provider[i]; const reconstructed = { displayName: p.displayName, enabled: p.enabled, diff --git a/modules/controlcenter/network/VpnList.qml b/modules/controlcenter/network/VpnList.qml index dd63300d..23fdf5b1 100644 --- a/modules/controlcenter/network/VpnList.qml +++ b/modules/controlcenter/network/VpnList.qml @@ -27,8 +27,8 @@ ColumnLayout { root.pendingSwitchIndex = -1; const providers = []; - for (let i = 0; i < Config.utilities.vpn.provider.length; i++) { - const p = Config.utilities.vpn.provider[i]; + for (let i = 0; i < GlobalConfig.utilities.vpn.provider.length; i++) { + const p = GlobalConfig.utilities.vpn.provider[i]; if (typeof p === "object") { const newProvider = { name: p.name, @@ -79,7 +79,7 @@ ColumnLayout { spacing: Tokens.spacing.smaller model: ScriptModel { - values: Config.utilities.vpn.provider.map((provider, index) => { + values: GlobalConfig.utilities.vpn.provider.map((provider, index) => { const isObject = typeof provider === "object"; const name = isObject ? (provider.name || "custom") : String(provider); const displayName = isObject ? (provider.displayName || name) : name; @@ -222,8 +222,8 @@ ColumnLayout { VPN.toggle(); } else { const providers = []; - for (let i = 0; i < Config.utilities.vpn.provider.length; i++) { - const p = Config.utilities.vpn.provider[i]; + for (let i = 0; i < GlobalConfig.utilities.vpn.provider.length; i++) { + const p = GlobalConfig.utilities.vpn.provider[i]; if (typeof p === "object") { const newProvider = { name: p.name, @@ -273,9 +273,9 @@ ColumnLayout { StateLayer { function onClicked(): void { const providers = []; - for (let i = 0; i < Config.utilities.vpn.provider.length; i++) { + for (let i = 0; i < GlobalConfig.utilities.vpn.provider.length; i++) { if (i !== modelData.index) { - const p = Config.utilities.vpn.provider[i]; + const p = GlobalConfig.utilities.vpn.provider[i]; const reconstructed = { name: p.name, displayName: p.displayName, @@ -346,7 +346,7 @@ ColumnLayout { } function showEditForm(index: int): void { - const provider = Config.utilities.vpn.provider[index]; + const provider = GlobalConfig.utilities.vpn.provider[index]; const isObject = typeof provider === "object"; editIndex = index; @@ -484,8 +484,8 @@ ColumnLayout { inactiveOnColour: Colours.palette.m3onSurface onClicked: { const providers = []; - for (let i = 0; i < Config.utilities.vpn.provider.length; i++) { - providers.push(Config.utilities.vpn.provider[i]); + for (let i = 0; i < GlobalConfig.utilities.vpn.provider.length; i++) { + providers.push(GlobalConfig.utilities.vpn.provider[i]); } providers.push({ name: "netbird", @@ -504,8 +504,8 @@ ColumnLayout { inactiveOnColour: Colours.palette.m3onSurface onClicked: { const providers = []; - for (let i = 0; i < Config.utilities.vpn.provider.length; i++) { - providers.push(Config.utilities.vpn.provider[i]); + for (let i = 0; i < GlobalConfig.utilities.vpn.provider.length; i++) { + providers.push(GlobalConfig.utilities.vpn.provider[i]); } providers.push({ name: "tailscale", @@ -524,8 +524,8 @@ ColumnLayout { inactiveOnColour: Colours.palette.m3onSurface onClicked: { const providers = []; - for (let i = 0; i < Config.utilities.vpn.provider.length; i++) { - providers.push(Config.utilities.vpn.provider[i]); + for (let i = 0; i < GlobalConfig.utilities.vpn.provider.length; i++) { + providers.push(GlobalConfig.utilities.vpn.provider[i]); } providers.push({ name: "warp", @@ -780,21 +780,21 @@ ColumnLayout { } if (vpnDialog.editIndex >= 0) { - const oldProvider = Config.utilities.vpn.provider[vpnDialog.editIndex]; + const oldProvider = GlobalConfig.utilities.vpn.provider[vpnDialog.editIndex]; if (typeof oldProvider === "object" && oldProvider.enabled !== undefined) { newProvider.enabled = oldProvider.enabled; } - for (let i = 0; i < Config.utilities.vpn.provider.length; i++) { + for (let i = 0; i < GlobalConfig.utilities.vpn.provider.length; i++) { if (i === vpnDialog.editIndex) { providers.push(newProvider); } else { - providers.push(Config.utilities.vpn.provider[i]); + providers.push(GlobalConfig.utilities.vpn.provider[i]); } } } else { - for (let i = 0; i < Config.utilities.vpn.provider.length; i++) { - providers.push(Config.utilities.vpn.provider[i]); + for (let i = 0; i < GlobalConfig.utilities.vpn.provider.length; i++) { + providers.push(GlobalConfig.utilities.vpn.provider[i]); } providers.push(newProvider); } diff --git a/modules/controlcenter/network/VpnSettings.qml b/modules/controlcenter/network/VpnSettings.qml index 27c1cc8e..064f32a1 100644 --- a/modules/controlcenter/network/VpnSettings.qml +++ b/modules/controlcenter/network/VpnSettings.qml @@ -34,7 +34,7 @@ ColumnLayout { SectionContainer { ToggleRow { label: qsTr("VPN enabled") - checked: Config.utilities.vpn.enabled + checked: GlobalConfig.utilities.vpn.enabled toggle.onToggled: { GlobalConfig.utilities.vpn.enabled = checked; } @@ -58,7 +58,7 @@ ColumnLayout { spacing: Tokens.spacing.smaller model: ScriptModel { - values: Config.utilities.vpn.provider.map((provider, index) => { + values: GlobalConfig.utilities.vpn.provider.map((provider, index) => { const isObject = typeof provider === "object"; const name = isObject ? (provider.name || "custom") : String(provider); const displayName = isObject ? (provider.displayName || name) : name; @@ -116,11 +116,11 @@ ColumnLayout { IconButton { icon: modelData.isActive ? "arrow_downward" : "arrow_upward" - visible: !modelData.isActive || Config.utilities.vpn.provider.length > 1 + visible: !modelData.isActive || GlobalConfig.utilities.vpn.provider.length > 1 onClicked: { const providers = []; - for (let i = 0; i < Config.utilities.vpn.provider.length; i++) { - const p = Config.utilities.vpn.provider[i]; + for (let i = 0; i < GlobalConfig.utilities.vpn.provider.length; i++) { + const p = GlobalConfig.utilities.vpn.provider[i]; const reconstructed = { name: p.name, displayName: p.displayName, @@ -155,9 +155,9 @@ ColumnLayout { icon: "delete" onClicked: { const providers = []; - for (let i = 0; i < Config.utilities.vpn.provider.length; i++) { + for (let i = 0; i < GlobalConfig.utilities.vpn.provider.length; i++) { if (i !== index) { - const p = Config.utilities.vpn.provider[i]; + const p = GlobalConfig.utilities.vpn.provider[i]; const reconstructed = { name: p.name, displayName: p.displayName, @@ -210,7 +210,7 @@ ColumnLayout { inactiveOnColour: Colours.palette.m3onSurface onClicked: { - const providers = [...Config.utilities.vpn.provider]; + const providers = [...GlobalConfig.utilities.vpn.provider]; providers.push({ name: "netbird", displayName: "NetBird", @@ -227,7 +227,7 @@ ColumnLayout { inactiveOnColour: Colours.palette.m3onSurface onClicked: { - const providers = [...Config.utilities.vpn.provider]; + const providers = [...GlobalConfig.utilities.vpn.provider]; providers.push({ name: "tailscale", displayName: "Tailscale", @@ -244,7 +244,7 @@ ColumnLayout { inactiveOnColour: Colours.palette.m3onSurface onClicked: { - const providers = [...Config.utilities.vpn.provider]; + const providers = [...GlobalConfig.utilities.vpn.provider]; providers.push({ name: "warp", displayName: "Cloudflare WARP", diff --git a/modules/controlcenter/notifications/NotificationsPane.qml b/modules/controlcenter/notifications/NotificationsPane.qml index ea75c2a6..eda4e213 100644 --- a/modules/controlcenter/notifications/NotificationsPane.qml +++ b/modules/controlcenter/notifications/NotificationsPane.qml @@ -18,24 +18,24 @@ Item { required property Session session - property bool notificationsExpire: Config.notifs.expire ?? true - property string notificationsFullscreen: Config.notifs.fullscreen ?? "on" + property bool notificationsExpire: GlobalConfig.notifs.expire ?? true + property string notificationsFullscreen: GlobalConfig.notifs.fullscreen ?? "on" property bool notificationsOpenExpanded: Config.notifs.openExpanded ?? false - property int notificationsDefaultExpireTimeout: Config.notifs.defaultExpireTimeout ?? 5000 + property int notificationsDefaultExpireTimeout: GlobalConfig.notifs.defaultExpireTimeout ?? 5000 property int notificationsGroupPreviewNum: Config.notifs.groupPreviewNum ?? 3 property int maxToasts: Config.utilities.maxToasts ?? 4 property string toastsFullscreen: Config.utilities.toasts.fullscreen ?? "off" - property bool chargingChanged: Config.utilities.toasts.chargingChanged ?? true - property bool gameModeChanged: Config.utilities.toasts.gameModeChanged ?? true - property bool dndChanged: Config.utilities.toasts.dndChanged ?? true - property bool audioOutputChanged: Config.utilities.toasts.audioOutputChanged ?? true - property bool audioInputChanged: Config.utilities.toasts.audioInputChanged ?? true - property bool capsLockChanged: Config.utilities.toasts.capsLockChanged ?? true - property bool numLockChanged: Config.utilities.toasts.numLockChanged ?? true - property bool kbLayoutChanged: Config.utilities.toasts.kbLayoutChanged ?? true - property bool vpnChanged: Config.utilities.toasts.vpnChanged ?? true - property bool nowPlaying: Config.utilities.toasts.nowPlaying ?? false + property bool chargingChanged: GlobalConfig.utilities.toasts.chargingChanged ?? true + property bool gameModeChanged: GlobalConfig.utilities.toasts.gameModeChanged ?? true + property bool dndChanged: GlobalConfig.utilities.toasts.dndChanged ?? true + property bool audioOutputChanged: GlobalConfig.utilities.toasts.audioOutputChanged ?? true + property bool audioInputChanged: GlobalConfig.utilities.toasts.audioInputChanged ?? true + property bool capsLockChanged: GlobalConfig.utilities.toasts.capsLockChanged ?? true + property bool numLockChanged: GlobalConfig.utilities.toasts.numLockChanged ?? true + property bool kbLayoutChanged: GlobalConfig.utilities.toasts.kbLayoutChanged ?? true + property bool vpnChanged: GlobalConfig.utilities.toasts.vpnChanged ?? true + property bool nowPlaying: GlobalConfig.utilities.toasts.nowPlaying ?? false function saveConfig(): void { GlobalConfig.notifs.expire = root.notificationsExpire; diff --git a/modules/launcher/Content.qml b/modules/launcher/Content.qml index 7e283c8f..48a3d4fa 100644 --- a/modules/launcher/Content.qml +++ b/modules/launcher/Content.qml @@ -106,7 +106,7 @@ Item { Keys.onEscapePressed: root.visibilities.launcher = false Keys.onPressed: event => { - if (!Config.launcher.vimKeybinds) + if (!GlobalConfig.launcher.vimKeybinds) return; if (event.modifiers & Qt.ControlModifier) { diff --git a/modules/launcher/services/Actions.qml b/modules/launcher/services/Actions.qml index 13ec0361..4ec249da 100644 --- a/modules/launcher/services/Actions.qml +++ b/modules/launcher/services/Actions.qml @@ -15,12 +15,12 @@ Searcher { } list: variants.instances - useFuzzy: Config.launcher.useFuzzy.actions + useFuzzy: GlobalConfig.launcher.useFuzzy.actions Variants { id: variants - model: Config.launcher.actions.filter(a => (a.enabled ?? true) && (Config.launcher.enableDangerousActions || !(a.dangerous ?? false))) + model: Config.launcher.actions.filter(a => (a.enabled ?? true) && (GlobalConfig.launcher.enableDangerousActions || !(a.dangerous ?? false))) Action {} } diff --git a/modules/launcher/services/Apps.qml b/modules/launcher/services/Apps.qml index ff05456b..5c80513e 100644 --- a/modules/launcher/services/Apps.qml +++ b/modules/launcher/services/Apps.qml @@ -66,13 +66,13 @@ Searcher { } list: appDb.apps - useFuzzy: Config.launcher.useFuzzy.apps + useFuzzy: GlobalConfig.launcher.useFuzzy.apps AppDb { id: appDb path: `${Paths.state}/apps.sqlite` - favouriteApps: Config.launcher.favouriteApps - entries: DesktopEntries.applications.values.filter(a => !Strings.testRegexList(Config.launcher.hiddenApps, a.id)) + favouriteApps: GlobalConfig.launcher.favouriteApps + entries: DesktopEntries.applications.values.filter(a => !Strings.testRegexList(GlobalConfig.launcher.hiddenApps, a.id)) } } diff --git a/modules/launcher/services/M3Variants.qml b/modules/launcher/services/M3Variants.qml index aa5d1ca7..4517d02c 100644 --- a/modules/launcher/services/M3Variants.qml +++ b/modules/launcher/services/M3Variants.qml @@ -69,7 +69,7 @@ Searcher { description: qsTr("All colours are grayscale, no chroma.") } ] - useFuzzy: Config.launcher.useFuzzy.variants + useFuzzy: GlobalConfig.launcher.useFuzzy.variants component Variant: QtObject { required property string variant diff --git a/modules/launcher/services/Schemes.qml b/modules/launcher/services/Schemes.qml index bd2a10f7..cc555f29 100644 --- a/modules/launcher/services/Schemes.qml +++ b/modules/launcher/services/Schemes.qml @@ -26,7 +26,7 @@ Searcher { } list: schemes.instances - useFuzzy: Config.launcher.useFuzzy.schemes + useFuzzy: GlobalConfig.launcher.useFuzzy.schemes keys: ["name", "flavour"] weights: [0.9, 0.1] diff --git a/modules/notifications/Notification.qml b/modules/notifications/Notification.qml index ca7596dc..24c0c958 100644 --- a/modules/notifications/Notification.qml +++ b/modules/notifications/Notification.qml @@ -81,7 +81,7 @@ StyledRect { } } onClicked: event => { - if (!Config.notifs.actionOnClick || event.button !== Qt.LeftButton) + if (!GlobalConfig.notifs.actionOnClick || event.button !== Qt.LeftButton) return; const actions = root.modelData.actions; diff --git a/modules/utilities/cards/Toggles.qml b/modules/utilities/cards/Toggles.qml index 49147a62..b2e14567 100644 --- a/modules/utilities/cards/Toggles.qml +++ b/modules/utilities/cards/Toggles.qml @@ -27,7 +27,7 @@ StyledRect { } if (item.id === "vpn") { - return Config.utilities.vpn.provider.some(p => typeof p === "object" ? (p.enabled === true) : false); + return GlobalConfig.utilities.vpn.provider.some(p => typeof p === "object" ? (p.enabled === true) : false); } seenIds.add(item.id); diff --git a/services/Audio.qml b/services/Audio.qml index faf86a93..88fe9652 100644 --- a/services/Audio.qml +++ b/services/Audio.qml @@ -111,7 +111,7 @@ Singleton { const newSinkName = sink.description || sink.name || qsTr("Unknown Device"); - if (previousSinkName && previousSinkName !== newSinkName && Config.utilities.toasts.audioOutputChanged) + if (previousSinkName && previousSinkName !== newSinkName && GlobalConfig.utilities.toasts.audioOutputChanged) Toaster.toast(qsTr("Audio output changed"), qsTr("Now using: %1").arg(newSinkName), "volume_up"); previousSinkName = newSinkName; @@ -123,7 +123,7 @@ Singleton { const newSourceName = source.description || source.name || qsTr("Unknown Device"); - if (previousSourceName && previousSourceName !== newSourceName && Config.utilities.toasts.audioInputChanged) + if (previousSourceName && previousSourceName !== newSourceName && GlobalConfig.utilities.toasts.audioInputChanged) Toaster.toast(qsTr("Audio input changed"), qsTr("Now using: %1").arg(newSourceName), "mic"); previousSourceName = newSourceName; diff --git a/services/GameMode.qml b/services/GameMode.qml index 44b0fe4c..6dfc791c 100644 --- a/services/GameMode.qml +++ b/services/GameMode.qml @@ -28,11 +28,11 @@ Singleton { onEnabledChanged: { if (enabled) { setDynamicConfs(); - if (Config.utilities.toasts.gameModeChanged) + if (GlobalConfig.utilities.toasts.gameModeChanged) Toaster.toast(qsTr("Game mode enabled"), qsTr("Disabled Hyprland animations, blur, gaps and shadows"), "gamepad"); } else { Hypr.extras.message("reload"); - if (Config.utilities.toasts.gameModeChanged) + if (GlobalConfig.utilities.toasts.gameModeChanged) Toaster.toast(qsTr("Game mode disabled"), qsTr("Hyprland settings restored"), "gamepad"); } } diff --git a/services/Hypr.qml b/services/Hypr.qml index 054b611c..181967e7 100644 --- a/services/Hypr.qml +++ b/services/Hypr.qml @@ -93,7 +93,7 @@ Singleton { Component.onCompleted: reloadDynamicConfs() onCapsLockChanged: { - if (!Config.utilities.toasts.capsLockChanged) + if (!GlobalConfig.utilities.toasts.capsLockChanged) return; if (capsLock) @@ -103,7 +103,7 @@ Singleton { } onNumLockChanged: { - if (!Config.utilities.toasts.numLockChanged) + if (!GlobalConfig.utilities.toasts.numLockChanged) return; if (numLock) @@ -113,7 +113,7 @@ Singleton { } onKbLayoutFullChanged: { - if (hadKeyboard && Config.utilities.toasts.kbLayoutChanged) + if (hadKeyboard && GlobalConfig.utilities.toasts.kbLayoutChanged) Toaster.toast(qsTr("Keyboard layout changed"), qsTr("Layout changed to: %1").arg(kbLayoutFull), "keyboard"); hadKeyboard = !!keyboard; diff --git a/services/NotifData.qml b/services/NotifData.qml index 1cec1510..c92a3ad7 100644 --- a/services/NotifData.qml +++ b/services/NotifData.qml @@ -33,7 +33,7 @@ QtObject { property string appName property string image property var hints // Hints are not persisted across restarts - property real expireTimeout: Config.notifs.defaultExpireTimeout + property real expireTimeout: GlobalConfig.notifs.defaultExpireTimeout property int urgency: NotificationUrgency.Normal property bool resident property bool hasActionIcons @@ -41,9 +41,9 @@ QtObject { readonly property Timer timer: Timer { running: true - interval: notif.expireTimeout > 0 ? notif.expireTimeout : Config.notifs.defaultExpireTimeout + interval: notif.expireTimeout > 0 ? notif.expireTimeout : GlobalConfig.notifs.defaultExpireTimeout onTriggered: { - if (Config.notifs.expire) + if (GlobalConfig.notifs.expire) notif.popup = false; } } diff --git a/services/Notifs.qml b/services/Notifs.qml index 510ee0bc..d539d0a2 100644 --- a/services/Notifs.qml +++ b/services/Notifs.qml @@ -32,13 +32,13 @@ Singleton { function shouldShowPopup(): bool { if (props.dnd || [...Visibilities.screens.values()].some(v => v.sidebar)) return false; - if (Config.notifs.fullscreen === "off" && hasFullscreen()) + if (GlobalConfig.notifs.fullscreen === "off" && hasFullscreen()) return false; return true; } onDndChanged: { - if (!Config.utilities.toasts.dndChanged) + if (!GlobalConfig.utilities.toasts.dndChanged) return; if (dnd) diff --git a/services/Players.qml b/services/Players.qml index 0724afbc..23c9067f 100644 --- a/services/Players.qml +++ b/services/Players.qml @@ -37,7 +37,7 @@ Singleton { Connections { function onPostTrackChanged() { - if (!Config.utilities.toasts.nowPlaying) { + if (!GlobalConfig.utilities.toasts.nowPlaying) { return; } if (root.active.trackArtist != "" && root.active.trackTitle != "") { diff --git a/services/VPN.qml b/services/VPN.qml index ac82a394..61e91d0b 100644 --- a/services/VPN.qml +++ b/services/VPN.qml @@ -18,9 +18,9 @@ Singleton { }) readonly property bool connecting: connectProc.running || disconnectProc.running - readonly property bool enabled: Config.utilities.vpn.provider.some(p => typeof p === "object" ? (p.enabled === true) : false) + readonly property bool enabled: GlobalConfig.utilities.vpn.provider.some(p => typeof p === "object" ? (p.enabled === true) : false) readonly property var providerInput: { - const enabledProvider = Config.utilities.vpn.provider.find(p => typeof p === "object" ? (p.enabled === true) : false); + const enabledProvider = GlobalConfig.utilities.vpn.provider.find(p => typeof p === "object" ? (p.enabled === true) : false); return enabledProvider || "wireguard"; } readonly property bool isCustomProvider: typeof providerInput === "object" @@ -279,7 +279,7 @@ Singleton { } function emitStatusToast(statusObj: var): void { - if (!Config.utilities.toasts.vpnChanged) + if (!GlobalConfig.utilities.toasts.vpnChanged) return; const displayName = root.currentConfig ? (root.currentConfig.displayName || "VPN") : "VPN"; diff --git a/services/Wallpapers.qml b/services/Wallpapers.qml index 4ef522ba..3478d90c 100644 --- a/services/Wallpapers.qml +++ b/services/Wallpapers.qml @@ -41,7 +41,7 @@ Searcher { list: wallpapers.entries key: "relativePath" - useFuzzy: Config.launcher.useFuzzy.wallpapers + useFuzzy: GlobalConfig.launcher.useFuzzy.wallpapers extraOpts: useFuzzy ? ({}) : ({ forward: false })