import { App, Astal, Gdk, Gtk, Widget } from "astal/gtk3";
import { GLib, Variable, bind } from "astal";
import Tray from "gi://AstalTray";
import { execAsync } from "astal/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 (
{bind(tray, "items").as((items) =>
items.map((item) => {
if (item.iconThemePath) App.add_icons(item.iconThemePath);
return (
["dbusmenu", ag])}
menuModel={bind(item, "menuModel")}>
);
}),
)}
);
}
function Left() : JSX.Element {
return (
);
}
function Center() : JSX.Element {
return (
);
}
function Date({ format = "%Y-%m-%d" }): JSX.Element {
const time = Variable("").poll(60000, () =>
GLib.DateTime.new_now_local().format(format)!)
return