aboutsummaryrefslogtreecommitdiffstats
path: root/notifications
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-10-19 09:19:10 +0200
committerDanilo M. <danix@danix.xyz>2026-10-19 09:19:10 +0200
commiteb7629c5804b75d99be717a3f401f0c15adb9029 (patch)
treee45d360e341f5fac7957167e9165a1e87a25cacd /notifications
parentd21ff23ed34048b4334c1183e8961b33d974969e (diff)
downloadquickshell-eb7629c5804b75d99be717a3f401f0c15adb9029.tar.gz
quickshell-eb7629c5804b75d99be717a3f401f0c15adb9029.zip
notifications: place, mute and DND balloons from config.json
Screen and corner come from the shared config. Mute and the DND rule go through NotifyConfig.withheld, so the settings page's node check covers the same decision the balloon makes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'notifications')
-rw-r--r--notifications/Balloons.qml13
-rw-r--r--notifications/NotificationBalloon.qml9
2 files changed, 13 insertions, 9 deletions
diff --git a/notifications/Balloons.qml b/notifications/Balloons.qml
index 0a48510..b02099c 100644
--- a/notifications/Balloons.qml
+++ b/notifications/Balloons.qml
@@ -14,7 +14,8 @@ import Quickshell.Io
import Quickshell.Wayland
import QtQuick
-// The balloon stack, bottom-right of DP-1, over conky.
+// The balloon stack, in the corner and on the screen notifyd's config.json
+// names (bottom-right of DP-1 by default), over conky.
Scope {
id: root
@@ -78,9 +79,12 @@ Scope {
// re-maps it. Expired entries that stay in the queue keep a
// zero-height window mapped, which is harmless.
visible: root.live.length > 0
- screen: Quickshell.screens.find(s => s.name === "DP-1") ?? Quickshell.screens[0]
- anchors { bottom: true; right: true }
- margins { bottom: 12; right: 12 }
+ readonly property var place: Notify.config.balloons
+ readonly property bool atTop: place.corner.startsWith("top")
+ readonly property bool atLeft: place.corner.endsWith("left")
+ screen: Quickshell.screens.find(s => s.name === place.screen) ?? Quickshell.screens[0]
+ anchors { top: atTop; bottom: !atTop; left: atLeft; right: !atLeft }
+ margins { top: 12; bottom: 12; left: 12; right: 12 }
implicitWidth: 340
implicitHeight: column.implicitHeight
color: "transparent"
@@ -92,7 +96,6 @@ Scope {
Column {
id: column
width: parent.width
- anchors { bottom: parent.bottom; right: parent.right }
spacing: 8
Repeater {
diff --git a/notifications/NotificationBalloon.qml b/notifications/NotificationBalloon.qml
index a9f9459..6a674b8 100644
--- a/notifications/NotificationBalloon.qml
+++ b/notifications/NotificationBalloon.qml
@@ -11,6 +11,7 @@
import QtQuick
import QtQuick.Shapes
+import "NotifyConfig.js" as NC
// One balloon: icon at the left, app, summary and body, an X, and the click
// targets. The body is markup, which is why the daemon advertises body-markup.
@@ -28,13 +29,13 @@ Rectangle {
// Driven by the shell's tick. The balloon drops itself once its expiry
// passes, or while a suppression says so: the drawer and snooze withhold
- // everything, DND withholds low and normal but still shows critical. The
- // drawer lists a notification DND chose not to pop, because a list the
- // user opened is not an interruption.
+ // everything; a muted app and DND are config.json's call (DND passes
+ // critical unless dndPassCritical is off). The drawer still lists what
+ // was withheld, because a list the user opened is not an interruption.
visible: {
if (Notify.drawerOpen) return false;
if (Notify.snoozeUntil > b.now) return false;
- if (Notify.dnd && b.notification.urgency !== "critical") return false;
+ if (NC.withheld(Notify.config, b.notification, Notify.dnd)) return false;
if (b.notification.expires !== 0 && b.now >= b.notification.expires) return false;
return true;
}