Component DateTimeWidg for panel date and time

This commit is contained in:
Candifloss 2026-09-03 14:02:24 +05:30
parent bbe036d390
commit 9e6a9880e5
5 changed files with 25 additions and 17 deletions

View File

@ -0,0 +1,12 @@
# Date-time widget
component DateTimeWidg (widgname, widgtextvar) {
widget_name = "${widgname}"
Label {
class = "textwidg datetimewidg " + widgname
text = global(widgtextvar)
halign = "end"
height = config.panel_height
}
}

View File

@ -1,3 +1,5 @@
import "nbcl/components/datetime_widg.nbcl" as datetime_widg { * }
component EwwiiPanel () { component EwwiiPanel () {
Box { Box {
orinetation = "horizontal" orinetation = "horizontal"
@ -6,19 +8,13 @@ component EwwiiPanel () {
height = config.panel_height height = config.panel_height
width = config.panel_width width = config.panel_width
Label { DateTimeWidg "paneldatewidg" {
widget_name = "datewidg" widgname = "paneldatewidg"
class = "textwidg datewidg" widgtextvar = "date_ddM"
text = global("date_ddM") }
halign = "end" DateTimeWidg "paneltimewidg" {
height = config.panel_height widgname = "paneltimewidg"
} widgtextvar = "time_hhmm"
Label { }
widget_name = "clockwidg"
class = "textwidg clockwidg"
text = global("time_hhmm")
halign = "end"
height = config.panel_height
}
} }
} }

View File

@ -3,7 +3,7 @@ import "nbcl/panel/panel_component.nbcl" as panel_component { * }
Window "ewwii_panel" { Window "ewwii_panel" {
monitor = 0 monitor = 0
windowtype = "dock" windowtype = "dock"
wm_ignore = false wm_ignore = true
stacking = "fg" stacking = "fg"
geometry = { geometry = {
anchor = "top center" anchor = "top center"

View File

@ -6,6 +6,6 @@ Poll "time_hhmm" {
Poll "date_ddM" { Poll "date_ddM" {
initial = "01 Jan" initial = "01 Jan"
interval = "450ms" interval = "5s"
cmd = "date +'%d %b'" cmd = "date +'%d %b'"
} }

View File

@ -5,6 +5,6 @@
background-color: rgba(72, 150, 98, 0.733); background-color: rgba(72, 150, 98, 0.733);
padding: 0 0.2em; padding: 0 0.2em;
font-size: 14px; font-size: 14px;
font-family: "JetBrainsMono Nerd Font,JetBrainsMono NF"; font-family: "Fragment Mono";
} }
} }