From 55389133204e513406e6523782049ad9963bf893 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=E1=BB=B3nh=20Thi=E1=BB=87n=20L=E1=BB=99c?= Date: Thu, 23 Jul 2026 21:12:39 +0700 Subject: [PATCH] feat(settings): add option to suppress config reload toast (#2730) (#2915) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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 --- quickshell/Common/SessionData.qml | 1 + quickshell/Common/settings/SessionSpec.js | 3 +- .../Modules/Settings/CompositorLayoutTab.qml | 18 ++++++++ quickshell/Services/MangoService.qml | 2 +- quickshell/Services/NiriService.qml | 2 +- .../translations/settings_search_index.json | 46 +++++++++++++++++++ 6 files changed, 69 insertions(+), 3 deletions(-) diff --git a/quickshell/Common/SessionData.qml b/quickshell/Common/SessionData.qml index 95e6e239e..66305fde3 100644 --- a/quickshell/Common/SessionData.qml +++ b/quickshell/Common/SessionData.qml @@ -224,6 +224,7 @@ Singleton { property string niriOverviewLastMode: "apps" property string settingsSidebarExpandedIds: "," property string settingsSidebarCollapsedIds: "," + property bool showConfigReloadToast: true Component.onCompleted: { loadSettings(); diff --git a/quickshell/Common/settings/SessionSpec.js b/quickshell/Common/settings/SessionSpec.js index c11bcf788..56617ff98 100644 --- a/quickshell/Common/settings/SessionSpec.js +++ b/quickshell/Common/settings/SessionSpec.js @@ -98,7 +98,8 @@ var SPEC = { niriOverviewLastMode: { def: "apps" }, settingsSidebarExpandedIds: { def: "," }, - settingsSidebarCollapsedIds: { def: "," } + settingsSidebarCollapsedIds: { def: "," }, + showConfigReloadToast: { def: true } }; function getValidKeys() { diff --git a/quickshell/Modules/Settings/CompositorLayoutTab.qml b/quickshell/Modules/Settings/CompositorLayoutTab.qml index b5db373fe..505375400 100644 --- a/quickshell/Modules/Settings/CompositorLayoutTab.qml +++ b/quickshell/Modules/Settings/CompositorLayoutTab.qml @@ -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"] diff --git a/quickshell/Services/MangoService.qml b/quickshell/Services/MangoService.qml index e815dd761..ba82ed2a0 100644 --- a/quickshell/Services/MangoService.qml +++ b/quickshell/Services/MangoService.qml @@ -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); diff --git a/quickshell/Services/NiriService.qml b/quickshell/Services/NiriService.qml index d1c1bc96b..176139721 100644 --- a/quickshell/Services/NiriService.qml +++ b/quickshell/Services/NiriService.qml @@ -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; diff --git a/quickshell/translations/settings_search_index.json b/quickshell/translations/settings_search_index.json index f381e5e2b..29b10188a 100644 --- a/quickshell/translations/settings_search_index.json +++ b/quickshell/translations/settings_search_index.json @@ -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",