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 {
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;

View file

@ -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) {

View file

@ -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);

View file

@ -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)
}
}
}

View file

@ -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 {

View file

@ -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,

View file

@ -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);
}

View file

@ -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",

View file

@ -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;

View file

@ -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) {

View file

@ -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 {}
}

View file

@ -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))
}
}

View file

@ -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

View file

@ -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]

View file

@ -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;

View file

@ -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);

View file

@ -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;

View file

@ -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");
}
}

View file

@ -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;

View file

@ -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;
}
}

View file

@ -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)

View file

@ -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 != "") {

View file

@ -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";

View file

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