Skip to content

ElectronDock

Unofficial

Performs actions on the app icon in the user’s dock on macOS.

Import:

import type { ElectronDock } from '@obsidian-typings/obsidian-catalyst-latest';

Signature:

export interface ElectronDock

Methods

Method Returns Description
bounce(type?) number Bounces the dock icon. When critical is passed, the icon bounces until the app becomes active or the request is canceled; when informational is passed, it bounces for one second. macOS only.
cancelBounce(id) void Cancels the bounce of the given request. macOS only.
downloadFinished(filePath) void Bounces the Downloads stack if the file path is inside the Downloads folder. macOS only.
getBadge() string Returns the badge string of the dock. macOS only.
getMenu() ElectronMenu | null Returns the application's dock menu. macOS only.
hide() void Hides the dock icon. macOS only.
isVisible() boolean Returns whether the dock icon is visible. macOS only.
setBadge(text) void Sets the string to be displayed in the dock's badging area. macOS only.
setIcon(image) void Sets the image associated with this dock icon. macOS only.
setMenu(menu) void Sets the application's dock menu. macOS only.
show() Promise<void> Shows the dock icon. macOS only.

Links to this page: