TrayIconOptions
Module @netwiv/api/tray · Kind Interface
import { TrayIconOptions } from '@netwiv/api/tray';Members
Section titled “Members”action?
Section titled “action?”action?: ((event: TrayIconEvent) => void) | undefinedA handler for an event on the tray icon.
icon?: string | number[] | Image | ArrayBuffer | Uint8Array<ArrayBufferLike> | undefinedThe tray icon which could be icon bytes or path to the icon file.
Note that you may need the image-ico or image-png Cargo features to use this API.
To enable it, change your Cargo.toml file:
[dependencies]tauri = { version = "...", features = ["...", "image-png"] }iconAsTemplate?
Section titled “iconAsTemplate?”iconAsTemplate?: boolean | undefinedUse the icon as a template. macOS only.
id?: string | undefinedThe tray icon id. If undefined, a random one will be assigned
menu?: Menu | Submenu | undefinedmenuOnLeftClick?
Section titled “menuOnLeftClick?”menuOnLeftClick?: boolean | undefinedWhether to show the tray menu on left click or not, default is true.
Platform-specific:
Section titled “Platform-specific:”- Linux: Unsupported.
Deprecated use {@linkcode TrayIconOptions.showMenuOnLeftClick} instead.
showMenuOnLeftClick?
Section titled “showMenuOnLeftClick?”showMenuOnLeftClick?: boolean | undefinedWhether to show the tray menu on left click or not, default is true.
Platform-specific:
Section titled “Platform-specific:”- Linux: Unsupported.
tempDirPath?
Section titled “tempDirPath?”tempDirPath?: string | undefinedThe tray icon temp dir path. Linux only.
On Linux, we need to write the icon to the disk and usually it will
be $XDG_RUNTIME_DIR/tray-icon or $TEMP/tray-icon.
title?
Section titled “title?”title?: string | undefinedThe tray title
Platform-specific
Section titled “Platform-specific”- Linux: The title will not be shown unless there is an icon as well. The title is useful for numerical and other frequently updated information. In general, it shouldn’t be shown unless a user requests it as it can take up a significant amount of space on the user’s panel. This may not be shown in all visualizations.
- Windows: Unsupported.
tooltip?
Section titled “tooltip?”tooltip?: string | undefinedThe tray icon tooltip
Descriptions come from the pinned @tauri-apps/api@2.11.1 declarations (MIT OR Apache-2.0); imports are shown with @netwiv/api paths.