Skip to content

System Tray

import { Aside } from “@astrojs/starlight/components”; import TypeSignature from “@components/TypeSignature.astro”;

<TypeSignature typeName={ “SystemTrayItemPixmap” } typePrefix={ “class” } typeArgList={ “(width: int | None = None, height: int | None = None, data: bytearray | None = None)” }> SystemTrayItemPixmap

Bases: NamedTuple

A class for storing image data associated with a tray item

Create new instance of SystemTrayItemPixmap(width, height, data)

<TypeSignature typeName={ “width” } typePrefix={ “attribute” } returnType={ “int | None” }> width

icon width size in pixels

<TypeSignature typeName={ “height” } typePrefix={ “attribute” } returnType={ “int | None” }> height

icon height size in pixels

<TypeSignature typeName={ “data” } typePrefix={ “attribute” } returnType={ “bytearray | None” }> data

the actual data representing this icon

<TypeSignature typeName={ “as_pixbuf” } typePrefix={ “def” } typeArgList={ “(size: int | None = None, resize_method: Literal[‘hyper’, ‘bilinear’, ‘nearest’, ‘tiles’] = ‘nearest’)” } returnType={ “Pixbuf | None” }> as_pixbuf

Load a Pixbuf variant of this pixmap

  • Returns: the newly created pixbuf in which it has the contents of this pixmap
  • Return type: GdkPixbuf.Pixbuf | None

<TypeSignature typeName={ “SystemTrayItemToolTip” } typePrefix={ “class” } typeArgList={ “(icon_name: str | None = None, icon_pixmap: SystemTrayItemPixmap | None = None, title: str | None = None, description: str | None = None)” }> SystemTrayItemToolTip

Bases: NamedTuple

A class for storing tooltip data associated with a tray item

Create new instance of SystemTrayItemToolTip(icon_name, icon_pixmap, title, description)

<TypeSignature typeName={ “icon_name” } typePrefix={ “attribute” } returnType={ “str | None” }> icon_name

free-desktop compliant name for an icon

<TypeSignature typeName={ “icon_pixmap” } typePrefix={ “attribute” } returnType={ “SystemTrayItemPixmap | None” }> icon_pixmap

icon data as a pixmap

<TypeSignature typeName={ “title” } typePrefix={ “attribute” } returnType={ “str | None” }> title

title for this tooltip

<TypeSignature typeName={ “description” } typePrefix={ “attribute” } returnType={ “str | None” }> description

descriptive text for this tooltip. It can contain also a subset of the HTML markup language

<TypeSignature typeName={ “SystemTrayItem” } typePrefix={ “class” } typeArgList={ “(proxy: DBusProxy, **kwargs)” }> SystemTrayItem

Bases: Service

