1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-24 21:42:51 -05:00

Suppress niri toasts on theme changes

This commit is contained in:
bbedward
2025-09-22 14:50:35 -04:00
parent aa52b586d6
commit 62b7b30754
2 changed files with 14 additions and 4 deletions

View File

@@ -869,7 +869,7 @@ Singleton {
onExited: exitCode => {
if (exitCode === 0) {
if (typeof ToastService !== "undefined") {
if (typeof ToastService !== "undefined" && typeof NiriService !== "undefined" && !NiriService.matugenSuppression) {
ToastService.showInfo("GTK colors applied successfully")
}
} else {

View File

@@ -30,6 +30,7 @@ Singleton {
property bool hasInitialConnection: false
property bool suppressConfigToast: true
property bool suppressNextConfigToast: false
property bool matugenSuppression: false
readonly property string socketPath: Quickshell.env("NIRI_SOCKET")
@@ -346,10 +347,12 @@ Singleton {
if (ToastService.toastVisible && ToastService.currentLevel === ToastService.levelError) {
ToastService.hideToast()
}
if (hasInitialConnection && !suppressConfigToast && !suppressNextConfigToast) {
if (hasInitialConnection && !suppressConfigToast && !suppressNextConfigToast && !matugenSuppression) {
ToastService.showInfo("niri: config reloaded")
} else if (suppressNextConfigToast) {
suppressNextConfigToast = false
suppressResetTimer.stop()
}
suppressNextConfigToast = false
}
if (!hasInitialConnection) {
@@ -496,7 +499,8 @@ Singleton {
}
function suppressNextToast() {
suppressNextConfigToast = true
matugenSuppression = true
suppressResetTimer.restart()
}
function findNiriWindow(toplevel) {
@@ -595,4 +599,10 @@ Singleton {
interval: 3000
onTriggered: root.suppressConfigToast = false
}
Timer {
id: suppressResetTimer
interval: 2000
onTriggered: root.matugenSuppression = false
}
}