added datetime widget

This commit is contained in:
2025-03-05 16:10:57 +01:00
parent f317651505
commit e47c4ff387
5 changed files with 24 additions and 1 deletions

View File

@@ -46,7 +46,7 @@
:space-evenly false
:spacing 5
:halign 'end'
(loremText :text "Bar stuff")
(datetime)
)
)

View File

@@ -1,2 +1,3 @@
@import 'widgets/media';
@import 'widgets/datetime.scss';
@import 'widgets/lorem-text';

View File

@@ -1,2 +1,3 @@
(include "widgets/media.yuck")
(include "widgets/datetime.yuck")
(include "widgets/lorem-text.yuck")

View File

@@ -0,0 +1,4 @@
.datetime {
background: #2E3440;
color: #E5E6E7;
}

View File

@@ -0,0 +1,17 @@
(defwidget datetime []
(box :class "datetime"
:halign "center"
:valign "center"
{ time == ''
? ''
: time
}
)
)
(defvar time-visible false)
(defpoll time :interval "1s"
:initial "initial-value" ; optional, defaults to poll at startup
:run-while time-visible ; optional, defaults to 'true'
`date +"%H:%M - %a, %d %b"` ; https://www.man7.org/linux/man-pages/man1/date.1.html
)