refactor!: start migration to latest ags

This commit is contained in:
2025-12-05 17:00:22 -08:00
parent 1759e2d976
commit 42b4f99c37
12 changed files with 191 additions and 147 deletions

View File

@@ -1,15 +1,24 @@
import { bind, GLib, Variable } from "astal"
// let current_time = Variable(GLib.DateTime.new_now_local().format("%H:%M"))
// GLib.timeout_add(GLib.PRIORITY_DEFAULT, 1000, () => {
// const now = GLib.DateTime.new_now_local()
// current_time.set(now.format("%b %e (%a) %H:%M"))
// return true
let current_time = Variable(GLib.DateTime.new_now_local().format("%H:%M"))
GLib.timeout_add(GLib.PRIORITY_DEFAULT, 1000, () => {
const now = GLib.DateTime.new_now_local()
current_time.set(now.format("%b %e (%a) %H:%M"))
return true
})
import { createPoll } from "ags/time"
// })
export default function Time() {
const time = createPoll("", 500, () => {
return new Date().toLocaleString(undefined, {
hour12: false
})
})
return <box className="status-box">
<label label={bind(current_time)} />
return <box class="status-box">
<label label={time} />
</box>
// return <box class="status-box">
// <label label={bind(current_time)} />
// </box>
}