Skip to content

🖥️ Window & Interaction Management

Desktop lyrics overlay, Mini Player, main window control, system tray status synchronization.


Desktop Lyrics (ctx.desktopLyric)

Control the desktop lyrics overlay window.

APIReturnsDescription
getSnapshot()Promise<Snapshot>Get current lyrics state
show() / hide()Promise<Snapshot>Show / hide
toggleLock()Promise<Snapshot>Toggle lock state
updateSettings(s)Promise<Snapshot>Update lyrics settings
onSnapshot(fn)Cancel functionSubscribe to state changes
command(cmd)voidSend a command
setIgnoreMouseEvents(bool)voidToggle click-through
js
ctx.desktopLyric.show();
ctx.desktopLyric.onSnapshot((snap) => {
  console.log("Lyrics visible:", snap.visible, "Locked:", snap.locked);
});

Mini Player (ctx.miniPlayer)

Control the Mini Player window.

APIReturnsDescription
getSnapshot()Promise<Snapshot>Get current state
show() / hide() / toggle()Promise<Snapshot>Show / hide / toggle
setExpanded(bool)Promise<Snapshot>Expand / collapse
setAlwaysOnTop(bool)Promise<Snapshot>Toggle always-on-top
getBounds()Promise<{x,y,w,h}>Window position and size
move(x, y)voidMove the window
applyExpandBounds()Promise<Snapshot>Apply expanded bounds
onSnapshot(fn)Cancel functionSubscribe to state
onCommand(fn)Cancel functionListen for commands
notifyLyricVisibility(bool)voidNotify lyric visibility
onLyricVisibility(fn)Cancel functionLyric visibility change
command(cmd)voidSend a command
js
ctx.miniPlayer.show();
ctx.miniPlayer.setAlwaysOnTop(true);
ctx.miniPlayer.setExpanded(true);

Window Control (ctx.windowControl)

Manipulate the window state of the current window.

js
ctx.windowControl("minimize");   // Minimize
ctx.windowControl("maximize");   // Maximize
ctx.windowControl("close");      // Close
ctx.windowControl("fullscreen"); // Fullscreen

Only available in the main window and Mini Player.


System Tray (ctx.tray)

APIDescription
syncPlayback(state)Sync playback state to the tray ({ isPlaying, playMode, volume })
onSetPlayMode(fn)Listen for tray play mode switch