System Tray
signals
added:(busName: string)emitted when a new TrayItem is addedremoved:(busName: string)emitted when a TrayItem is removed
properties
items:TrayItem[]
methods
getItem:(busName: string) => TrayItem
TrayItem
signals
changed: emitted on any change of the TrayItemremoved:(busName: string)emitted when this TrayItem is removed
properties
menu: Gtk.Menu |undefinedcategory:stringpossible values:ApplicationStatus,Communications,SystemServices,Hardwareid:stringtitle:stringstatus:stringpossible values:Passive,Active,NeedsAttentionwindow-id:numberis-menu:booleanif true, showing the menu is preferred over activatetooltip-markup:stringicon:string | GdkPixbuf.Pixbuf
methods
activate:(event: Gdk.Event) => voidsecondaryActivate:(event: Gdk.Event) => voidscroll:(event: Gdk.EventScroll) => voidopenMenu:(event: Gdk.Event) => void
Example Widget
const 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))})