From 673ae8d040f2f75732be95a5086f8869038fe5af Mon Sep 17 00:00:00 2001 From: ItsLemmy Date: Sat, 4 Oct 2025 18:12:07 -0400 Subject: [PATCH] Notifications: minor ram optimization by avoiding loader on inactive monitors. --- Bin/notifications-test.sh | 6 ++++++ Modules/Notification/Notification.qml | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Bin/notifications-test.sh b/Bin/notifications-test.sh index 789b036b..ac6d74a7 100755 --- a/Bin/notifications-test.sh +++ b/Bin/notifications-test.sh @@ -17,17 +17,23 @@ if command -v notify-send >/dev/null 2>&1; then # 1) Themed icon name notify-send -i dialog-information "Icon name test" "Should resolve from theme (dialog-information)" + sleep 1 + # 2) Absolute path if a sample image exists SAMPLE_IMG="/usr/share/pixmaps/steam.png" if [ -f "$SAMPLE_IMG" ]; then notify-send -i "$SAMPLE_IMG" "Absolute path test" "Should show the provided image path" fi + sleep 1 + # 3) file:// URL form if [ -f "$SAMPLE_IMG" ]; then notify-send -i "file://$SAMPLE_IMG" "file:// URL test" "Should display after stripping scheme" fi + sleep 1 + echo "Icon/image tests sent!" fi diff --git a/Modules/Notification/Notification.qml b/Modules/Notification/Notification.qml index 3ffe05e2..f33bcafc 100644 --- a/Modules/Notification/Notification.qml +++ b/Modules/Notification/Notification.qml @@ -10,7 +10,8 @@ import qs.Widgets // Simple notification popup - displays multiple notifications Variants { - model: Quickshell.screens + // If no notification display activated in settings, then show them all + model: Quickshell.screens.filter(screen => (Settings.data.osd.monitors.includes(screen.name) || (Settings.data.osd.monitors.length === 0))) delegate: Loader { id: root @@ -21,8 +22,7 @@ Variants { // Access the notification model from the service - UPDATED NAME property ListModel notificationModel: NotificationService.activeList - // If no notification display activated in settings, then show them all - active: modelData && (Settings.data.notifications.monitors.includes(modelData.name) || (Settings.data.notifications.monitors.length === 0)) + active: true Connections { target: ScalingService @@ -236,7 +236,7 @@ Variants { // Animation behaviors Behavior on scale { NumberAnimation { - duration: Style.animationSlow + duration: Style.animationNormal easing.type: Easing.OutExpo } }