fix: global config use for rest of global props

This commit is contained in:
2 * r + 2 * t 2026-04-12 23:02:00 +10:00
parent 8f579a1e65
commit 666d451f4b
24 changed files with 105 additions and 105 deletions

View file

@ -12,10 +12,10 @@ Scope {
Connections { Connections {
function onOnBatteryChanged(): void { function onOnBatteryChanged(): void {
if (UPower.onBattery) { if (UPower.onBattery) {
if (Config.utilities.toasts.chargingChanged) if (GlobalConfig.utilities.toasts.chargingChanged)
Toaster.toast(qsTr("Charger unplugged"), qsTr("Battery is discharging"), "power_off"); Toaster.toast(qsTr("Charger unplugged"), qsTr("Battery is discharging"), "power_off");
} else { } else {
if (Config.utilities.toasts.chargingChanged) if (GlobalConfig.utilities.toasts.chargingChanged)
Toaster.toast(qsTr("Charger plugged in"), qsTr("Battery is charging"), "power"); Toaster.toast(qsTr("Charger plugged in"), qsTr("Battery is charging"), "power");
for (const level of root.warnLevels) for (const level of root.warnLevels)
level.warned = false; level.warned = false;

View file

@ -106,7 +106,7 @@ Item {
arr = arr.filter(i => i.layoutIndex !== activeIndex); arr = arr.filter(i => i.layoutIndex !== activeIndex);
arr.forEach(i => _visibleModel.append(i)); arr.forEach(i => _visibleModel.append(i));
if (!Config.utilities.toasts.kbLimit) if (!GlobalConfig.utilities.toasts.kbLimit)
return; return;
if (_layoutsModel.count > 4) { if (_layoutsModel.count > 4) {

View file

@ -37,8 +37,8 @@ Item {
const appId = root.selectedApp.id || root.selectedApp.entry?.id; 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.hideFromLauncherChecked = GlobalConfig.launcher.hiddenApps && GlobalConfig.launcher.hiddenApps.length > 0 && Strings.testRegexList(GlobalConfig.launcher.hiddenApps, appId);
root.favouriteChecked = Config.launcher.favouriteApps && Config.launcher.favouriteApps.length > 0 && Strings.testRegexList(Config.launcher.favouriteApps, appId); root.favouriteChecked = GlobalConfig.launcher.favouriteApps && GlobalConfig.launcher.favouriteApps.length > 0 && Strings.testRegexList(GlobalConfig.launcher.favouriteApps, appId);
} }
function saveHiddenApps(isHidden) { function saveHiddenApps(isHidden) {
@ -48,7 +48,7 @@ Item {
const appId = root.selectedApp.id || root.selectedApp.entry?.id; 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 (isHidden) {
if (!hiddenApps.includes(appId)) { if (!hiddenApps.includes(appId)) {
@ -128,7 +128,7 @@ Item {
id: allAppsDb id: allAppsDb
path: `${Paths.state}/apps.sqlite` path: `${Paths.state}/apps.sqlite`
favouriteApps: Config.launcher.favouriteApps favouriteApps: GlobalConfig.launcher.favouriteApps
entries: DesktopEntries.applications.values entries: DesktopEntries.applications.values
} }
@ -358,8 +358,8 @@ Item {
} }
Loader { Loader {
readonly property bool isHidden: modelData ? Strings.testRegexList(Config.launcher.hiddenApps, modelData.id) : false readonly property bool isHidden: modelData ? Strings.testRegexList(GlobalConfig.launcher.hiddenApps, modelData.id) : false
readonly property bool isFav: modelData ? Strings.testRegexList(Config.launcher.favouriteApps, modelData.id) : false readonly property bool isFav: modelData ? Strings.testRegexList(GlobalConfig.launcher.favouriteApps, modelData.id) : false
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
asynchronous: true asynchronous: true
@ -422,8 +422,8 @@ Item {
onDisplayedAppChanged: { onDisplayedAppChanged: {
if (displayedApp) { if (displayedApp) {
const appId = displayedApp.id || displayedApp.entry?.id; const appId = displayedApp.id || displayedApp.entry?.id;
root.hideFromLauncherChecked = Config.launcher.hiddenApps && Config.launcher.hiddenApps.length > 0 && Strings.testRegexList(Config.launcher.hiddenApps, appId); root.hideFromLauncherChecked = GlobalConfig.launcher.hiddenApps && GlobalConfig.launcher.hiddenApps.length > 0 && Strings.testRegexList(GlobalConfig.launcher.hiddenApps, appId);
root.favouriteChecked = Config.launcher.favouriteApps && Config.launcher.favouriteApps.length > 0 && Strings.testRegexList(Config.launcher.favouriteApps, appId); root.favouriteChecked = GlobalConfig.launcher.favouriteApps && GlobalConfig.launcher.favouriteApps.length > 0 && Strings.testRegexList(GlobalConfig.launcher.favouriteApps, appId);
} else { } else {
root.hideFromLauncherChecked = false; root.hideFromLauncherChecked = false;
root.favouriteChecked = false; root.favouriteChecked = false;
@ -606,14 +606,14 @@ Item {
// * app isn't in favouriteApps array but marked as favourite anyway // * app isn't in favouriteApps array but marked as favourite anyway
// ^^^ This means that this app is favourited because of a regex check // ^^^ This means that this app is favourited because of a regex check
// this button can not toggle regexed apps // 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 opacity: enabled ? 1 : 0.6
onToggled: checked => { onToggled: checked => {
root.favouriteChecked = checked; root.favouriteChecked = checked;
const app = appDetailsLayout.displayedApp; const app = appDetailsLayout.displayedApp;
if (app) { if (app) {
const appId = app.id || app.entry?.id; 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 (checked) {
if (!favouriteApps.includes(appId)) { if (!favouriteApps.includes(appId)) {
favouriteApps.push(appId); favouriteApps.push(appId);
@ -638,14 +638,14 @@ Item {
// * app isn't in hiddenApps array but marked as hidden anyway // * app isn't in hiddenApps array but marked as hidden anyway
// ^^^ This means that this app is hidden because of a regex check // ^^^ This means that this app is hidden because of a regex check
// this button can not toggle regexed apps // 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 opacity: enabled ? 1 : 0.6
onToggled: checked => { onToggled: checked => {
root.hideFromLauncherChecked = checked; root.hideFromLauncherChecked = checked;
const app = appDetailsLayout.displayedApp; const app = appDetailsLayout.displayedApp;
if (app) { if (app) {
const appId = app.id || app.entry?.id; 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 (checked) {
if (!hiddenApps.includes(appId)) { if (!hiddenApps.includes(appId)) {
hiddenApps.push(appId); hiddenApps.push(appId);

View file

@ -47,7 +47,7 @@ ColumnLayout {
ToggleRow { ToggleRow {
label: qsTr("Vim keybinds") label: qsTr("Vim keybinds")
checked: Config.launcher.vimKeybinds checked: GlobalConfig.launcher.vimKeybinds
toggle.onToggled: { toggle.onToggled: {
GlobalConfig.launcher.vimKeybinds = checked; GlobalConfig.launcher.vimKeybinds = checked;
} }
@ -55,7 +55,7 @@ ColumnLayout {
ToggleRow { ToggleRow {
label: qsTr("Enable dangerous actions") label: qsTr("Enable dangerous actions")
checked: Config.launcher.enableDangerousActions checked: GlobalConfig.launcher.enableDangerousActions
toggle.onToggled: { toggle.onToggled: {
GlobalConfig.launcher.enableDangerousActions = checked; GlobalConfig.launcher.enableDangerousActions = checked;
} }
@ -119,7 +119,7 @@ ColumnLayout {
SectionContainer { SectionContainer {
ToggleRow { ToggleRow {
label: qsTr("Apps") label: qsTr("Apps")
checked: Config.launcher.useFuzzy.apps checked: GlobalConfig.launcher.useFuzzy.apps
toggle.onToggled: { toggle.onToggled: {
GlobalConfig.launcher.useFuzzy.apps = checked; GlobalConfig.launcher.useFuzzy.apps = checked;
} }
@ -127,7 +127,7 @@ ColumnLayout {
ToggleRow { ToggleRow {
label: qsTr("Actions") label: qsTr("Actions")
checked: Config.launcher.useFuzzy.actions checked: GlobalConfig.launcher.useFuzzy.actions
toggle.onToggled: { toggle.onToggled: {
GlobalConfig.launcher.useFuzzy.actions = checked; GlobalConfig.launcher.useFuzzy.actions = checked;
} }
@ -135,7 +135,7 @@ ColumnLayout {
ToggleRow { ToggleRow {
label: qsTr("Schemes") label: qsTr("Schemes")
checked: Config.launcher.useFuzzy.schemes checked: GlobalConfig.launcher.useFuzzy.schemes
toggle.onToggled: { toggle.onToggled: {
GlobalConfig.launcher.useFuzzy.schemes = checked; GlobalConfig.launcher.useFuzzy.schemes = checked;
} }
@ -143,7 +143,7 @@ ColumnLayout {
ToggleRow { ToggleRow {
label: qsTr("Variants") label: qsTr("Variants")
checked: Config.launcher.useFuzzy.variants checked: GlobalConfig.launcher.useFuzzy.variants
toggle.onToggled: { toggle.onToggled: {
GlobalConfig.launcher.useFuzzy.variants = checked; GlobalConfig.launcher.useFuzzy.variants = checked;
} }
@ -151,7 +151,7 @@ ColumnLayout {
ToggleRow { ToggleRow {
label: qsTr("Wallpapers") label: qsTr("Wallpapers")
checked: Config.launcher.useFuzzy.wallpapers checked: GlobalConfig.launcher.useFuzzy.wallpapers
toggle.onToggled: { toggle.onToggled: {
GlobalConfig.launcher.useFuzzy.wallpapers = checked; GlobalConfig.launcher.useFuzzy.wallpapers = checked;
} }
@ -202,7 +202,7 @@ ColumnLayout {
PropertyRow { PropertyRow {
label: qsTr("Total hidden") 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)
} }
} }
} }

View file

@ -65,15 +65,15 @@ ColumnLayout {
Layout.topMargin: Tokens.spacing.large Layout.topMargin: Tokens.spacing.large
title: qsTr("VPN") title: qsTr("VPN")
description: qsTr("VPN provider settings") 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 { SectionContainer {
visible: Config.utilities.vpn.enabled || Config.utilities.vpn.provider.length > 0 visible: GlobalConfig.utilities.vpn.enabled || GlobalConfig.utilities.vpn.provider.length > 0
ToggleRow { ToggleRow {
label: qsTr("VPN enabled") label: qsTr("VPN enabled")
checked: Config.utilities.vpn.enabled checked: GlobalConfig.utilities.vpn.enabled
toggle.onToggled: { toggle.onToggled: {
GlobalConfig.utilities.vpn.enabled = checked; GlobalConfig.utilities.vpn.enabled = checked;
} }
@ -82,7 +82,7 @@ ColumnLayout {
PropertyRow { PropertyRow {
showTopMargin: true showTopMargin: true
label: qsTr("Providers") label: qsTr("Providers")
value: qsTr("%1").arg(Config.utilities.vpn.provider.length) value: qsTr("%1").arg(GlobalConfig.utilities.vpn.provider.length)
} }
TextButton { TextButton {

View file

@ -21,7 +21,7 @@ DeviceDetails {
readonly property bool providerEnabled: { readonly property bool providerEnabled: {
if (!vpnProvider || vpnProvider.index === undefined) if (!vpnProvider || vpnProvider.index === undefined)
return false; 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; return provider && typeof provider === "object" && provider.enabled === true;
} }
@ -55,8 +55,8 @@ DeviceDetails {
const index = root.vpnProvider.index; const index = root.vpnProvider.index;
// Copy providers and update enabled state // Copy providers and update enabled state
for (let i = 0; i < Config.utilities.vpn.provider.length; i++) { for (let i = 0; i < GlobalConfig.utilities.vpn.provider.length; i++) {
const p = Config.utilities.vpn.provider[i]; const p = GlobalConfig.utilities.vpn.provider[i];
if (typeof p === "object") { if (typeof p === "object") {
const newProvider = { const newProvider = {
name: p.name, name: p.name,
@ -115,7 +115,7 @@ DeviceDetails {
inactiveOnColour: Colours.palette.m3onSecondaryContainer inactiveOnColour: Colours.palette.m3onSecondaryContainer
onClicked: { 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.editIndex = root.vpnProvider.index;
editVpnDialog.providerName = root.vpnProvider.name; editVpnDialog.providerName = root.vpnProvider.name;
editVpnDialog.displayName = root.vpnProvider.displayName; editVpnDialog.displayName = root.vpnProvider.displayName;
@ -134,9 +134,9 @@ DeviceDetails {
onClicked: { onClicked: {
const providers = []; 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) { if (i !== root.vpnProvider.index) {
providers.push(Config.utilities.vpn.provider[i]); providers.push(GlobalConfig.utilities.vpn.provider[i]);
} }
} }
GlobalConfig.utilities.vpn.provider = providers; GlobalConfig.utilities.vpn.provider = providers;
@ -500,10 +500,10 @@ DeviceDetails {
onClicked: { onClicked: {
const providers = []; 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; 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) { if (i === editVpnDialog.editIndex) {
const hasCommands = editVpnDialog.connectCmd.length > 0 && editVpnDialog.disconnectCmd.length > 0; const hasCommands = editVpnDialog.connectCmd.length > 0 && editVpnDialog.disconnectCmd.length > 0;
const newProvider = { const newProvider = {
@ -520,7 +520,7 @@ DeviceDetails {
providers.push(newProvider); providers.push(newProvider);
} else { } else {
const p = Config.utilities.vpn.provider[i]; const p = GlobalConfig.utilities.vpn.provider[i];
const reconstructed = { const reconstructed = {
displayName: p.displayName, displayName: p.displayName,
enabled: p.enabled, enabled: p.enabled,

View file

@ -27,8 +27,8 @@ ColumnLayout {
root.pendingSwitchIndex = -1; root.pendingSwitchIndex = -1;
const providers = []; const providers = [];
for (let i = 0; i < Config.utilities.vpn.provider.length; i++) { for (let i = 0; i < GlobalConfig.utilities.vpn.provider.length; i++) {
const p = Config.utilities.vpn.provider[i]; const p = GlobalConfig.utilities.vpn.provider[i];
if (typeof p === "object") { if (typeof p === "object") {
const newProvider = { const newProvider = {
name: p.name, name: p.name,
@ -79,7 +79,7 @@ ColumnLayout {
spacing: Tokens.spacing.smaller spacing: Tokens.spacing.smaller
model: ScriptModel { model: ScriptModel {
values: Config.utilities.vpn.provider.map((provider, index) => { values: GlobalConfig.utilities.vpn.provider.map((provider, index) => {
const isObject = typeof provider === "object"; const isObject = typeof provider === "object";
const name = isObject ? (provider.name || "custom") : String(provider); const name = isObject ? (provider.name || "custom") : String(provider);
const displayName = isObject ? (provider.displayName || name) : name; const displayName = isObject ? (provider.displayName || name) : name;
@ -222,8 +222,8 @@ ColumnLayout {
VPN.toggle(); VPN.toggle();
} else { } else {
const providers = []; const providers = [];
for (let i = 0; i < Config.utilities.vpn.provider.length; i++) { for (let i = 0; i < GlobalConfig.utilities.vpn.provider.length; i++) {
const p = Config.utilities.vpn.provider[i]; const p = GlobalConfig.utilities.vpn.provider[i];
if (typeof p === "object") { if (typeof p === "object") {
const newProvider = { const newProvider = {
name: p.name, name: p.name,
@ -273,9 +273,9 @@ ColumnLayout {
StateLayer { StateLayer {
function onClicked(): void { function onClicked(): void {
const providers = []; 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) { if (i !== modelData.index) {
const p = Config.utilities.vpn.provider[i]; const p = GlobalConfig.utilities.vpn.provider[i];
const reconstructed = { const reconstructed = {
name: p.name, name: p.name,
displayName: p.displayName, displayName: p.displayName,
@ -346,7 +346,7 @@ ColumnLayout {
} }
function showEditForm(index: int): void { function showEditForm(index: int): void {
const provider = Config.utilities.vpn.provider[index]; const provider = GlobalConfig.utilities.vpn.provider[index];
const isObject = typeof provider === "object"; const isObject = typeof provider === "object";
editIndex = index; editIndex = index;
@ -484,8 +484,8 @@ ColumnLayout {
inactiveOnColour: Colours.palette.m3onSurface inactiveOnColour: Colours.palette.m3onSurface
onClicked: { onClicked: {
const providers = []; const providers = [];
for (let i = 0; i < Config.utilities.vpn.provider.length; i++) { for (let i = 0; i < GlobalConfig.utilities.vpn.provider.length; i++) {
providers.push(Config.utilities.vpn.provider[i]); providers.push(GlobalConfig.utilities.vpn.provider[i]);
} }
providers.push({ providers.push({
name: "netbird", name: "netbird",
@ -504,8 +504,8 @@ ColumnLayout {
inactiveOnColour: Colours.palette.m3onSurface inactiveOnColour: Colours.palette.m3onSurface
onClicked: { onClicked: {
const providers = []; const providers = [];
for (let i = 0; i < Config.utilities.vpn.provider.length; i++) { for (let i = 0; i < GlobalConfig.utilities.vpn.provider.length; i++) {
providers.push(Config.utilities.vpn.provider[i]); providers.push(GlobalConfig.utilities.vpn.provider[i]);
} }
providers.push({ providers.push({
name: "tailscale", name: "tailscale",
@ -524,8 +524,8 @@ ColumnLayout {
inactiveOnColour: Colours.palette.m3onSurface inactiveOnColour: Colours.palette.m3onSurface
onClicked: { onClicked: {
const providers = []; const providers = [];
for (let i = 0; i < Config.utilities.vpn.provider.length; i++) { for (let i = 0; i < GlobalConfig.utilities.vpn.provider.length; i++) {
providers.push(Config.utilities.vpn.provider[i]); providers.push(GlobalConfig.utilities.vpn.provider[i]);
} }
providers.push({ providers.push({
name: "warp", name: "warp",
@ -780,21 +780,21 @@ ColumnLayout {
} }
if (vpnDialog.editIndex >= 0) { 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) { if (typeof oldProvider === "object" && oldProvider.enabled !== undefined) {
newProvider.enabled = oldProvider.enabled; 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) { if (i === vpnDialog.editIndex) {
providers.push(newProvider); providers.push(newProvider);
} else { } else {
providers.push(Config.utilities.vpn.provider[i]); providers.push(GlobalConfig.utilities.vpn.provider[i]);
} }
} }
} else { } else {
for (let i = 0; i < Config.utilities.vpn.provider.length; i++) { for (let i = 0; i < GlobalConfig.utilities.vpn.provider.length; i++) {
providers.push(Config.utilities.vpn.provider[i]); providers.push(GlobalConfig.utilities.vpn.provider[i]);
} }
providers.push(newProvider); providers.push(newProvider);
} }

View file

@ -34,7 +34,7 @@ ColumnLayout {
SectionContainer { SectionContainer {
ToggleRow { ToggleRow {
label: qsTr("VPN enabled") label: qsTr("VPN enabled")
checked: Config.utilities.vpn.enabled checked: GlobalConfig.utilities.vpn.enabled
toggle.onToggled: { toggle.onToggled: {
GlobalConfig.utilities.vpn.enabled = checked; GlobalConfig.utilities.vpn.enabled = checked;
} }
@ -58,7 +58,7 @@ ColumnLayout {
spacing: Tokens.spacing.smaller spacing: Tokens.spacing.smaller
model: ScriptModel { model: ScriptModel {
values: Config.utilities.vpn.provider.map((provider, index) => { values: GlobalConfig.utilities.vpn.provider.map((provider, index) => {
const isObject = typeof provider === "object"; const isObject = typeof provider === "object";
const name = isObject ? (provider.name || "custom") : String(provider); const name = isObject ? (provider.name || "custom") : String(provider);
const displayName = isObject ? (provider.displayName || name) : name; const displayName = isObject ? (provider.displayName || name) : name;
@ -116,11 +116,11 @@ ColumnLayout {
IconButton { IconButton {
icon: modelData.isActive ? "arrow_downward" : "arrow_upward" 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: { onClicked: {
const providers = []; const providers = [];
for (let i = 0; i < Config.utilities.vpn.provider.length; i++) { for (let i = 0; i < GlobalConfig.utilities.vpn.provider.length; i++) {
const p = Config.utilities.vpn.provider[i]; const p = GlobalConfig.utilities.vpn.provider[i];
const reconstructed = { const reconstructed = {
name: p.name, name: p.name,
displayName: p.displayName, displayName: p.displayName,
@ -155,9 +155,9 @@ ColumnLayout {
icon: "delete" icon: "delete"
onClicked: { onClicked: {
const providers = []; 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) { if (i !== index) {
const p = Config.utilities.vpn.provider[i]; const p = GlobalConfig.utilities.vpn.provider[i];
const reconstructed = { const reconstructed = {
name: p.name, name: p.name,
displayName: p.displayName, displayName: p.displayName,
@ -210,7 +210,7 @@ ColumnLayout {
inactiveOnColour: Colours.palette.m3onSurface inactiveOnColour: Colours.palette.m3onSurface
onClicked: { onClicked: {
const providers = [...Config.utilities.vpn.provider]; const providers = [...GlobalConfig.utilities.vpn.provider];
providers.push({ providers.push({
name: "netbird", name: "netbird",
displayName: "NetBird", displayName: "NetBird",
@ -227,7 +227,7 @@ ColumnLayout {
inactiveOnColour: Colours.palette.m3onSurface inactiveOnColour: Colours.palette.m3onSurface
onClicked: { onClicked: {
const providers = [...Config.utilities.vpn.provider]; const providers = [...GlobalConfig.utilities.vpn.provider];
providers.push({ providers.push({
name: "tailscale", name: "tailscale",
displayName: "Tailscale", displayName: "Tailscale",
@ -244,7 +244,7 @@ ColumnLayout {
inactiveOnColour: Colours.palette.m3onSurface inactiveOnColour: Colours.palette.m3onSurface
onClicked: { onClicked: {
const providers = [...Config.utilities.vpn.provider]; const providers = [...GlobalConfig.utilities.vpn.provider];
providers.push({ providers.push({
name: "warp", name: "warp",
displayName: "Cloudflare WARP", displayName: "Cloudflare WARP",

View file

@ -18,24 +18,24 @@ Item {
required property Session session required property Session session
property bool notificationsExpire: Config.notifs.expire ?? true property bool notificationsExpire: GlobalConfig.notifs.expire ?? true
property string notificationsFullscreen: Config.notifs.fullscreen ?? "on" property string notificationsFullscreen: GlobalConfig.notifs.fullscreen ?? "on"
property bool notificationsOpenExpanded: Config.notifs.openExpanded ?? false 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 notificationsGroupPreviewNum: Config.notifs.groupPreviewNum ?? 3
property int maxToasts: Config.utilities.maxToasts ?? 4 property int maxToasts: Config.utilities.maxToasts ?? 4
property string toastsFullscreen: Config.utilities.toasts.fullscreen ?? "off" property string toastsFullscreen: Config.utilities.toasts.fullscreen ?? "off"
property bool chargingChanged: Config.utilities.toasts.chargingChanged ?? true property bool chargingChanged: GlobalConfig.utilities.toasts.chargingChanged ?? true
property bool gameModeChanged: Config.utilities.toasts.gameModeChanged ?? true property bool gameModeChanged: GlobalConfig.utilities.toasts.gameModeChanged ?? true
property bool dndChanged: Config.utilities.toasts.dndChanged ?? true property bool dndChanged: GlobalConfig.utilities.toasts.dndChanged ?? true
property bool audioOutputChanged: Config.utilities.toasts.audioOutputChanged ?? true property bool audioOutputChanged: GlobalConfig.utilities.toasts.audioOutputChanged ?? true
property bool audioInputChanged: Config.utilities.toasts.audioInputChanged ?? true property bool audioInputChanged: GlobalConfig.utilities.toasts.audioInputChanged ?? true
property bool capsLockChanged: Config.utilities.toasts.capsLockChanged ?? true property bool capsLockChanged: GlobalConfig.utilities.toasts.capsLockChanged ?? true
property bool numLockChanged: Config.utilities.toasts.numLockChanged ?? true property bool numLockChanged: GlobalConfig.utilities.toasts.numLockChanged ?? true
property bool kbLayoutChanged: Config.utilities.toasts.kbLayoutChanged ?? true property bool kbLayoutChanged: GlobalConfig.utilities.toasts.kbLayoutChanged ?? true
property bool vpnChanged: Config.utilities.toasts.vpnChanged ?? true property bool vpnChanged: GlobalConfig.utilities.toasts.vpnChanged ?? true
property bool nowPlaying: Config.utilities.toasts.nowPlaying ?? false property bool nowPlaying: GlobalConfig.utilities.toasts.nowPlaying ?? false
function saveConfig(): void { function saveConfig(): void {
GlobalConfig.notifs.expire = root.notificationsExpire; GlobalConfig.notifs.expire = root.notificationsExpire;

View file

@ -106,7 +106,7 @@ Item {
Keys.onEscapePressed: root.visibilities.launcher = false Keys.onEscapePressed: root.visibilities.launcher = false
Keys.onPressed: event => { Keys.onPressed: event => {
if (!Config.launcher.vimKeybinds) if (!GlobalConfig.launcher.vimKeybinds)
return; return;
if (event.modifiers & Qt.ControlModifier) { if (event.modifiers & Qt.ControlModifier) {

View file

@ -15,12 +15,12 @@ Searcher {
} }
list: variants.instances list: variants.instances
useFuzzy: Config.launcher.useFuzzy.actions useFuzzy: GlobalConfig.launcher.useFuzzy.actions
Variants { Variants {
id: 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 {} Action {}
} }

View file

@ -66,13 +66,13 @@ Searcher {
} }
list: appDb.apps list: appDb.apps
useFuzzy: Config.launcher.useFuzzy.apps useFuzzy: GlobalConfig.launcher.useFuzzy.apps
AppDb { AppDb {
id: appDb id: appDb
path: `${Paths.state}/apps.sqlite` path: `${Paths.state}/apps.sqlite`
favouriteApps: Config.launcher.favouriteApps favouriteApps: GlobalConfig.launcher.favouriteApps
entries: DesktopEntries.applications.values.filter(a => !Strings.testRegexList(Config.launcher.hiddenApps, a.id)) entries: DesktopEntries.applications.values.filter(a => !Strings.testRegexList(GlobalConfig.launcher.hiddenApps, a.id))
} }
} }

View file

@ -69,7 +69,7 @@ Searcher {
description: qsTr("All colours are grayscale, no chroma.") description: qsTr("All colours are grayscale, no chroma.")
} }
] ]
useFuzzy: Config.launcher.useFuzzy.variants useFuzzy: GlobalConfig.launcher.useFuzzy.variants
component Variant: QtObject { component Variant: QtObject {
required property string variant required property string variant

View file

@ -26,7 +26,7 @@ Searcher {
} }
list: schemes.instances list: schemes.instances
useFuzzy: Config.launcher.useFuzzy.schemes useFuzzy: GlobalConfig.launcher.useFuzzy.schemes
keys: ["name", "flavour"] keys: ["name", "flavour"]
weights: [0.9, 0.1] weights: [0.9, 0.1]

View file

@ -81,7 +81,7 @@ StyledRect {
} }
} }
onClicked: event => { onClicked: event => {
if (!Config.notifs.actionOnClick || event.button !== Qt.LeftButton) if (!GlobalConfig.notifs.actionOnClick || event.button !== Qt.LeftButton)
return; return;
const actions = root.modelData.actions; const actions = root.modelData.actions;

View file

@ -27,7 +27,7 @@ StyledRect {
} }
if (item.id === "vpn") { 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); seenIds.add(item.id);

View file

@ -111,7 +111,7 @@ Singleton {
const newSinkName = sink.description || sink.name || qsTr("Unknown Device"); 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"); Toaster.toast(qsTr("Audio output changed"), qsTr("Now using: %1").arg(newSinkName), "volume_up");
previousSinkName = newSinkName; previousSinkName = newSinkName;
@ -123,7 +123,7 @@ Singleton {
const newSourceName = source.description || source.name || qsTr("Unknown Device"); 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"); Toaster.toast(qsTr("Audio input changed"), qsTr("Now using: %1").arg(newSourceName), "mic");
previousSourceName = newSourceName; previousSourceName = newSourceName;

View file

@ -28,11 +28,11 @@ Singleton {
onEnabledChanged: { onEnabledChanged: {
if (enabled) { if (enabled) {
setDynamicConfs(); 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"); Toaster.toast(qsTr("Game mode enabled"), qsTr("Disabled Hyprland animations, blur, gaps and shadows"), "gamepad");
} else { } else {
Hypr.extras.message("reload"); 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"); Toaster.toast(qsTr("Game mode disabled"), qsTr("Hyprland settings restored"), "gamepad");
} }
} }

View file

@ -93,7 +93,7 @@ Singleton {
Component.onCompleted: reloadDynamicConfs() Component.onCompleted: reloadDynamicConfs()
onCapsLockChanged: { onCapsLockChanged: {
if (!Config.utilities.toasts.capsLockChanged) if (!GlobalConfig.utilities.toasts.capsLockChanged)
return; return;
if (capsLock) if (capsLock)
@ -103,7 +103,7 @@ Singleton {
} }
onNumLockChanged: { onNumLockChanged: {
if (!Config.utilities.toasts.numLockChanged) if (!GlobalConfig.utilities.toasts.numLockChanged)
return; return;
if (numLock) if (numLock)
@ -113,7 +113,7 @@ Singleton {
} }
onKbLayoutFullChanged: { 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"); Toaster.toast(qsTr("Keyboard layout changed"), qsTr("Layout changed to: %1").arg(kbLayoutFull), "keyboard");
hadKeyboard = !!keyboard; hadKeyboard = !!keyboard;

View file

@ -33,7 +33,7 @@ QtObject {
property string appName property string appName
property string image property string image
property var hints // Hints are not persisted across restarts 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 int urgency: NotificationUrgency.Normal
property bool resident property bool resident
property bool hasActionIcons property bool hasActionIcons
@ -41,9 +41,9 @@ QtObject {
readonly property Timer timer: Timer { readonly property Timer timer: Timer {
running: true running: true
interval: notif.expireTimeout > 0 ? notif.expireTimeout : Config.notifs.defaultExpireTimeout interval: notif.expireTimeout > 0 ? notif.expireTimeout : GlobalConfig.notifs.defaultExpireTimeout
onTriggered: { onTriggered: {
if (Config.notifs.expire) if (GlobalConfig.notifs.expire)
notif.popup = false; notif.popup = false;
} }
} }

View file

@ -32,13 +32,13 @@ Singleton {
function shouldShowPopup(): bool { function shouldShowPopup(): bool {
if (props.dnd || [...Visibilities.screens.values()].some(v => v.sidebar)) if (props.dnd || [...Visibilities.screens.values()].some(v => v.sidebar))
return false; return false;
if (Config.notifs.fullscreen === "off" && hasFullscreen()) if (GlobalConfig.notifs.fullscreen === "off" && hasFullscreen())
return false; return false;
return true; return true;
} }
onDndChanged: { onDndChanged: {
if (!Config.utilities.toasts.dndChanged) if (!GlobalConfig.utilities.toasts.dndChanged)
return; return;
if (dnd) if (dnd)

View file

@ -37,7 +37,7 @@ Singleton {
Connections { Connections {
function onPostTrackChanged() { function onPostTrackChanged() {
if (!Config.utilities.toasts.nowPlaying) { if (!GlobalConfig.utilities.toasts.nowPlaying) {
return; return;
} }
if (root.active.trackArtist != "" && root.active.trackTitle != "") { if (root.active.trackArtist != "" && root.active.trackTitle != "") {

View file

@ -18,9 +18,9 @@ Singleton {
}) })
readonly property bool connecting: connectProc.running || disconnectProc.running 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: { 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"; return enabledProvider || "wireguard";
} }
readonly property bool isCustomProvider: typeof providerInput === "object" readonly property bool isCustomProvider: typeof providerInput === "object"
@ -279,7 +279,7 @@ Singleton {
} }
function emitStatusToast(statusObj: var): void { function emitStatusToast(statusObj: var): void {
if (!Config.utilities.toasts.vpnChanged) if (!GlobalConfig.utilities.toasts.vpnChanged)
return; return;
const displayName = root.currentConfig ? (root.currentConfig.displayName || "VPN") : "VPN"; const displayName = root.currentConfig ? (root.currentConfig.displayName || "VPN") : "VPN";

View file

@ -41,7 +41,7 @@ Searcher {
list: wallpapers.entries list: wallpapers.entries
key: "relativePath" key: "relativePath"
useFuzzy: Config.launcher.useFuzzy.wallpapers useFuzzy: GlobalConfig.launcher.useFuzzy.wallpapers
extraOpts: useFuzzy ? ({}) : ({ extraOpts: useFuzzy ? ({}) : ({
forward: false forward: false
}) })