Files
glassMxrph/quickshell/controlcenter/modules/Dnd.qml
T
mxandClaude Opus 5.5 395de70b26 Add native notifications with OSD-style banners and a Control Center module
glassMxrph now owns org.freedesktop.Notifications. Banners drop out of the
bar like the OSD; Control Center stacks history per app like macOS
Notification Center. Do Not Disturb lives in the shell and falls back to
SwayNC while another daemon holds the bus name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 14:47:40 +02:00

21 lines
915 B
QML

import QtQuick
import ".."
import "../../services"
// Built-in notifications keep DND in the shell; SwayNC is controlled over DBus.
CCTile {
readonly property var info: SystemService.state.dnd || ({
available: false
})
readonly property bool shellOwned: NotificationService.active
objectName: "dndToggle"
title: "Do Not Disturb"
detail: shellOwned ? (NotificationService.dnd ? "On" : "Off") : !info.available ? (info.notice || "No notification server") : info.enabled ? "On" : "Off"
glyph: "󰽥"
fallback: "☾"
// Shows acknowledged provider state; a failed request leaves it unchanged.
checked: shellOwned ? NotificationService.dnd : !!info.enabled
enabled: shellOwned || (!!info.available && !SystemService.acting)
onClicked: shellOwned ? NotificationService.setDnd(!NotificationService.dnd) : SystemService.action("dnd", !info.enabled, false)
}