2024-06-22 21:16:35 +02:00
|
|
|
(defvar close_icon "/usr/share/icons/Qogir-ubuntu-dark/16/actions/window-close.svg")
|
|
|
|
|
2024-08-13 20:49:54 +02:00
|
|
|
(defvar end-binary "~/.local/bin/end-rs")
|
2024-08-09 13:57:05 +02:00
|
|
|
(defvar end-notifications '')
|
|
|
|
(defvar end-histories '')
|
|
|
|
(defvar end-replies '')
|
|
|
|
(defvar end-reply-text '')
|
2024-06-22 21:16:35 +02:00
|
|
|
|
2024-08-09 13:57:05 +02:00
|
|
|
(defwidget notification[notification]
|
2024-06-22 21:16:35 +02:00
|
|
|
(box
|
|
|
|
:class "notification"
|
|
|
|
:space-evenly false
|
|
|
|
:orientation "v"
|
|
|
|
:spacing 6
|
|
|
|
(box :orientation "h" :spacing 8 :space-evenly false
|
2024-08-09 13:57:05 +02:00
|
|
|
(box
|
2024-08-13 20:49:54 +02:00
|
|
|
:class "${(notification.app_icon ?: "") != "" ? "notification-app-icon" : ""}"
|
2024-08-09 13:57:05 +02:00
|
|
|
:style "background-image: url('${notification.app_icon}');"
|
|
|
|
)
|
2024-06-22 21:16:35 +02:00
|
|
|
(label
|
2024-08-09 13:57:05 +02:00
|
|
|
:text "${notification.application}"
|
2024-06-22 21:16:35 +02:00
|
|
|
:halign "start"
|
|
|
|
:hexpand true)
|
2024-08-09 13:57:05 +02:00
|
|
|
(button :onclick "${end-binary} close ${notification.id}"
|
2024-06-22 21:16:35 +02:00
|
|
|
(image
|
|
|
|
:path "${close_icon}"
|
|
|
|
:image-width 24
|
|
|
|
:image-height 24)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
(box :orientation "h" :space-evenly false :spacing 8
|
|
|
|
(box
|
2024-08-09 13:57:05 +02:00
|
|
|
:class "${notification.icon != "" ? "notification-icon" : ""}"
|
|
|
|
:style "background-image: url('${notification.icon}');"
|
2024-06-22 21:16:35 +02:00
|
|
|
)
|
|
|
|
(box
|
|
|
|
:class "notification-text-container"
|
|
|
|
:orientation "v"
|
|
|
|
:hexpand true
|
|
|
|
:space-evenly false
|
|
|
|
(label
|
|
|
|
:class "notification-summary"
|
2024-08-09 13:57:05 +02:00
|
|
|
:text "${notification.summary}"
|
2024-06-22 21:16:35 +02:00
|
|
|
:halign "start")
|
|
|
|
(label
|
2024-08-09 13:57:05 +02:00
|
|
|
:text "${notification.body}"
|
2024-06-22 21:16:35 +02:00
|
|
|
:wrap true
|
|
|
|
:halign "fill"
|
|
|
|
:vexpand true)
|
2024-08-09 13:57:05 +02:00
|
|
|
(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}))
|
|
|
|
)
|
2024-06-22 21:16:35 +02:00
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
(defwindow notification_overlay
|
|
|
|
:namespace "eww.notification_overlay"
|
|
|
|
:monitor 0
|
|
|
|
:geometry (geometry
|
|
|
|
:width "400px"
|
|
|
|
:anchor "bottom right")
|
|
|
|
:stacking "overlay"
|
|
|
|
:focusable false
|
|
|
|
:exclusive true
|
2024-08-09 13:57:05 +02:00
|
|
|
(literal :content end-notifications)
|
2024-06-22 21:16:35 +02:00
|
|
|
)
|