Dock (macOS)

macOS-only. The dock namespace controls the app icon in the Dock: whether it's visible, what image it shows, and when the user clicks/activates it (relevant when all windows are hidden).

No-op on Windows and Linux. Safe to call — the promises resolve with success: false on other platforms rather than throwing, so you can keep the same code path.

Show / hide

Useful for menu-bar-only apps that spend most of their life in the tray with no visible windows:

await window.deskifier.dock.hide();     // remove from the dock
await window.deskifier.dock.show();     // put it back
const { visible } = await window.deskifier.dock.isVisible();

Custom icon

Swap the dock icon at runtime — useful for showing state (e.g. "unread" badge, "recording" indicator):

await window.deskifier.dock.setIcon({ iconPath: '/absolute/path/to/icon.png' });

Reactivation

macOS fires an "activate" event when the user clicks the dock icon while the app is already running. Deskifier surfaces it here so you can decide what to do — commonly: show the main window if all are hidden.

window.deskifier.dock.onAppActivated(({ hasVisibleWindows }) => {
  if (!hasVisibleWindows) {
    // reopen the main window
  }
});