Tray Module

type = internal/tray

New in version 3.7.0 (unreleased).

The tray module displays system tray application icons on the bar.

This module is a bit different from the other modules. The tray icons (also called clients) are individual windows managed by their respective application (e.g. the Dropbox tray icon is created and managed by the Dropbox application). Polybar is only responsible for embedding the windows in the bar and positioning them correctly.


Only a single instance of this module can be active at the same time (across all polybar instances).

The way the system tray protocol works, at most one tray can exist at any time. Polybar will produce a warning if additional tray instances are created.

For transparent background colors, the tray will use pseudo-transparency, true transparency is not possible for the tray icons.


The module only has a single format:

Available Tags:<tray>: Shows tray icons
Default Value:<tray>



Space added between tray icons

Type:extent, non-negative
Default Value:0px

Space added before and after each tray icon

Type:extent, non-negative
Default Value:0px

Size of individual tray icons

Type:percentage with offset, relative to bar height, non-negative
Default Value:66%

Background color of tray icons


This only affects the color of the individual icons and not the space in between, changing this setting to anything else than the bar background will likely not look good unless the background color is also changed for the rest of the tray module (e.g. with format-background).

Default Value:${root.background}

Tray icon color

This serves as a hint to the tray icon application for which color to use for the icon.

This is not guaranteed to have any effect (likely only in GTK3) because it targets a non-standard part of the system tray protocol by setting the _NET_SYSTEM_TRAY_COLORS atom on the tray window.

Default Value:${tray-foreground}


type = internal/tray

format-margin = 8px
tray-spacing = 8px

Migrating From Legacy Tray Implementation

Polybar version 3.7 introduced the new tray module and deprecated the legacy tray implementation which uses tray-position to position the tray. You should switch over to the tray module as soon as possible.

The legacy tray was configured in the bar section, the setting for the module live in that module's section of the config file. The settings in the bar section don't always directly correspond to an equivalent setting in the module section for the new tray module.

The following lists how each old setting in the bar section should be migrated:

The tray is now positioned as a module and so its positioning is done by placing it where you want it to appear in one of the three module lists modules-left, modules-center, modules-right.
This setting does not have an equivalent, detaching the tray is no longer possible.
The tray-size setting now determines the size of tray icons.
Was already deprecated and does not exist in the tray module. Transparency is enabled automatically if a transparent background is used.
Also exists in the module section (see tray-background). Now, the setting only applies to the icons themselves and no longer to the space around them.
Also exists in the module section with the same functionality (see tray-foreground).
tray-offset-x, tray-offset-y

Has no direct equivalent in the module settings. Horizontally, the tray can be moved in the same way other module content can be moved; by reordering the modules or using things like format-offset, format-margin, or format-padding. The tray can't be moved vertically.

In any case, the tray can no longer be moved outside of the bar window.

Spacing between tray icons works a bit different now and needs to be completely reconfigured (see tray-padding and tray-spacing).
No longer exist. The size of the icons is solely determined by tray-size.