PowerToys icon indicating copy to clipboard operation
PowerToys copied to clipboard

Add FancyZones CLI for command-line layout management

Open lei9444 opened this issue 3 weeks ago • 2 comments

Summary of the Pull Request

Adds a new command-line interface (CLI) tool for FancyZones, enabling users and automation scripts to manage window layouts without the GUI.

Commands:

Command Aliases Description
open-editor editor, e Launch FancyZones layout editor
get-monitors monitors, m List all monitors and their properties
get-layouts layouts, ls List all available layouts with ASCII art preview
get-active-layout active, a Show currently active layout
set-layout <uuid> set, s Apply layout by UUID or template name
open-settings settings Open FancyZones settings page
get-hotkeys hotkeys, hk List all layout hotkeys
set-hotkey <key> <uuid> shk Assign hotkey (0-9) to custom layout
remove-hotkey <key> rhk Remove hotkey assignment

Key Capabilities:

  • ASCII art visualization of layouts (grid, focus, priority-grid, canvas)
  • Support for both template layouts and custom layouts
  • Monitor-specific layout targeting (--monitor N or --all)
  • Real-time notification to FancyZones via Windows messages
  • Native AOT compilation support for fast startup

Example Usage

# List all layouts with visual previews
FancyZonesCLI.exe ls

# Apply "columns" template to all monitors
FancyZonesCLI.exe s columns --all

# Set custom layout on monitor 2
FancyZonesCLI.exe s {uuid} --monitor 2

# Assign hotkey Win+Ctrl+Alt+3 to a layout
FancyZonesCLI.exe shk 3 {uuid}

https://github.com/user-attachments/assets/2b141399-a4ca-4f64-8750-f123b7e0fea7

PR Checklist

  • [ ] Closes: #xxx
  • [ ] Communication: I've discussed this with core contributors already. If the work hasn't been agreed, this work might be rejected
  • [ ] Tests: Added/updated and all pass
  • [ ] Localization: All end-user-facing strings can be localized
  • [ ] Dev docs: Added/updated
  • [ ] New binaries: Added on the required places
  • [ ] Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx

Detailed Description of the Pull Request / Additional comments

Validation Steps Performed

lei9444 avatar Dec 04 '25 13:12 lei9444

/azp run

lei9444 avatar Dec 08 '25 02:12 lei9444

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Dec 08 '25 02:12 azure-pipelines[bot]