A system tray item that implements the FDO’s StatusNotifierItem interface (see https://www.freedesktop.org/wiki/Specifications/StatusNotifierItem)

Default service constructor (base constructor)

  • Parameters: **kwargs

    mapped to signal connections (e.g. on_clicked=lambda *_: … connects the given function to the signal “clicked”, notify_my_property=my_func connects the given function to the signal “notify::my-property”)

<TypeSignature typeName={ “changed” } typePrefix={ “signal” } typeArgList={ “(self)” } returnType={ “NoneType” }> changed

<TypeSignature typeName={ “removed” } typePrefix={ “signal” } typeArgList={ “(self)” } returnType={ “NoneType” }> removed

<TypeSignature typeName={ “get_preferred_icon_pixbuf” } typePrefix={ “def” } typeArgList={ “(size: int | None = None, resize_method: Literal[‘hyper’, ‘bilinear’, ‘nearest’, ‘tiles’] | InterpType = GdkPixbuf.InterpType.BILINEAR)” } returnType={ “Pixbuf | None” }> get_preferred_icon_pixbuf

Query a Pixbuf of this item’s icon based on a preferred size

  • Parameters:
    • size (int | None , optional) — the preferred size to look up using in the list of given icons (by the application), defaults to None
    • resize_method (Literal [ “hyper” , “bilinear” , “nearest” , “tiles” ] | GdkPixbuf.InterpType , optional) — the way we should resize this Pixbuf, defaults to GdkPixbuf.InterpType.BILINEAR
  • Returns: the newly loaded Pixbuf object (resized to the given size)
  • Return type: GdkPixbuf.Pixbuf | None

<TypeSignature typeName={ “id” } typePrefix={ “property” } returnType={ “int” }> id

An identifier integer given by the application

  • Returns: the id integer
  • Return type: int

<TypeSignature typeName={ “identifier” } typePrefix={ “property” } returnType={ “str” }> identifier

The local identifer of this tray item, based on the dbus of the owner application

  • Returns: the local identifer
  • Return type: str

<TypeSignature typeName={ “title” } typePrefix={ “property” } returnType={ “str” }> title

The title of the application that owns this tray item

  • Returns: the application’s title
  • Return type: str

<TypeSignature typeName={ “status” } typePrefix={ “property” } returnType={ “Literal[‘passive’, ‘active’, ‘unknown’]” }> status

A string representing this item’s application status

  • Returns: this item’s application status, “passive” means it can be considered “idle” and holding no important message, “active” means it is important that this item should get displayed to the user (e.g. time sensitive status), and finally “unknown”, which infers the inability to get the status (e.g. not provided at all)
  • Return type: str

<TypeSignature typeName={ “category” } typePrefix={ “property” } returnType={ “Literal[‘application-status’, ‘communications’, ‘system-services’, ‘hardware’, ‘unknown’]” }> category

This item’s category

  • Returns: description
  • Return type: str

<TypeSignature typeName={ “window_id” } typePrefix={ “property” } returnType={ “int” }> window_id

<TypeSignature typeName={ “icon_theme_path” } typePrefix={ “property” } returnType={ “str” }> icon_theme_path

<TypeSignature typeName={ “icon_theme” } typePrefix={ “property” } returnType={ “IconTheme” }> icon_theme

<TypeSignature typeName={ “icon_name” } typePrefix={ “property” } returnType={ “str” }> icon_name

<TypeSignature typeName={ “icon_pixmap” } typePrefix={ “property” } returnType={ “SystemTrayItemPixmap” }> icon_pixmap

<TypeSignature typeName={ “overlay_icon_name” } typePrefix={ “property” } returnType={ “str” }> overlay_icon_name

<TypeSignature typeName={ “overlay_icon_pixmap” } typePrefix={ “property” } returnType={ “SystemTrayItemPixmap” }> overlay_icon_pixmap

<TypeSignature typeName={ “attention_icon_name” } typePrefix={ “property” } returnType={ “str” }> attention_icon_name

<TypeSignature typeName={ “attention_icon_pixmap” } typePrefix={ “property” } returnType={ “SystemTrayItemPixmap” }> attention_icon_pixmap

<TypeSignature typeName={ “tooltip” } typePrefix={ “property” } returnType={ “SystemTrayItemToolTip” }> tooltip

<TypeSignature typeName={ “is_menu” } typePrefix={ “property” } returnType={ “bool” }> is_menu

<TypeSignature typeName={ “menu_object_path” } typePrefix={ “property” } returnType={ “str” }> menu_object_path

<TypeSignature typeName={ “menu” } typePrefix={ “property” } returnType={ “Menu” }> menu

<TypeSignature typeName={ “context_menu” } typePrefix={ “def” } typeArgList={ “(x: int, y: int)” } returnType={ “None” }> context_menu

to open a server-side context menu

<TypeSignature typeName={ “activate” } typePrefix={ “def” } typeArgList={ “(x: int, y: int)” } returnType={ “None” }> activate

<TypeSignature typeName={ “secondary_activate” } typePrefix={ “def” } typeArgList={ “(x: int, y: int)” } returnType={ “None” }> secondary_activate

<TypeSignature typeName={ “invoke_menu_for_event” } typePrefix={ “def” } typeArgList={ “(event: Event)” } returnType={ “None” }> invoke_menu_for_event

<TypeSignature typeName={ “scroll” } typePrefix={ “def” } typeArgList={ “(delta: int, orientation: Literal[‘vertical’, ‘horizontal’])” } returnType={ “None” }> scroll

<TypeSignature typeName={ “context_menu_for_event” } typePrefix={ “def” } typeArgList={ “(event: EventAny)” } returnType={ “None” }> context_menu_for_event

<TypeSignature typeName={ “activate_for_event” } typePrefix={ “def” } typeArgList={ “(event: EventAny)” } returnType={ “None” }> activate_for_event

<TypeSignature typeName={ “secondary_activate_for_event” } typePrefix={ “def” } typeArgList={ “(event: EventAny)” } returnType={ “None” }> secondary_activate_for_event

<TypeSignature typeName={ “scroll_for_event” } typePrefix={ “def” } typeArgList={ “(event: EventScroll)” } returnType={ “None” }> scroll_for_event

<TypeSignature typeName={ “SystemTray” } typePrefix={ “class” } typeArgList={ ”(**kwargs)” }> SystemTray

Bases: Service

Default service constructor (base constructor)

  • Parameters: **kwargs

    mapped to signal connections (e.g. on_clicked=lambda *_: … connects the given function to the signal “clicked”, notify_my_property=my_func connects the given function to the signal “notify::my-property”)

<TypeSignature typeName={ “changed” } typePrefix={ “signal” } typeArgList={ “(self)” } returnType={ “NoneType” }> changed

<TypeSignature typeName={ “item_added” } typePrefix={ “signal” } typeArgList={ “(self, item_identifier: str)” } returnType={ “NoneType” }> item_added

<TypeSignature typeName={ “item_removed” } typePrefix={ “signal” } typeArgList={ “(self, item_identifier: str)” } returnType={ “NoneType” }> item_removed

<TypeSignature typeName={ “items” } typePrefix={ “property” } returnType={ “dict[str, SystemTrayItem]” }> items

Tray items held by this server

  • Returns: a dict that maps local identifers to tray item objects
  • Return type: dict[str, SystemTrayItem]

<TypeSignature typeName={ “add_item” } typePrefix={ “def” } typeArgList={ “(item: SystemTrayItem)” } returnType={ “None” }> add_item

<TypeSignature typeName={ “remove_item” } typePrefix={ “def” } typeArgList={ “(item: SystemTrayItem)” } returnType={ “None” }> remove_item