eww: add new tiles to control-center, new notification popup, new styles for a lot of widgets

This commit is contained in:
retrozinndev
2025-01-07 16:26:20 -03:00
parent 435b222e03
commit c505ecf4cf
43 changed files with 802 additions and 319 deletions
+12 -1
View File
@@ -7,19 +7,25 @@
(include "widgets/bar/window.yuck")
(include "widgets/bar/network.yuck")
(include "widgets/bar/battery.yuck")
(include "widgets/bar/hardware.yuck")
(defwindow bar
:monitor 0
:geometry (geometry :width "100%"
:height "44px"
:height "50px"
:anchor "top center")
:stacking "fg"
:exclusive true
:namespace "eww-bar"
(box :class "bar"
:vexpand true
:hexpand false
(centerbox :orientation "horizontal"
(box :class "widgets-left"
:halign "start"
:space-evenly false
:vexpand true
(logo)
(workspaces)
(window)
@@ -27,12 +33,16 @@
(box :class "widgets-center"
:halign "center"
:space-evenly false
:vexpand true
(clock)
(media)
)
(box :class "widgets-right"
:halign "end"
:space-evenly false
:vexpand true
(systray :spacing 0
:orientation "horizontal"
:space-evenly false
@@ -46,4 +56,5 @@
(cc-toggle)
)
)
)
)
+5 -2
View File
@@ -9,8 +9,11 @@
:space-evenly false
:orientation "vertical"
(label :class "calendar-header"
:text "${month-name} ${day}, ${year}")
(label :class "time"
:text { formattime(EWW_TIME, "%H:%M") })
(label :class "date"
:text { formattime(EWW_TIME, "%B %d, %Y") })
(calendar :class "month-calendar"
:show-details true
:show-heading true
+19 -5
View File
@@ -1,11 +1,12 @@
(include "widgets/control-center/top-bar.yuck")
(include "widgets/control-center/notifications.yuck")
(include "widgets/control-center/notification.yuck")
(include "widgets/control-center/toggles.yuck")
(include "widgets/control-center/tiles.yuck")
(defwindow control-center []
:monitor 0
:geometry (geometry :width "500px"
:height "90%"
:anchor "top right")
:stacking "overlay"
:exclusive false
@@ -15,10 +16,23 @@
:orientation "vertical"
:space-evenly false
(top-bar)
(toggles)
(big-media :show-album-bg true
:show-album-image true
:visible { json_media == "" || (json_media.title == "null" && json_media.artist == "null") ? false : true })
(tiles)
(revealer :reveal { window_state_floating-media != "open" }
:transition "slideup"
:duration "380ms"
(big-media :show-album-bg true
:show-album-image true
:visible { json_media == "" || (json_media.title == "null"
&& json_media.artist == "null") ? false : true })
)
(notifications)
(box :class "bottom button-row"
:halign "end"
:space-evenly false
(button :class "clear-all"
:onclick "sh scripts/notification-clear.sh"
:visible { arraylength(json_notification_history["history"]) > 0 }
"󰎟 Clear")
)
)
)
+9 -2
View File
@@ -1,7 +1,7 @@
(defwindow floating-media []
:monitor 0
:geometry (geometry :anchor "top center"
:width "400px")
:width "450px")
:exclusive false
:stacking "fg"
:focusable false
@@ -9,8 +9,15 @@
(box :class "floating-media"
:orientation "vertical"
:space-evenly false
:visible { json_media == "" || (json_media.title == "null"
&& json_media.artist == "null") ? false : true }
(big-media :show-album-bg true
:album-image-size 124
:show-album-image true)
:show-album-image true
:style "margin: 16px; margin-top: 0; box-shadow:
0 5px 6px 1px rgba(0, 0, 0, .6),
inset 0 0 0 200px rgba(0, 0, 0, .52);"
:visible true)
)
)
+114
View File
@@ -0,0 +1,114 @@
(defwindow floating-notifications []
:monitor 0
:exclusive false
:focusable false
:namespace "eww-notification-popup"
:geometry (geometry :anchor "top right"
:width "512px"
:height "1px"
:x "5px")
:stacking "overlay"
(box :class "floating-notifications"
:orientation "vertical"
:space-evenly false
:hexpand true
:vexpand false
(box :class "notifications"
:space-evenly false
:orientation "vertical"
(for item in { json_popup_notifications["notifications"] }
(floating-notification :summary "${item.summary.data}"
:body "${item.body.data}"
:image "${item.app-icon.data}"
:app-name "${item.app-name.data}"
:onhoverlost "sh scripts/notification-popup-remove.sh ${item.id.data}")
)
)
(box :visible { arraylength(json_popup_notifications?.["notifications"]) > 0 }
:orientation "horizontal"
:valign "end"
:class "bottom"
:space-evenly true
:vexpand false
(box :class "left"
:space-evenly false
(box :space-evenly false
:class "tip"
:valign "center"
(label :text "󱧡"
:class "icon")
(label :halign "start"
:text "Hover to dismiss"
:yalign 0.5)
)
)
(box :class "right"
:space-evenly false
:halign "end"
(eventbox :class "button"
:onclick "sh ${EWW_CONFIG_DIR}/scripts/eww-window.sh close floating-notifications; ${EWW_CMD} update 'json_popup_notifications={\"notifications\": []}'"
(box :class "clear-all"
:space-evenly false
(label :text "󰎟"
:class "icon")
(label :text "Clear all")
)
)
)
)
)
)
(defwidget floating-notification [ summary body image app-name ?onhoverlost ]
(eventbox :onhoverlost "${onhoverlost}"
:class "floating-notification-eventbox"
(box :class "floating-notification"
:space-evenly false
:orientation "vertical"
(box :orientation "horizontal"
:class "top"
:space-evenly false
(image :class "app-icon"
:icon "${ app-name =~ 'zen-alpha' ? 'zen-browser' : app-name }"
:icon-size "menu")
(label :text "${app-name}"
:xalign 0)
)
(box :orientation "horizontal"
:space-evenly false
:class "content"
(box :class "image"
:style "background-image: image(url('${image}'));"
:width 86
:height 85
:visible { image != "" ? true : false })
(box :class "text-content"
:orientation "vertical"
:space-evenly false
(label :class "summary"
:markup "${summary}"
:xalign 0)
(label :class "body"
:markup "${body}"
:xalign 0
:wrap true
:show-truncated false)
)
)
)
)
)
+14
View File
@@ -0,0 +1,14 @@
(defwindow hardware-monitor []
:monitor 0
:geometry (geometry :width "320"
:anchor "top right")
:exclusive 0
:namespace "eww-hardware"
:focusable false
:stacking "fg"
(box :class "hardware-monitor"
; TODO
)
)
@@ -1,63 +0,0 @@
(defwindow floating-notifications []
:monitor 0
:exclusive false
:focusable false
:namespace "eww-notification-popup"
:geometry (geometry :anchor "top right"
:width "512px"
:height "1px"
:x "5px")
:stacking "overlay"
(box :class "floating-notifications"
:orientation "vertical"
(for item in json_recent_notifications
(floating-notification :summary "${item.summary.data}"
:body "${item.body.data}"
:image "${item.icon_path.data}"
:app-name "${item.appname.data}")
)
)
)
(defwidget floating-notification [ summary body image app-name ]
(box :class "floating-notification"
:space-evenly false
:orientation "vertical"
(box :orientation "horizontal"
:class "top"
:space-evenly false
(image :class "app-icon"
:icon "${ app-name =~ 'zen-alpha' ? 'zen-browser' : app-name }"
:icon-size "menu")
(label :text "${app-name}"
:xalign 0)
)
(box :orientation "horizontal"
:space-evenly false
:class "content"
(box :class "image"
:style "background-image: image(url('${image}'));"
:width 86
:height 85
:visible { image != "" ? true : false })
(box :class "text-content"
:orientation "vertical"
:space-evenly false
(label :class "summary"
:text "${summary}"
:xalign 0)
(label :class "body"
:text "${body}"
:xalign 0)
)
)
)
)
+2 -1
View File
@@ -18,7 +18,8 @@
(output-slider)
(source-slider)
(box :class "separator")
(separator :orientation "vertical"
:alpha 0.5)
(box :class "vertical button-row"
:orientation "vertical"
+1
View File
@@ -11,5 +11,6 @@
(box :class "volume-popup"
(output-slider)
(source-slider)
; TODO
)
)