Works on Mac and Linux
You can easily set the counter using the setBadgeCount
method.
window.todesktop.app.setBadgeCount(2);
Works on Mac only
On mac, you have the option to set the set the dock badge to any text you like.
window.todesktop.app.dock.setBadge("đđ Hello");
Work on Mac only
Bouncing the dock icon has two modes: critical
and informational
. If no parameters are used then the default is informational
.
informational
â the dock icon will bounce once (for a duration of one second)
critical
â the dock icon will bounce until either the application becomes active or the request is canceled
// Bounce the dock icon oncewindow.todesktop.app.dock.bounce('informational');â// Bounce the dock icon for 5 secondsconst cancelBounceId = window.todesktop.app.dock.bounce('critical');setTimeout(() => {window.todesktop.app.dock.cancelBounce(cancelBounceId);}, 5000);
Works on all platforms (Windows, Mac and Linux). On Linux, only the Unity desktop environment is supported.
// Set progress bar to 75%window.todesktop.window.setProgressBar(0.75)â// Set progress bar to intermediate mode. Any value// greater than `1` will trigger intermediate modewindow.todesktop.window.setProgressBar(2)â// Remove progress bar. Any value less than `0`// will remove the progress barwindow.todesktop.window.setProgressBar(-1)â// Set progress bar to 75% in error mode (Windows only)window.todesktop.window.setProgressBar(0.75, {// Progress bar modes are only available on Windows.// Available modes are: 'indeterminate', 'error', and 'paused'.mode: 'error'})
We made a quick video that puts all the methods together. It's just a bit of fun and not very practical but we hope you enjoy it as much as we enjoyed making it (headphones recommended):
â