This commit is contained in:
Sakooooo 2024-08-04 21:53:38 +04:00
parent faa184cb3f
commit 03cf43c4f7
Signed by: sako
GPG key ID: 3FD715D87D7725E0

View file

@ -1,5 +1,5 @@
const hyprland = await Service.import("hyprland") const hyprland = await Service.import("hyprland")
const notifications = await Service.import("notifications") // const notifications = await Service.import("notifications")
const mpris = await Service.import("mpris") const mpris = await Service.import("mpris")
const audio = await Service.import("audio") const audio = await Service.import("audio")
const battery = await Service.import("battery") const battery = await Service.import("battery")
@ -47,21 +47,21 @@ function Clock() {
// we don't need dunst or any other notification daemon // we don't need dunst or any other notification daemon
// because the Notifications module is a notification daemon itself // because the Notifications module is a notification daemon itself
function Notification() { // function Notification() {
const popups = notifications.bind("popups") // const popups = notifications.bind("popups")
return Widget.Box({ // return Widget.Box({
class_name: "notification", // class_name: "notification",
visible: popups.as(p => p.length > 0), // visible: popups.as(p => p.length > 0),
children: [ // children: [
Widget.Icon({ // Widget.Icon({
icon: "preferences-system-notifications-symbolic", // icon: "preferences-system-notifications-symbolic",
}), // }),
Widget.Label({ // Widget.Label({
label: popups.as(p => p[0]?.summary || ""), // label: popups.as(p => p[0]?.summary || ""),
}), // }),
], // ],
}) // })
} // }
function Media() { function Media() {
@ -172,7 +172,7 @@ function Center() {
spacing: 8, spacing: 8,
children: [ children: [
Media(), Media(),
Notification(), // Notification(),
], ],
}) })
} }