Creating a Custom Action
Custom actions are created in the Keybinds settings tab:- Click Add to create a new keybind
- Select the action dropdown and choose Custom
- Configure the position, size, and units
- Assign a keyboard shortcut (optional)
- Give your action a descriptive name (optional)
WindowAction Structure
Custom actions are represented by theWindowAction struct with specific properties:
source/Loop/Window Management/Window Action/WindowAction.swift:15
Units
Custom actions support two unit types for measurements:Pixels
Absolute pixel measurements for precise control:Percentage
Relative measurements based on screen size:source/Loop/Window Management/Window Action/Custom Window Sizes/CustomWindowActionUnit.swift:10
Position Modes
Control how your custom action positions windows:Generic Mode
Use predefined anchors to position the window:source/Loop/Window Management/Window Action/Custom Window Sizes/CustomWindowActionPositionMode.swift:10
Coordinates Mode
Specify exact x and y coordinates for precise positioning:- xPoint - Horizontal position from the left edge
- yPoint - Vertical position from the top edge
Anchors
When using generic position mode, anchors determine where your window is positioned:source/Loop/Window Management/Window Action/Custom Window Sizes/CustomWindowActionAnchor.swift:11
Anchor Visualizations
Each anchor corresponds to a built-in window action for easy visualization:- topLeft → Top Left Quarter
- top → Top Half
- topRight → Top Right Quarter
- right → Right Half
- bottomRight → Bottom Right Quarter
- bottom → Bottom Half
- bottomLeft → Bottom Left Quarter
- left → Left Half
- center → Center
- macOSCenter → macOS Center
Size Modes
Control how the window size is determined:source/Loop/Window Management/Window Action/Custom Window Sizes/CustomWindowActionSizeMode.swift:10
Custom
Use the width and height values you specify.Preserve Size
Keep the window’s current size and only change its position. Perfect for moving windows between screens or to specific locations without resizing.When using Preserve Size or Initial Size modes, padding will not be applied to the action.
Initial Size
Restore the window to its original size before Loop modified it, but position it according to your anchor or coordinates.Example Custom Actions
Sidebar Window (Left)
A narrow sidebar on the left side of the screen:- Unit: Pixels
- Position Mode: Generic
- Anchor: Left
- Size Mode: Custom
- Width: 400px
- Height: 100% (in percentage)
Center Floating Window
A centered window with specific dimensions:- Unit: Pixels
- Position Mode: Generic
- Anchor: Center
- Size Mode: Custom
- Width: 1200px
- Height: 800px
Top-Right Note Window
Small note window in the top-right corner:- Unit: Pixels
- Position Mode: Coordinates
- X Point: Screen width - 320px
- Y Point: 80px (below menu bar)
- Size Mode: Custom
- Width: 300px
- Height: 400px
Two-Thirds Center
Larger center window using percentages:- Unit: Percentage
- Position Mode: Generic
- Anchor: Center
- Size Mode: Custom
- Width: 66.67%
- Height: 100%
Move to Center (Preserve Size)
Move current window to center without resizing:- Position Mode: Generic
- Anchor: Center
- Size Mode: Preserve Size
Custom Cycles
You can create cycle actions that rotate through multiple custom actions:- First press: Left half
- Second press: Right two-thirds
- Third press: Full screen
- Fourth press: Back to left half
Padding and Custom Actions
Padding is applied to custom actions based on the size mode:source/Loop/Window Management/Window Action/WindowAction.swift:168
- Custom size mode: Padding is applied
- Preserve Size: No padding
- Initial Size: No padding
Naming Custom Actions
Give your custom actions descriptive names to easily identify them:Use Cases
Ultra-Wide Monitor Layouts
Create custom sections for ultra-wide monitors:- Left third: 33.33% width, left anchor
- Center half: 50% width, center anchor
- Right third: 33.33% width, right anchor
Vertical Monitor Layouts
Optimize for vertical/portrait displays:- Top half: 100% width, 50% height, top anchor
- Bottom half: 100% width, 50% height, bottom anchor
- Reading pane: 80% width, 100% height, center anchor
Multi-Monitor Workflows
Create position presets for different screens in your multi-monitor setup, then use screen switching actions to move windows between them.App-Specific Layouts
Design custom window sizes for specific applications:- Code editor: 70% width on left
- Browser: 30% width on right
- Terminal: Bottom strip, 100% width × 30% height