nixos/modules/home/ags/app/widget/Clock.tsx

11 lines
281 B
TypeScript

import GLib from "gi://GLib"
import { Variable, bind } from "astal"
const time = Variable("").poll(1000, () =>
GLib.DateTime.new_now_local().format("%I:%M %p")!.replace(/^0/, "")
)
export default function Clock() {
return <label className="clock" label={bind(time)} />
}