Files
hyprland/config/ags/widget/control_center/buttons/dnd.js
T
2024-05-18 15:14:03 +05:45

17 lines
475 B
JavaScript

import QsButton from "./qs_button.js";
const notifications = await Service.import("notifications");
export default () =>
QsButton({
icon: notifications
.bind("dnd")
.as((dnd) => `notifications-${dnd ? "disabled-" : ""}symbolic`),
label: "DND",
setup: (self) => {
self.hook(notifications, () => {
self.toggleClassName("active", notifications.dnd);
});
},
on_clicked: () => (notifications.dnd = !notifications.dnd),
});