From 434128e6e1b609ee8c708f7d49c4c90aa84aa2a6 Mon Sep 17 00:00:00 2001 From: Pascal Thuma Date: Tue, 24 Mar 2026 20:01:26 +0100 Subject: [PATCH] Added systemtray widget --- widget/System.tsx | 55 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 widget/System.tsx 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) => } + + + ) +}