Window Management
API Reference
WindowManagement.getActiveWindow
Signature
async function getActiveWindow(): Promise<Window>;Example
import { WindowManagement, showToast } from "@raycast/api";
export default async function Command() {
try {
const window = await WindowManagement.getActiveWindow();
if (window.positionable) {
await WindowManagement.setWindowBounds({ id: window.id, bounds: { position: { x: 100 } } });
}
} catch (error) {
showToast({ title: `Could not move window: ${error.message}`, style: Toast.Style.Failure });
}
}Return
WindowManagement.getWindowsOnActiveDesktop
Signature
Example
Return
WindowManagement.getDesktops
Signature
Example
Return
WindowManagement.setWindowBounds
Signature
Example
Parameters
Name
Description
Type
Return
Types
WindowManagement.Window
Properties
Property
Description
Type
WindowManagement.Desktop
Properties
Property
Description
Type
WindowManagement.DesktopType
Enumeration members
Name
Description
Last updated

