1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-08-01 19:18:28 -04:00

feat(settings): add option to suppress config reload toast (#2730) (#2915)

* feat(settings): add option to suppress config reload toast (#2730)

Add a toggle in Settings → Compositor Layout to disable the 'config reloaded' toast for Niri and MangoWC compositors. Session setting showConfigReloadToast defaults to true.

* chore: update settings search index for config reload toast

* refactor(settings): rename 'Compositor Notifications' to 'Compositor Toasts'

* fix(settings): reuse existing I18n.tr('Notifications') translation
This commit is contained in:
Huỳnh Thiện Lộc
2026-07-23 21:12:39 +07:00
committed by GitHub
parent 8188ced955
commit 5538913320
6 changed files with 69 additions and 3 deletions
+1
View File
@@ -224,6 +224,7 @@ Singleton {
property string niriOverviewLastMode: "apps"
property string settingsSidebarExpandedIds: ","
property string settingsSidebarCollapsedIds: ","
property bool showConfigReloadToast: true
Component.onCompleted: {
loadSettings();
+2 -1
View File
@@ -98,7 +98,8 @@ var SPEC = {
niriOverviewLastMode: { def: "apps" },
settingsSidebarExpandedIds: { def: "," },
settingsSidebarCollapsedIds: { def: "," }
settingsSidebarCollapsedIds: { def: "," },
showConfigReloadToast: { def: true }
};
function getValidKeys() {
@@ -267,6 +267,24 @@ awk '$1 == "xray" { print FILENAME ":" FNR; exit }' $files 2>/dev/null`;
}
}
SettingsCard {
width: parent.width
tags: ["compositor", "toast"]
title: I18n.tr("Notifications")
settingKey: "compositorNotifications"
iconName: "notifications"
visible: CompositorService.isNiri || CompositorService.isMango
SettingsToggleRow {
tags: ["compositor", "toast", "reload"]
settingKey: "showConfigReloadToast"
text: I18n.tr("Show \"config reloaded\" Toast")
description: I18n.tr("Show a toast when the compositor config is reloaded")
checked: SessionData.showConfigReloadToast
onToggled: checked => SessionData.showConfigReloadToast = checked
}
}
SettingsCard {
width: parent.width
tags: ["niri", "layout", "gaps", "radius", "window", "border"]
+1 -1
View File
@@ -473,7 +473,7 @@ Singleton {
function reloadConfig(showToast, suppressWatch) {
if (!CompositorService.isMango || !root.available)
return;
const shouldShowToast = showToast !== false;
const shouldShowToast = showToast !== false && SessionData.showConfigReloadToast;
const shouldSuppressWatch = suppressWatch !== false;
if (shouldSuppressWatch)
suppressWatchedConfigReloads(1500);
+1 -1
View File
@@ -633,7 +633,7 @@ Singleton {
configGenerationAction.schedule();
configReloaded();
if (hasInitialConnection && !suppressConfigToast && !suppressNextConfigToast && !matugenSuppression) {
if (hasInitialConnection && !suppressConfigToast && !suppressNextConfigToast && !matugenSuppression && SessionData.showConfigReloadToast) {
ToastService.showInfo(I18n.tr("niri: config reloaded"), "", "", "niri-config");
} else if (suppressNextConfigToast) {
suppressNextConfigToast = false;
@@ -9105,6 +9105,32 @@
],
"description": "Space between windows"
},
{
"section": "compositorNotifications",
"label": "Notifications",
"tabIndex": 37,
"category": "Personalization",
"keywords": [
"alert",
"alerts",
"appearance",
"compositor",
"config",
"custom",
"customize",
"notif",
"notifications",
"notifs",
"personal",
"personalization",
"reloaded",
"show",
"toast"
],
"icon": "notifications",
"description": "Show a toast when the compositor config is reloaded",
"conditionKey": "isNiri"
},
{
"section": "hyprlandLayoutGapsOutOverride",
"label": "Outer Gaps",
@@ -9316,6 +9342,26 @@
],
"description": "Resize windows by dragging their edges with the mouse"
},
{
"section": "showConfigReloadToast",
"label": "Show \\",
"tabIndex": 37,
"category": "Personalization",
"keywords": [
"appearance",
"compositor",
"config",
"custom",
"customize",
"personal",
"personalization",
"reload",
"reloaded",
"show",
"toast"
],
"description": "Show a toast when the compositor config is reloaded"
},
{
"section": "hyprlandLayoutRadiusOverride",
"label": "Window Corner Radius",