This commit is contained in:
t
2025-02-05 19:25:48 +01:00
parent cbe4355c3d
commit 810f54cb65
258 changed files with 4730 additions and 3 deletions
@@ -0,0 +1,19 @@
from .qs_button import QSButton
from ignis.services.notifications import NotificationService
notifications = NotificationService.get_default()
def dnd_button() -> QSButton:
return QSButton(
label=notifications.bind("dnd", lambda value: "Silent" if value else "Noisy"),
icon_name=notifications.bind(
"dnd",
transform=lambda value: "notification-disabled-symbolic"
if value
else "notification-symbolic",
),
on_activate=lambda x: notifications.set_dnd(not notifications.dnd),
on_deactivate=lambda x: notifications.set_dnd(not notifications.dnd),
active=notifications.bind("dnd"),
)