Last Updated: 3/12/2026
hyprctl CLI
hyprctl is Hyprland’s command-line control tool. It communicates with the running Hyprland instance via IPC, allowing you to query state, execute commands, and automate workflows.
Basic Usage
hyprctl [command] [arguments]All commands require a running Hyprland session. hyprctl connects to the active instance’s socket automatically.
Common Commands
Query System State
List active windows:
hyprctl clientsReturns JSON with window details: class, title, workspace, position, size, and more.
List workspaces:
hyprctl workspacesShows all workspaces with window counts and active status.
Get active window:
hyprctl activewindowReturns details about the currently focused window.
Monitor information:
hyprctl monitorsLists all connected monitors with resolution, refresh rate, and active workspace.
Current config values:
hyprctl getoption general:gaps_in
hyprctl getoption decoration:roundingQuery any config option by its path.
Execute Commands
Dispatch actions:
hyprctl dispatch exec kitty # Launch application
hyprctl dispatch workspace 3 # Switch to workspace 3
hyprctl dispatch movetoworkspace 5 # Move active window to workspace 5
hyprctl dispatch togglefloating # Toggle floating mode
hyprctl dispatch fullscreen # Toggle fullscreen
hyprctl dispatch killactive # Close active windowThe dispatch subcommand executes any action available in keybindings.
Reload configuration:
hyprctl reloadReloads ~/.config/hypr/hyprland.conf. Useful for testing config changes programmatically.
Set config options at runtime:
hyprctl keyword general:gaps_in 10
hyprctl keyword decoration:rounding 15Changes take effect immediately but are not persisted to the config file.
Workspace Management
Create and switch to a workspace:
hyprctl dispatch workspace 5Move window to workspace without switching:
hyprctl dispatch movetoworkspacesilent 3Cycle through workspaces:
hyprctl dispatch workspace e+1 # Next workspace
hyprctl dispatch workspace e-1 # Previous workspaceWindow Management
Move focus:
hyprctl dispatch movefocus l # Left
hyprctl dispatch movefocus r # Right
hyprctl dispatch movefocus u # Up
hyprctl dispatch movefocus d # DownMove windows:
hyprctl dispatch movewindow l # Move window left
hyprctl dispatch movewindow r # Move window rightResize windows:
hyprctl dispatch resizeactive 20 0 # Resize width +20px
hyprctl dispatch resizeactive 0 -20 # Resize height -20pxPlugin Management
List loaded plugins:
hyprctl plugin listLoad a plugin:
hyprctl plugin load /path/to/plugin.soUnload a plugin:
hyprctl plugin unload plugin-nameOutput Formats
By default, hyprctl returns human-readable output. For scripting, use JSON:
hyprctl clients -j
hyprctl workspaces -j
hyprctl monitors -jScripting Examples
Focus window by class
#!/bin/bash
# Focus the first Firefox window
hyprctl dispatch focuswindow "class:firefox"Move all windows from workspace 1 to workspace 2
#!/bin/bash
for window in $(hyprctl clients -j | jq -r '.[] | select(.workspace.id == 1) | .address'); do
hyprctl dispatch movetoworkspacesilent 2,address:$window
doneToggle between two workspaces
#!/bin/bash
current=$(hyprctl activeworkspace -j | jq -r '.id')
if [ "$current" -eq 1 ]; then
hyprctl dispatch workspace 2
else
hyprctl dispatch workspace 1
fiIPC Socket
hyprctl communicates via a Unix socket. The socket path is:
/tmp/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket.sockYou can interact with the socket directly using tools like socat or nc for advanced use cases.
Batch Commands
Execute multiple commands in sequence:
hyprctl --batch "dispatch workspace 3; dispatch exec kitty; dispatch togglefloating"Commands are separated by semicolons.
Debugging and Inspection
Get Hyprland version:
hyprctl versionList all available dispatch commands:
hyprctl dispatch -- --helpGet full system info:
hyprctl systeminfoReturns detailed information about Hyprland’s build, dependencies, and runtime environment.
Common Use Cases
- Automate window placement: Use
hyprctlin startup scripts to position windows - Dynamic workspace switching: Build custom workspace switchers
- Monitor configuration: Query monitor state and adjust layouts
- Plugin development: Test plugin behavior interactively
- Config testing: Apply temporary config changes without editing files
Tips
- Use
-jfor JSON output in scripts - Combine with
jqfor powerful JSON parsing - Test
dispatchcommands interactively before adding them to keybindings - Check
hyprctl --helpfor the full command list
What’s Next
- Window Rules: Automatically control window behavior with rules