aboutsummaryrefslogtreecommitdiff
path: root/.config/ags/widget/quicksettings/widgets/DND.ts
blob: 7fc1fd0313824b599930b1747c88a19911bf3c91 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
import { SimpleToggleButton } from "../ToggleButton"
import icons from "lib/icons"

const n = await Service.import("notifications")
const dnd = n.bind("dnd")

export const DND = () => SimpleToggleButton({
    icon: dnd.as(dnd => icons.notifications[dnd ? "silent" : "noisy"]),
    label: dnd.as(dnd => dnd ? "Silent" : "Noisy"),
    toggle: () => n.dnd = !n.dnd,
    connection: [n, () => n.dnd],
})