System Tray#
- class ignis.services.system_tray.SystemTrayService(*args: Any, **kwargs: Any)#
A system tray, where application icons are placed.
- Raises:
AnotherSystemTrayRunningError -- If another system tray is already running.
Example usage:
from ignis.services.system_tray import SystemTrayService system_tray = SystemTrayService.get_default() system_tray.connect("added", lambda x, item: print(item.title))
- added(*args)#
Signal
Emitted when a new item is added.
- Parameters:
item (
SystemTrayItem
) -- The instance of the system tray item.
- property items: list[SystemTrayItem]#
read-only
A list of system tray items.
- class ignis.services.system_tray.SystemTrayItem(name: str, object_path: str)#
A system tray item.
- removed()#
Signal
Emitted when the item is removed.
- property icon: str | gi.repository.GdkPixbuf.Pixbuf | None#
read-only
The icon name or a
GdkPixbuf.Pixbuf
.
read-only
Whether the item has a menu.
read-only
A
DBusMenu
orNone
.Hint
To display the menu, add it to a container, and call the
.popup()
method on it.Warning
If you want to add
menu
to several containers (e.g., make two status bars with a system tray), you must call thecopy()
method to obtain a copy of the menu. This is necessary because you can't add a single widget to multiple containers.menu = item.menu.copy()
- property tooltip: str#
read-only
A tooltip, the text should be displayed when you hover cursor over the icon.
- activate(x: int = 0, y: int = 0) None #
Activate the application. Usually this causes an application window to appear.
- secondary_activate(x: int = 0, y: int = 0) None #
Activate a secondary and less important action compared to
activate()
.
Ask the item to show a context menu.