import app from "ags/gtk4/app" import { Astal, Gtk, Gdk } from "ags/gtk4" import { execAsync } from "ags/process" interface SysButtonProps { icon: string label: string command: string } function SysButton({ icon, label, command }: SysButtonProps) { return ( ) } export default function PowerMenu(gdkmonitor: Gdk.Monitor) { return ( { // Allow closing the menu with the Escape key const controller = new Gtk.EventControllerKey() controller.connect("key-pressed", (_, keyval) => { if (keyval === 65307) { // 65307 is the keysym for Escape win.set_visible(false) } }) win.add_controller(controller) }} > ) }