diff --git a/widget/System.tsx b/widget/System.tsx new file mode 100644 index 0000000..145ed8c --- /dev/null +++ b/widget/System.tsx @@ -0,0 +1,55 @@ +import { Gtk } from "ags/gtk4" +import { createPoll } from "ags/time" +import AstalTray from "gi://AstalTray?version=0.1" +import { createBinding, For } from "ags" + +export function Clock() { + const time = createPoll("...", 1000, () => { + const date = new Date() + return date.toLocaleString([], { + weekday: "short", + month: "short", + day: "numeric", + hour: "2-digit", + minute: "2-digit", + }) + }) + + return ( + + + ) +} + +function TrayItem({ item }: { item: any }) { + // Bind icon, tooltip, and menu model dynamically to the AstalTray item + return ( + { + w.insert_action_group("dbusmenu", item.action_group) + }} + > + + + ) +} + +export function SysTray() { + const tray = AstalTray.Tray.get_default() + + return ( + + + {(item: any) => } + + + ) +}