import { Astal, Gdk } from "ags/gtk4";
import app from "ags/gtk4/app"
import Gtk from "gi://Gtk?version=4.0"
import { createBinding, createState } from "ags"
import Tray from "gi://AstalTray";
import { execAsync } from "ags/process"
import Hyprland from "gi://AstalHyprland";
import { getIconName } from "./utils";
import Wp from "gi://AstalWp"
import Battery from "gi://AstalBattery"
const battery = Battery.get_default()
const sensorsAvailable = await execAsync(['sensors']).then(() => true).catch(() => false);
const wirePlumber = Wp.get_default();
function SysTray(): JSX.Element {
const tray = Tray.get_default();
return (
{createBinding(tray, "items").as((items) =>
items.map((item) => {
if (item.iconThemePath) app.add_icons(item.iconThemePath);
return (
["dbusmenu", ag])}
menuModel={createBinding(item, "menuModel")}>
{/* */}
);
}),
)}
);
}
function Left(): JSX.Element {
return (
);
}
function Center(): JSX.Element {
return (
);
}
function Date({ format = "%Y-%m-%d" }): JSX.Element {
const time = createState("").poll(60000, () =>
GLib.DateTime.new_now_local().format(format)!)
return