rusty_desktop_icons.AnimationHandle

class rusty_desktop_icons.AnimationHandle

Handle returned by [DesktopController.animate].

Cloneable and thread-safe: hand it to another Python thread that waits on completion while your main thread polls progress.

final_commit() → FinalCommitOutcome | None

Outcome of the Shell-side final commit, once the animation has finished. None while it is still running, or if finalization itself failed (in which case finish_reason() carries the error).

finish_reason() → FinishReason | None

Read the finish reason if the animation has already ended.

is_running() → bool

True while the animation is still ticking.

missing_icons() → list[str]

Ids listed in the spec but not present on the desktop at start.

on_finish(cb: Callable[[FinishReason], None]) → None
on_icon_complete(cb: Callable[[str], None]) → None
on_start(cb: Callable[[StartContext], None]) → None
on_tick(cb: Callable[[TickContext], None]) → None
progress() → float

Global progress ∈ [0, 1] (mean per-icon t).

snapshot() → list[IconAnimationState]

Copy of the current per-icon state.

stop(mode: StopMode | None = None) → None

Ask the engine to stop the animation.

mode defaults to [StopMode.LeaveInPlace]. This is the only way to alter a running animation — to change targets or the icon set, stop, read snapshot(), and call animate() again.

wait() → FinishReason

Block until the animation finishes. Releases the GIL while waiting.

wait_timeout(timeout_seconds: float) → FinishReason | None

Block for up to timeout_seconds. Returns None on timeout.