pointfichiers/bar/eww/notification/widget.yuck
GaspardCulis 92675c329d fix(eww): Fixed notification widget close icon path
Now stored locally as asset
2024-09-21 13:57:05 +02:00

78 lines
2.1 KiB
Text

(defvar close_icon "/home/gaspard/.config/eww/assets/icons/window-close.svg")
(defvar end-binary "end-rs")
(defvar end-notifications '')
(defvar end-histories '')
(defvar end-replies '')
(defvar end-reply-text '')
(defwidget notification[notification]
(box
:class "notification"
:space-evenly false
:orientation "v"
:spacing 6
(box :orientation "h" :spacing 8 :space-evenly false
(box
:class "${(notification.app_icon ?: "") != "" ? "notification-app-icon" : ""}"
:style "background-image: url('${notification.app_icon}');"
)
(label
:text "${notification.application}"
:halign "start"
:hexpand true)
(button :onclick "${end-binary} close ${notification.id}"
(image
:path "${close_icon}"
:image-width 24
:image-height 24)
)
)
(box :orientation "h" :space-evenly false :spacing 8
(box
:class "${notification.icon != "" ? "notification-icon" : ""}"
:style "background-image: url('${notification.icon}');"
)
(box
:class "notification-text-container"
:orientation "v"
:hexpand true
:space-evenly false
(label
:class "notification-summary"
:text "${notification.summary}"
:halign "start")
(label
:text "${notification.body}"
:wrap true
:halign "fill"
:vexpand true)
(box
:class "notification-buttons"
:orientation "horizontal"
:space-evenly false
:halign "end"
:vexpand false
(for action in {notification.actions}
(button
:class "notification-button"
:onclick "${end-binary} action ${notification.id} ${action.id}"
:vexpand false
{action.text}))
)
)
)
)
)
(defwindow notification_overlay
:namespace "eww.notification_overlay"
:monitor 0
:geometry (geometry
:width "400px"
:anchor "bottom right")
:stacking "overlay"
:focusable false
:exclusive true
(literal :content end-notifications)
)