Files
ags/widget/modules/Time/Time.tsx
T
2025-03-14 13:00:59 +07:00

15 lines
368 B
TypeScript

import { Variable, GLib } from "astal";
export default function Time({ format = "%A %e, %H:%M" }) {
const time = Variable<string>("").poll(
1000,
() => GLib.DateTime.new_now_local().format(format)!,
);
return (
<button className="Time" onClicked="swaync-client -t">
<label onDestroy={() => time.drop()} label={time()} />
</button>
);
}