diff --git a/.config/quickshell/modules/common/widgets/NotificationItem.qml b/.config/quickshell/modules/common/widgets/NotificationItem.qml index 9a2a7c31d..bf8a76871 100644 --- a/.config/quickshell/modules/common/widgets/NotificationItem.qml +++ b/.config/quickshell/modules/common/widgets/NotificationItem.qml @@ -35,6 +35,28 @@ Item { // Notification item area implicitHeight: background.implicitHeight + function processNotificationBody(body, appName) { + let processedBody = body + + // Clean Chromium-based browsers notifications - remove first line + if (appName) { + const lowerApp = appName.toLowerCase() + const chromiumBrowsers = [ + "brave", "chrome", "chromium", "vivaldi", "opera", "microsoft edge" + ] + + if (chromiumBrowsers.some(name => lowerApp.includes(name))) { + const lines = body.split('\n\n') + + if (lines.length > 1 && lines[0].startsWith('") + } } } @@ -193,8 +217,10 @@ Item { // Notification item area wrapMode: Text.Wrap elide: Text.ElideRight textFormat: Text.RichText - text: `` + - `${notificationObject.body.replace(/\n/g, "
")}` + text: { + return `` + + `${processNotificationBody(notificationObject.body, notificationObject.appName || notificationObject.summary).replace(/\n/g, "
")}` + } onLinkActivated: (link) => { Qt.openUrlExternally(link) @@ -298,4 +324,4 @@ Item { // Notification item area } } } -} \ No newline at end of file +}