Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Tray

The icons apps put in a system tray, like Discord, Steam, Spotify or nm-applet. A tray bubble next to the island opens the drawer: every app’s icon and name on the island. Click an app to do what a click on its icon does, usually showing its window. Right-click it for its menu, drawn in Mochi’s style: entries with more open as a page of their own, and Escape or the back arrow goes up a level. The menu follows the app while it’s open: a checkmark the app flips, a label it renames or an entry it adds shows at once, on the page you’re on. A middle click does the app’s second action.

The keyboard works in the drawer too: the arrows move between the apps, Enter activates one, and Shift+Enter or the Menu key opens its menu. In a menu, Up and Down move between the entries, skipping separators, Enter or Right picks one, and Left goes back up. The app under the pointer or the arrows shows its tooltip under the apps, like Discord’s unread count; a pinned bubble shows it beside itself when the pointer rests on it.

Apps listed in pinned also get a bubble of their own, which takes the same clicks and the scroll wheel, the way some apps change the volume or the track. An app asking for attention makes its bubble, or the tray bubble, breathe in the accent color, and marks it in the drawer. Icons their app marks as passive, unimportant for now, stay in the drawer, dimmed.

# Tray: apps' tray icons, like Discord, Steam or nm-applet. A bubble opens
# the drawer with every app; a right click shows an app's menu.
[module.tray]
# Apps with a bubble of their own next to the drawer's.
# pinned = []
# Apps never shown.
# hidden = []
# Old X11 tray icons (XEmbed), like Wine's: Mochi starts KDE's
# xembedsniproxy for them when it's installed and not running already.
# xembed = true

[bubbles.tray] moves the bubbles, like any module’s.

How it works

Apps register their icons with a StatusNotifierWatcher over D-Bus, and Mochi reads the menu through DBusMenu. While a menu is open, Mochi listens for the app’s LayoutUpdated and ItemsPropertiesUpdated signals and reads the whole menu again after each burst of them. Mochi serves the watcher. Only one program can: if another tray already does, like Waybar’s, Mochi shows the icons that tray collects instead. Apps that only speak the old XEmbed tray, like Wine’s and some games, show through KDE’s xembedsniproxy, which turns their icons into StatusNotifierItems: Mochi starts it when it’s installed, an X server runs and no other copy does, and stops it with the module. xembed = false leaves it alone. Without it, those icons don’t show.

Icons come from the icon theme, from the app’s own icon folder, or from the pixels the app sends, which Mochi writes as PNG files in its runtime directory.

ActionWhat it does
toggle, open, closeOpens or closes the drawer
listPrints each app’s key, name and state
activate <app>Does what a click on the app’s icon does
secondary <app>Does what a middle click does
scroll <app> <delta> [vertical|horizontal]Scrolls on the app’s icon; 120 is one notch
menu <app>Opens the app’s menu on the island
click <app> <entry>Clicks an entry of the open menu

<app> is the key list prints, usually the app’s id, or its name. The menu sends submenu itself, as a submenu opens, for apps that fill it only then.