package dependency: libdbusmenu-gtk3
added: (busName: string) emitted when a new TrayItem is addedremoved: (busName: string) emitted when a TrayItem is removeditems: TrayItem[]getItem: (busName: string) => TrayItemchanged: emitted on any change of the TrayItemremoved: (busName: string) emitted when this TrayItem is removedmenu: Gtk.Menu |
undefinedcategory: string possible values: ApplicationStatus, Communications,
SystemServices, Hardwareid: stringtitle: stringstatus: string possible values: Passive, Active, NeedsAttentionwindow-id: numberis-menu: boolean if true, showing the menu is preferred over activatetooltip-markup: stringicon: string | GdkPixbuf.Pixbufactivate: (event: Gdk.Event) => voidsecondaryActivate: (event: Gdk.Event) => voidscroll: (event: Gdk.EventScroll) => voidopenMenu: (event: Gdk.Event) => voidconst systemtray = await Service.import("systemtray");
/** @param {import('types/service/systemtray').TrayItem} item */
const SysTrayItem = (item) =>
Widget.Button({
child: Widget.Icon().bind("icon", item, "icon"),
tooltipMarkup: item.bind("tooltip_markup"),
onPrimaryClick: (_, event) => item.activate(event),
onSecondaryClick: (_, event) => item.openMenu(event),
});
const sysTray = Widget.Box({
children: systemtray.bind("items").as((i) => i.map(SysTrayItem)),
});