Notifications: minor ram optimization by avoiding loader on inactive monitors.

This commit is contained in:
ItsLemmy
2025-10-04 18:12:07 -04:00
parent 9672c55e7d
commit 673ae8d040
2 changed files with 10 additions and 4 deletions
+6
View File
@@ -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
+4 -4
View File
@@ -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
}
}