### Install Yashiki using Homebrew Source: https://github.com/typester/yashiki/blob/main/docs/quick-start.md Installs Yashiki and its CLI tools using the Homebrew package manager. Includes an option to skip the quarantine warning during installation. ```sh brew tap typester/yashiki brew install --cask yashiki ``` ```sh brew install --cask --no-quarantine yashiki ``` -------------------------------- ### Install Yashiki using Cargo Source: https://github.com/typester/yashiki/blob/main/docs/quick-start.md Installs the Yashiki core daemon and CLI tools, as well as optional layout engines like tatami and byobu, using the Cargo package manager. Requires Rust to be installed. ```sh # Core daemon and CLI carp install yashiki # Install the layout engines you want to use carp install yashiki-layout-tatami # Master-stack layout carp install yashiki-layout-byobu # Accordion layout ``` -------------------------------- ### Configure Multi-Monitor Navigation Source: https://github.com/typester/yashiki/blob/main/docs/quick-start.md Sets up keyboard shortcuts for switching focus between monitors and sending windows to the next monitor. These commands are essential for multi-display setups. ```shell yashiki bind alt-o output-focus next yashiki bind alt-shift-o output-send next ``` -------------------------------- ### Troubleshoot Hotkeys Not Working Source: https://github.com/typester/yashiki/blob/main/docs/quick-start.md Offers solutions for when configured hotkeys are unresponsive. Steps include verifying bindings, ensuring script executability, restarting Yashiki, and checking for system-level hotkey conflicts. ```shell yashiki list-bindings chmod +x ~/.config/yashiki/init yashiki quit ``` -------------------------------- ### Configure Window Focus and Layout Controls Source: https://github.com/typester/yashiki/blob/main/docs/quick-start.md Sets up keyboard shortcuts for navigating between windows and adjusting layout parameters like main ratio and count. These bindings facilitate efficient window management. ```shell yashiki bind alt-j window-focus next yashiki bind alt-k window-focus prev yashiki bind alt-h layout-cmd dec-main-ratio yashiki bind alt-l layout-cmd inc-main-ratio yashiki bind alt-comma layout-cmd inc-main-count yashiki bind alt-period layout-cmd dec-main-count ``` -------------------------------- ### Troubleshoot Windows Not Tiling Source: https://github.com/typester/yashiki/blob/main/docs/quick-start.md Provides steps to diagnose and resolve issues where windows are not automatically tiling. This includes verifying Yashiki is running, checking permissions, and manually retiling. ```shell yashiki list-windows yashiki retile ``` -------------------------------- ### Yashiki Configuration Example (`~/.config/yashiki/init`) Source: https://github.com/typester/yashiki/blob/main/README.md A sample shell script for configuring Yashiki, demonstrating how to set up layout engines, gaps, cursor warping, tag bindings, window focus, and multi-monitor controls. This script is executed when the Yashiki daemon starts. ```bash #!/bin/sh # Add Homebrew to exec path (if needed for custom layout engines) # yashiki add-exec-path /opt/homebrew/bin # Layout configuration yashiki layout-set-default tatami yashiki set-outer-gap 10 # Gap between windows and screen edges (global) yashiki layout-cmd --layout tatami set-inner-gap 10 # Gap between windows (layout-specific) # Cursor warp (mouse follows focus) yashiki set-cursor-warp on-focus-change # Tag bindings (tag N = bitmask $((1<<(N-1)))) for i in 1 2 3 4 5 6 7 8 9; do yashiki bind "alt-$i" tag-view "$((1<<(i-1)))" yashiki bind "alt-shift-$i" window-move-to-tag "$((1<<(i-1)))" done # Window focus yashiki bind alt-j window-focus next yashiki bind alt-k window-focus prev yashiki bind alt-h layout-cmd dec-main-ratio yashiki bind alt-l layout-cmd inc-main-ratio # Multi-monitor yashiki bind alt-o output-focus next yashiki bind alt-shift-o output-send next ``` -------------------------------- ### Yashiki Rule Examples: Ignore and Float Source: https://github.com/typester/yashiki/blob/main/docs/window-rules.md Provides examples of adding rules to Yashiki to either completely ignore specific application windows or to float them (exclude from tiling but keep managed). These rules are added using the `yashiki rule-add` command with application identifiers. ```sh # Example: Completely ignore Firefox popups yashiki rule-add --app-id org.mozilla.firefox --subrole AXUnknown ignore # Example: Finder floats but is still managed yashiki rule-add --app-name Finder float ``` -------------------------------- ### Yashiki Rule Specificity Example Source: https://github.com/typester/yashiki/blob/main/docs/window-rules.md Demonstrates how Yashiki prioritizes rules based on specificity. More specific rules, such as exact matches or prefix/suffix matches, take precedence over broader rules. This example shows a window floating and moving to a specific tag due to a more specific rule. ```sh # More specific rule takes priority yashiki rule-add --app-name Safari --title "*Preferences*" float yashiki rule-add --app-name Safari tags 2 # Result: Safari Preferences window floats AND goes to tag 2 # Result: Other Safari windows go to tag 2 (not floating) ``` -------------------------------- ### Verify Configuration File Existence and Permissions (Shell) Source: https://github.com/typester/yashiki/blob/main/docs/quick-start.md These commands help troubleshoot configuration loading issues for Yashiki. They verify if the configuration file exists, ensure it has execute permissions, and check for syntax errors. ```shell ls -la ~/.config/yashiki/init chmod +x ~/.config/yashiki/init sh -n ~/.config/yashiki/init ``` -------------------------------- ### Configure Window Management Shortcuts Source: https://github.com/typester/yashiki/blob/main/docs/quick-start.md Defines keyboard shortcuts for common window management actions such as toggling fullscreen, floating, closing windows, and zooming layouts. These shortcuts streamline window manipulation. ```shell yashiki bind alt-f window-toggle-fullscreen yashiki bind alt-shift-f window-toggle-float yashiki bind alt-shift-c window-close yashiki bind alt-z layout-cmd zoom ``` -------------------------------- ### Yashiki Configuration Example Source: https://github.com/typester/yashiki/blob/main/CLAUDE.md This example demonstrates how to configure Yashiki using a shell script. It covers setting execution paths, cursor warp behavior, auto-raise delay, default layouts, tracking companion tools, defining tag bindings, and applying window rules. ```sh #!/bin/sh # ~/.config/yashiki/init yashiki add-exec-path /opt/homebrew/bin yashiki set-cursor-warp on-focus-change yashiki set-auto-raise enabled --delay 100 # Focus follows mouse with 100ms delay yashiki layout-set-default tatami yashiki layout-set --tags 4 byobu # Start companion tools (terminated on yashiki quit) yashiki exec --track "borders active_color=0xffe1e3e4" # Tag bindings yashiki bind alt-1 tag-view 1 yashiki bind alt-shift-1 window-move-to-tag 1 yashiki bind alt-tab window-focus next yashiki bind alt-f window-toggle-fullscreen # Layout commands yashiki set-outer-gap 10 yashiki layout-cmd --layout tatami set-inner-gap 10 # Window rules yashiki rule-add --app-name Finder float yashiki rule-add --subrole AXUnknown ignore ``` -------------------------------- ### Python Script for Yashiki Bindings Source: https://github.com/typester/yashiki/blob/main/docs/quick-start.md An example Python script demonstrating how to programmatically configure Yashiki bindings using subprocess calls. This script binds 'alt-i' to 'tag-view' for tags 1 through 9. ```python #!/usr/bin/env python3 import subprocess for i in range(1, 10): subprocess.run(["yashiki", "bind", f"alt-{i}", "tag-view", str(1 << (i-1))]) ``` -------------------------------- ### Full Yashiki Power User Configuration Script Source: https://github.com/typester/yashiki/blob/main/docs/quick-start.md A comprehensive shell script for configuring Yashiki, including extending the PATH, setting default and tag-specific layouts, configuring gaps, and defining numerous keybindings for window management, focus, and application launching. It also includes advanced window rules for various scenarios. ```shell #!/bin/sh # Extend PATH for custom layout engines yashiki add-exec-path /opt/homebrew/bin # Layout configuration yashiki layout-set-default tatami yashiki layout-set --tags 4 byobu # Tag 3 uses byobu yashiki set-outer-gap 8 yashiki layout-cmd --layout tatami set-inner-gap 8 yashiki layout-cmd --layout byobu set-padding 40 # Cursor warp yashiki set-cursor-warp on-focus-change # Auto-raise (focus follows mouse) yashiki set-auto-raise enabled --delay 100 # Tags (all 9 tags) for i in 1 2 3 4 5 6 7 8 9; do yashiki bind "alt-$i" tag-view "$((1<<(i-1)))" yashiki bind "alt-shift-$i" window-move-to-tag "$((1<<(i-1)))" yashiki bind "alt-ctrl-$i" window-toggle-tag "$((1<<(i-1)))" done yashiki bind alt-0 tag-view-last yashiki bind alt-tab tag-view-last # Window focus (vim + directional) yashiki bind alt-j window-focus next yashiki bind alt-k window-focus prev yashiki bind alt-left window-focus left yashiki bind alt-right window-focus right yashiki bind alt-up window-focus up yashiki bind alt-down window-focus down # Layout controls yashiki bind alt-h layout-cmd dec-main-ratio yashiki bind alt-l layout-cmd inc-main-ratio yashiki bind alt-comma layout-cmd inc-main-count yashiki bind alt-period layout-cmd dec-main-count yashiki bind alt-z layout-cmd zoom yashiki bind alt-i layout-cmd inc-inner-gap yashiki bind alt-shift-i layout-cmd dec-inner-gap # Window management yashiki bind alt-f window-toggle-fullscreen yashiki bind alt-shift-f window-toggle-float yashiki bind alt-shift-c window-close yashiki bind alt-return retile # Multi-monitor yashiki bind alt-o output-focus next yashiki bind alt-shift-o output-send next # App launchers yashiki bind alt-shift-return exec "open -n /Applications/Ghostty.app" yashiki bind alt-s exec-or-focus --app-name Safari "open -a Safari" yashiki bind alt-c exec-or-focus --app-name "Google Chrome" "open -a 'Google Chrome'" # Companion tools (terminated on yashiki quit) yashiki exec --track "borders active_color=0xffe1e3e4" # Window rules - Float dialogs and utilities yashiki rule-add --app-name Finder float yashiki rule-add --app-name "System Settings" float yashiki rule-add --app-name "System Preferences" float yashiki rule-add --subrole Dialog float yashiki rule-add --subrole FloatingWindow float yashiki rule-add --fullscreen-button none float # Window rules - Ignore popups (prevents flickering) yashiki rule-add --subrole AXUnknown ignore yashiki rule-add --close-button none ignore # Window rules - App-specific yashiki rule-add --app-name Safari tags 2 # Safari on tag 2 yashiki rule-add --app-name Slack tags 8 # Slack on tag 4 yashiki rule-add --app-name "Google Chrome" output 2 # Chrome on external monitor yashiki rule-add --app-id org.mozilla.firefox --subrole AXUnknown ignore # Firefox popups # Ghostty Quick Terminal yashiki rule-add --app-id com.mitchellh.ghostty --fullscreen-button disabled ignore ``` -------------------------------- ### Basic Yashiki Initialization Script (Shell) Source: https://github.com/typester/yashiki/blob/main/docs/quick-start.md A fundamental shell script for initializing Yashiki. It sets the default layout, configures gaps, and defines keybindings for tag switching, window focusing, layout adjustment, and window management. ```shell #!/bin/sh # Layout configuration yashiki layout-set-default tatami yashiki set-outer-gap 10 yashiki layout-cmd --layout tatami set-inner-gap 8 # Tag bindings: alt-1 through alt-9 switch to tags 1-9 # alt-shift-1 through alt-shift-9 move windows to tags 1-9 for i in 1 2 3 4 5 6 7 8 9; do yashiki bind "alt-$i" tag-view "$((1<<(i-1)))" yashiki bind "alt-shift-$i" window-move-to-tag "$((1<<(i-1)))" done # Window focus (vim-style) yashiki bind alt-j window-focus next yashiki bind alt-k window-focus prev # Layout adjustment yashiki bind alt-h layout-cmd dec-main-ratio yashiki bind alt-l layout-cmd inc-main-ratio # Window management yashiki bind alt-f window-toggle-fullscreen yashiki bind alt-shift-f window-toggle-float yashiki bind alt-shift-c window-close # Multi-monitor yashiki bind alt-o output-focus next yashiki bind alt-shift-o output-send next ``` -------------------------------- ### Configure Tag Bindings for Views and Moves Source: https://github.com/typester/yashiki/blob/main/docs/quick-start.md Defines keyboard shortcuts for managing tags, allowing users to view and move windows to specific tags. It supports individual tags and a shortcut for the last viewed tag. ```shell for i in 1 2 3 4 5 6 7 8 9; do yashiki bind "alt-$i" tag-view "$((1<<(i-1)))" yashiki bind "alt-shift-$i" window-move-to-tag "$((1<<(i-1)))" done yashiki bind alt-0 tag-view-last ``` -------------------------------- ### Layout Engine Commands (Examples) Source: https://github.com/typester/yashiki/blob/main/docs/layout-engine.md Provides examples of optional commands that layout engines can implement, such as those for the 'tatami' and 'byobu' engines. ```APIDOC ## Layout Engine Commands (Examples) ### Description Layout engines can implement custom commands beyond the required `focus-changed` notification. Below are examples of commands supported by built-in Yashiki layout engines. ### Method N/A (Inter-process communication via stdin/stdout) ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body Commands are sent via the `Command` message type from Yashiki. **Required Commands:** - **`focus-changed`** (string) - ``: Notification of focus change. **Optional Commands (Examples): **tatami (master-stack):** - **`set-main-ratio`** (string) - ``: Set main area ratio (0.1-0.9). - **`inc-main-ratio`** (string, optional) - `[delta]`: Increase ratio (default: 0.05). - **`dec-main-ratio`** (string, optional) - `[delta]`: Decrease ratio. - **`inc-main-count`** (none): Increase main window count. - **`dec-main-count`** (none): Decrease main window count. - **`set-main-count`** (string) - ``: Set main window count. - **`zoom`** (string) - ``: Move window to main area. - **`set-inner-gap`** (string) - ``: Set gap between windows in pixels. **byobu (accordion):** - **`set-padding`** (string) - ``: Set stagger offset between windows. - **`set-orientation`** (string) - ``: Set stack direction. - **`toggle-orientation`** (none): Toggle stack direction. ### Request Example ```json {"Command":{"cmd":"set-main-ratio","args":["0.7"]}} {"Command":{"cmd":"set-padding","args":["10"]}} ``` ### Response #### Success Response (200) N/A #### Response Example Layout engines should respond with `Ok` or `NeedsRetile` after processing a command. ``` -------------------------------- ### Minimal Yashiki Configuration (Shell) Source: https://github.com/typester/yashiki/blob/main/docs/quick-start.md A streamlined shell script for Yashiki configuration, focusing on essential layout and tag view bindings. It sets the 'tatami' layout and binds 'alt-i' to switch to tag 'i'. ```shell #!/bin/sh yashiki layout-set-default tatami for i in 1 2 3 4 5 6; do yashiki bind "alt-$i" tag-view "$((1<<(i-1)))" done yashiki bind alt-j window-focus next yashiki bind alt-k window-focus prev ``` -------------------------------- ### Standard Yashiki Configuration (Shell) Source: https://github.com/typester/yashiki/blob/main/docs/quick-start.md A balanced shell script for daily Yashiki usage, configuring layout, gaps, and common window management keybindings. It includes settings for the 'tatami' layout and gap sizes. ```shell #!/bin/sh # Layout yashiki layout-set-default tatami yashiki set-outer-gap 10 yashiki layout-cmd --layout tatami set-inner-gap 10 ``` -------------------------------- ### List All Windows with Debug Info Source: https://github.com/typester/yashiki/blob/main/docs/window-rules.md Lists all windows, including ignored ones, with detailed debug information. Useful for identifying windows to create rules for. ```bash yashiki list-windows --all --debug ``` -------------------------------- ### Configure Window Output Placement (Shell) Source: https://github.com/typester/yashiki/blob/main/docs/quick-start.md This command adds a rule to Yashiki to control the display output for specific applications. It ensures that windows for the specified application consistently appear on the desired monitor. ```shell yashiki rule-add --app-name "Google Chrome" output 2 ``` -------------------------------- ### Add Common Floating Window Rules Source: https://github.com/typester/yashiki/blob/main/docs/quick-start.md Configures Yashiki to automatically float windows from specific applications like Finder and System Settings, as well as any window with a 'Dialog' subrole. This ensures certain window types behave as expected. ```shell yashiki rule-add --app-name Finder float yashiki rule-add --app-name "System Settings" float yashiki rule-add --subrole Dialog float ``` -------------------------------- ### Assign Windows to Specific Tags Source: https://github.com/typester/yashiki/blob/main/docs/window-rules.md Adds rules to assign specific applications to predefined tags (represented by bitmasks). For example, Safari on tag 2 and Slack on tag 3. ```bash # Safari on tag 2 (bitmask 2 = 1<<1) yashiki rule-add --app-name Safari tags 2 # Slack on tag 3 (bitmask 4 = 1<<2) yashiki rule-add --app-name Slack tags 4 ``` -------------------------------- ### Configure Cursor Warp and Auto-Raise Source: https://github.com/typester/yashiki/blob/main/docs/quick-start.md Sets up cursor warp to follow focus changes and enables auto-raise with a delay to prevent accidental focus shifts. These settings control mouse behavior and window focus. ```shell yashiki set-cursor-warp on-focus-change yashiki set-auto-raise enabled --delay 100 ``` -------------------------------- ### Install Yashiki via Homebrew Source: https://github.com/typester/yashiki/blob/main/README.md Installs the Yashiki window manager and its CLI tools using the Homebrew package manager. This is the recommended installation method for ease of use and updates. It also provides an option to bypass the quarantine attribute for unsigned applications. ```bash brew tap typester/yashiki brew install --cask yashiki # Or to bypass quarantine for unsigned apps: brew install --cask --no-quarantine yashiki ``` -------------------------------- ### Install Yashiki and Layout Engines via Cargo Source: https://github.com/typester/yashiki/blob/main/README.md Installs the core Yashiki daemon and CLI tools, as well as optional layout engines like 'tatami' and 'byobu', using the Cargo build tool. This method is suitable for developers or users who prefer building from source. ```bash # Core daemon and CLI cargo install yashiki # Install layout engines you want to use cargo install yashiki-layout-tatami # Master-stack layout cargo install yashiki-layout-byobu # Accordion layout ``` -------------------------------- ### Add Rule for Equivalent Subroles Source: https://github.com/typester/yashiki/blob/main/docs/window-rules.md Demonstrates that Yashiki accepts subrole values with or without the 'AX' prefix, showing equivalent commands for adding a rule to float dialog windows. ```bash # These are equivalent yashiki rule-add --subrole Dialog float yashiki rule-add --subrole AXDialog float ``` -------------------------------- ### Utilities Source: https://github.com/typester/yashiki/blob/main/README.md Utility commands for listing windows and displays, getting system state, and executing external commands. ```APIDOC ## Utilities ### Description Utility commands for listing managed windows and displays, retrieving system state, and executing external commands. ### Method CLI Command ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```sh yashiki list-windows yashiki list-windows --all yashiki list-windows --debug yashiki list-outputs yashiki get-state yashiki exec "open -a Safari" yashiki exec --track "borders" yashiki exec-or-focus --app-name Safari "open -a Safari" ``` ### Response #### Success Response (200) Output varies based on the command. `list-windows` and `list-outputs` return lists, `get-state` returns JSON, `exec` returns command output, `exec --track` runs in the background, `exec-or-focus` focuses or launches. #### Response Example ```json # Example for yashiki get-state: { "focused_window": 12345, "windows": [ { "id": 12345, "app": "Safari", "title": "Example Page" }, { "id": 67890, "app": "Terminal", "title": "bash" } ], "outputs": [ { "id": 0, "name": "Built-in Retina Display", "current_tag": 1 }, { "id": 1, "name": "External Monitor", "current_tag": 2 } ] } ``` ``` -------------------------------- ### List Current Rules Source: https://github.com/typester/yashiki/blob/main/docs/window-rules.md Lists all currently active Yashiki rules. This is a crucial step for troubleshooting to verify if a rule has been added correctly. ```bash yashiki list-rules ``` -------------------------------- ### Execute Tracked Commands with Yashiki Source: https://github.com/typester/yashiki/blob/main/README.md Example of using the `--track` option with `yashiki exec` to run companion tools like JankyBorders, often configured in `~/.config/yashiki/init`. ```shell # In ~/.config/yashiki/init yashiki exec --track "borders active_color=0xffe1e3e4" ``` -------------------------------- ### Add Rule for Specific Application Windows Source: https://github.com/typester/yashiki/blob/main/docs/window-rules.md Adds rules to float windows for specific applications like 'System Preferences' or 'System Settings', or windows with titles containing 'Preferences'. ```bash yashiki rule-add --app-name "System Preferences" float yashiki rule-add --app-name "System Settings" float yashiki rule-add --title "*Preferences*" float ``` -------------------------------- ### Debug Yashiki Issues (Shell) Source: https://github.com/typester/yashiki/blob/main/docs/quick-start.md This command enables debug logging for Yashiki, which is useful for diagnosing and troubleshooting issues. It sets the RUST_LOG environment variable to 'yashiki=debug' before starting Yashiki. ```shell RUST_LOG=yashiki=debug yashiki start ``` -------------------------------- ### Generate Tag Bitmasks in Shell Source: https://github.com/typester/yashiki/blob/main/docs/quick-start.md Demonstrates how to generate bitmask values for Yashiki tags using shell arithmetic. These bitmasks are used to represent and combine tags. ```sh # Tag 1 $((1<<0)) # Tag 2 $((1<<1)) # Tag 3 $((1<<2)) # Tag 4 $((1<<3)) # Tags 1+2 $((1<<0 | 1<<1)) # Tags 1+3 $((1<<0 | 1<<2)) ``` -------------------------------- ### Yashiki Build and Distribution Source: https://github.com/typester/yashiki/blob/main/CLAUDE.md Information on how to build Yashiki locally and distribute it, including Homebrew installation instructions, the release process involving release-plz and GitHub Actions, and the script for building app bundles. ```sh # Homebrew: brew tap typester/yashiki && brew install --cask yashiki # Release process: release-plz creates PR → merge triggers release → release.yml builds app bundles → manually update Homebrew cask # Build locally: ./scripts/build-app.sh --release ``` -------------------------------- ### Yashiki Development Notes Source: https://github.com/typester/yashiki/blob/main/CLAUDE.md This section outlines essential development notes for Yashiki, including the requirement for Accessibility permissions, how to run the daemon and CLI during development, the location of the PID file, and build commands. ```sh # Requires Accessibility permission (System Preferences → Privacy & Security → Accessibility) # Run daemon: RUST_LOG=info cargo run -p yashiki -- start # Run CLI: cargo run -p yashiki -- list-windows # PID file: /tmp/yashiki.pid ``` -------------------------------- ### Application Launcher Bindings Source: https://context7.com/typester/yashiki/llms.txt Configures keyboard shortcuts to launch specific applications or focus them if already running. ```bash yashiki bind alt-shift-return exec "open -n /Applications/Ghostty.app" yashiki bind alt-s exec-or-focus --app-name Safari "open -a Safari" ``` -------------------------------- ### Window Rules Source: https://context7.com/typester/yashiki/llms.txt Automatically configure windows based on various attributes like app name, bundle ID, title, etc. ```APIDOC ## Window Rules ### Description Automatically configure windows based on app name, bundle ID, title, AX attributes, window level, or button states. Rules use glob patterns (`*` for wildcards) and are sorted by specificity. ### Method CLI Command ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```bash # Float specific apps yashiki rule-add --app-name Finder float yashiki rule-add --app-name "System Settings" float yashiki rule-add --app-id com.apple.finder float # Float all dialog windows yashiki rule-add --subrole Dialog float yashiki rule-add --subrole FloatingWindow float # Float windows without fullscreen button yashiki rule-add --fullscreen-button none float # Ignore popups and tooltips (never manage) yashiki rule-add --subrole AXUnknown ignore yashiki rule-add --close-button none ignore # App-specific popup handling yashiki rule-add --app-id org.mozilla.firefox --subrole AXUnknown ignore yashiki rule-add --app-id com.microsoft.Outlook --ax-id none --subrole none ignore # Ghostty Quick Terminal yashiki rule-add --ax-id "com.mitchellh.ghostty.quickTerminal" float yashiki rule-add --app-id com.mitchellh.ghostty --fullscreen-button disabled ignore # Assign windows to tags yashiki rule-add --app-name Safari tags 2 yashiki rule-add --app-name Slack tags 8 # Assign windows to displays yashiki rule-add --app-name "Google Chrome" output 2 yashiki rule-add --app-id "com.google.*" output 2 # Set dimensions and position yashiki rule-add --app-name Preview dimensions 800 600 yashiki rule-add --app-name Preview position 100 100 # Combined matchers (more specific) yashiki rule-add --app-name Safari --title "*Preferences*" float # List all rules yashiki list-rules # Remove a rule yashiki rule-del --app-name Finder float ``` ### Response #### Success Response (200) Output depends on the command executed. #### Response Example (No specific example provided in source text) ``` -------------------------------- ### Yashiki CLI Commands Source: https://github.com/typester/yashiki/blob/main/CLAUDE.md This section lists the available commands for the Yashiki CLI, covering daemon control, hotkey bindings, window management, tag manipulation, layout configuration, rule management, and state inspection. It also details the bitmask usage for tags. ```sh yashiki start # Start daemon yashiki bind alt-1 tag-view 1 # Bind hotkey yashiki unbind alt-1 # Unbind hotkey yashiki list-bindings # List bindings yashiki tag-view 1 # Switch to tag yashiki tag-view --output 2 1 # Switch on specific display yashiki tag-toggle 2 # Toggle tag visibility yashiki tag-view-last # Switch to previous tags yashiki window-move-to-tag 1 # Move window to tag yashiki window-toggle-tag 2 # Toggle tag on window yashiki window-focus next|prev|left|right|up|down yashiki window-swap next|prev|left|right|up|down yashiki window-toggle-fullscreen yashiki window-toggle-float yashiki window-close yashiki output-focus next|prev yashiki output-send next|prev yashiki retile [--output N] yashiki layout-set-default tatami yashiki layout-set [--tags N] [--output N] byobu yashiki layout-get [--tags N] [--output N] yashiki layout-cmd [--layout name] [args] yashiki list-windows [--all] [--debug] yashiki list-outputs yashiki get-state yashiki exec "command" yashiki exec --track "borders" # Track process, terminate on quit yashiki exec-or-focus --app-name Safari "open -a Safari" yashiki set-exec-path|add-exec-path|exec-path yashiki rule-add --app-name|--app-id|--title|--ax-id|--subrole|--window-level|--*-button yashiki rule-del yashiki list-rules yashiki set-cursor-warp disabled|on-output-change|on-focus-change yashiki set-auto-raise disabled|enabled [--delay ms] yashiki get-auto-raise yashiki set-outer-gap || yashiki subscribe [--snapshot] [--filter events] yashiki quit ``` -------------------------------- ### Add Ignore Rules for App Flickering (Shell) Source: https://github.com/typester/yashiki/blob/main/docs/quick-start.md This snippet demonstrates how to add ignore rules to Yashiki to prevent window flickering or layout recalculations caused by temporary popup windows. It targets specific application IDs or generic window properties. ```shell yashiki rule-add --app-id org.mozilla.firefox --subrole AXUnknown ignore yashiki rule-add --subrole AXUnknown ignore yashiki rule-add --close-button none ignore ``` -------------------------------- ### Test Layout Engine with JSON Input Source: https://context7.com/typester/yashiki/llms.txt Demonstrates how to test a layout engine by piping JSON messages to its standard input and observing its output. This is useful for debugging custom layout logic. ```bash # Test layout engine standalone echo '{"Layout":{"width":1920,"height":1080,"windows":[1,2,3]}}' | ./my-layout # Output: {"Layout":{"windows":[{"id":1,"x":0,"y":0,"width":960,"height":1080},...]}} # Command example echo '{"Command":{"cmd":"set-main-ratio","args":["0.6"]}}' | yashiki-layout-tatami # Output: {"Ok":null} # Focus notification (required command) echo '{"Command":{"cmd":"focus-changed","args":["123"]}}' | yashiki-layout-byobu # Output: {"NeedsRetile":null} # byobu layout depends on focus ``` -------------------------------- ### State Events (IPC) Examples Source: https://context7.com/typester/yashiki/llms.txt Illustrates the JSON format of real-time state events emitted by Yashiki via the subscribe command. These events are used for building status bars and external integrations. ```json // Window events {"type":"window_created","window":{"id":123,"title":"Terminal","app_name":"Ghostty",...}} {"type":"window_destroyed","window_id":123} {"type":"window_updated","window":{"id":123,...}} // Focus events {"type":"window_focused","window_id":123} {"type":"window_focused","window_id":null} {"type":"display_focused","display_id":1} // Display events {"type":"display_added","display":{"id":2,"name":"External",...}} {"type":"display_removed","display_id":2} {"type":"display_updated","display":{"id":1,...}} // Tag events {"type":"tags_changed","display_id":1,"visible_tags":2,"previous_tags":1} // Layout events {"type":"layout_changed","display_id":1,"layout":"byobu"} // Full snapshot (when --snapshot flag used) {"type":"snapshot","windows":[...],"displays":[...],"focused_window_id":123,"focused_display_id":1,"default_layout":"tatami"} ``` -------------------------------- ### Configure Layout Engines and Gaps Source: https://context7.com/typester/yashiki/llms.txt Configure layout engines like tatami and byobu, set gaps between windows and screen edges, and send commands to modify layout properties. Supports global and specific layout configurations. ```bash # Set default layout for all tags yashiki layout-set-default tatami # Set layout for current tag yashiki layout-set byobu # Set layout for specific tag (tag 3 = bitmask 4) yashiki layout-set --tags 4 byobu # Get current layout yashiki layout-get # Set outer gap (between windows and screen edges) - global yashiki set-outer-gap 10 # All sides 10px yashiki set-outer-gap 10 20 # Vertical=10, horizontal=20 yashiki set-outer-gap 10 20 15 25 # Top, right, bottom, left (CSS-style) # Get current outer gap yashiki get-outer-gap # Send commands to layout engines yashiki layout-cmd set-main-ratio 0.6 yashiki layout-cmd inc-main-ratio yashiki layout-cmd dec-main-ratio yashiki layout-cmd inc-main-count yashiki layout-cmd dec-main-count yashiki layout-cmd zoom # Move focused window to main area # Configure specific layout's inner gap yashiki layout-cmd --layout tatami set-inner-gap 10 # Byobu (accordion) specific commands yashiki layout-cmd --layout byobu set-padding 40 yashiki layout-cmd --layout byobu set-orientation horizontal yashiki layout-cmd --layout byobu toggle-orientation # Force retile yashiki retile ``` -------------------------------- ### Example JSON Messages (Protocol) Source: https://github.com/typester/yashiki/blob/main/docs/layout-engine.md Illustrates the newline-delimited JSON format used for communication between Yashiki and layout engines. Shows examples for both Yashiki-to-engine and engine-to-Yashiki messages. ```json {"Layout":{"width":1920,"height":1080,"windows":[123,456,789]}} {"Command":{"cmd":"set-main-ratio","args":["0.6"]}} {"Layout":{"windows":[{"id":123,"x":0,"y":0,"width":960,"height":1080},{"id":456,"x":960,"y":0,"width":960,"height":1080}]}} {"Ok":null} {"NeedsRetile":null} {"Error":{"message":"Invalid ratio value"}} ``` -------------------------------- ### Float Ghostty Floating Windows (Shell) Source: https://github.com/typester/yashiki/blob/main/docs/window-rules.md This rule floats any Ghostty window that has the AXSubrole attribute set to 'FloatingWindow'. ```sh yashiki rule-add --app-id com.mitchellh.ghostty --subrole FloatingWindow float ``` -------------------------------- ### Float Firefox Picture-in-Picture (Shell) Source: https://github.com/typester/yashiki/blob/main/docs/window-rules.md This rule floats Firefox Picture-in-Picture windows by matching their application ID and window level. ```sh yashiki rule-add --app-id org.mozilla.firefox --window-level floating float ``` -------------------------------- ### Define Window Management Rules Source: https://context7.com/typester/yashiki/llms.txt Automatically configure windows based on application name, bundle ID, title, AX attributes, window level, or button states. Rules use glob patterns and are sorted by specificity. Supports floating, ignoring, assigning to tags, setting dimensions, and positioning. ```bash # Float specific apps yashiki rule-add --app-name Finder float yashiki rule-add --app-name "System Settings" float yashiki rule-add --app-id com.apple.finder float # Float all dialog windows yashiki rule-add --subrole Dialog float yashiki rule-add --subrole FloatingWindow float # Float windows without fullscreen button yashiki rule-add --fullscreen-button none float # Ignore popups and tooltips (never manage) yashiki rule-add --subrole AXUnknown ignore yashiki rule-add --close-button none ignore # App-specific popup handling yashiki rule-add --app-id org.mozilla.firefox --subrole AXUnknown ignore yashiki rule-add --app-id com.microsoft.Outlook --ax-id none --subrole none ignore # Ghostty Quick Terminal yashiki rule-add --ax-id "com.mitchellh.ghostty.quickTerminal" float yashiki rule-add --app-id com.mitchellh.ghostty --fullscreen-button disabled ignore # Assign windows to tags yashiki rule-add --app-name Safari tags 2 yashiki rule-add --app-name Slack tags 8 # Assign windows to displays yashiki rule-add --app-name "Google Chrome" output 2 yashiki rule-add --app-id "com.google.*" output 2 # Set dimensions and position yashiki rule-add --app-name Preview dimensions 800 600 yashiki rule-add --app-name Preview position 100 100 # Combined matchers (more specific) yashiki rule-add --app-name Safari --title "*Preferences*" float # List all rules yashiki list-rules # Remove a rule yashiki rule-del --app-name Finder float ``` -------------------------------- ### Layout Configuration Source: https://context7.com/typester/yashiki/llms.txt Configure layout engines, set gaps, and send commands to layout engines for window management. ```APIDOC ## Layout Configuration ### Description Configure layout engines (tatami for master-stack, byobu for accordion), set gaps, and send commands to layout engines. ### Method CLI Command ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```bash # Set default layout for all tags yashiki layout-set-default tatami # Set layout for current tag yashiki layout-set byobu # Set layout for specific tag (tag 3 = bitmask 4) yashiki layout-set --tags 4 byobu # Get current layout yashiki layout-get # Set outer gap (between windows and screen edges) - global yashiki set-outer-gap 10 # All sides 10px yashiki set-outer-gap 10 20 # Vertical=10, horizontal=20 yashiki set-outer-gap 10 20 15 25 # Top, right, bottom, left (CSS-style) # Get current outer gap yashiki get-outer-gap # Send commands to layout engines yashiki layout-cmd set-main-ratio 0.6 yashiki layout-cmd inc-main-ratio yashiki layout-cmd dec-main-ratio yashiki layout-cmd inc-main-count yashiki layout-cmd dec-main-count yashiki layout-cmd zoom # Move focused window to main area # Configure specific layout's inner gap yashiki layout-cmd --layout tatami set-inner-gap 10 # Byobu (accordion) specific commands yashiki layout-cmd --layout byobu set-padding 40 yashiki layout-cmd --layout byobu set-orientation horizontal yashiki layout-cmd --layout byobu toggle-orientation # Force retile yashiki retile ``` ### Response #### Success Response (200) Output depends on the command executed. #### Response Example (No specific example provided in source text) ``` -------------------------------- ### Add Rule for Floating Dialog Windows Source: https://github.com/typester/yashiki/blob/main/docs/window-rules.md Adds rules to float dialog windows and floating windows. This prevents them from being tiled with other windows. ```bash yashiki rule-add --subrole Dialog float yashiki rule-add --subrole FloatingWindow float ``` -------------------------------- ### Ignore All AXUnknown Windows Source: https://github.com/typester/yashiki/blob/main/docs/window-rules.md Adds a rule to ignore all windows with the AXUnknown subrole, such as Firefox dropdowns or tooltips. Ignored windows are completely skipped by Yashiki. ```bash yashiki rule-add --subrole AXUnknown ignore ``` -------------------------------- ### State Streaming and Queries Source: https://context7.com/typester/yashiki/llms.txt Subscribe to real-time state events for status bars and external tools. Events are streamed as newline-delimited JSON. ```APIDOC ## State Streaming and Queries ### Description Subscribe to real-time state events for status bars and external tools. Events are streamed as newline-delimited JSON. ### Method CLI Command ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```bash # Subscribe to all events yashiki subscribe # Get initial snapshot on connect yashiki subscribe --snapshot # Filter specific event types yashiki subscribe --filter focus,tags yashiki subscribe --filter window,display,layout # Event types: window, focus, display, tags, layout # Example events: # {"type":"window_focused","window_id":123} # {"type":"tags_changed","display_id":1,"visible_tags":2,"previous_tags":1} # {"type":"layout_changed","display_id":1,"layout":"byobu"} # Query current state yashiki get-state # Output: {"visible_tags":1,"focused_window_id":123,"window_count":5,"default_layout":"tatami","current_layout":"tatami"} # List managed windows yashiki list-windows # Include ignored windows (popups, tooltips) yashiki list-windows --all ``` ### Response #### Success Response (200) Output depends on the command executed. For `subscribe`, events are streamed as newline-delimited JSON. For `get-state`, a JSON object representing the current state is returned. For `list-windows`, a JSON array of window objects is returned. #### Response Example ```json # Example for get-state: { "visible_tags": 1, "focused_window_id": 123, "window_count": 5, "default_layout": "tatami", "current_layout": "tatami" } # Example for subscribe (streamed): {"type":"window_focused","window_id":123} {"type":"tags_changed","display_id":1,"visible_tags":2,"previous_tags":1} ``` ``` -------------------------------- ### Companion Tool Execution Source: https://context7.com/typester/yashiki/llms.txt Executes a companion tool that is terminated when Yashiki quits, useful for background processes like border customization. ```bash yashiki exec --track "borders active_color=0xffe1e3e4" ``` -------------------------------- ### Control Multi-Monitor Layout Source: https://context7.com/typester/yashiki/llms.txt Commands for managing window focus and movement across multiple displays. Includes focusing displays, sending windows to other displays, and listing display properties. ```bash # Focus next/previous display yashiki output-focus next yashiki output-focus prev # Send focused window to next/previous display (keeps focus on source display) yashiki output-send next yashiki output-send prev # List all displays with their properties yashiki list-outputs # Output JSON: # [ # {"id": 1, "name": "Built-in Retina Display", "x": 0, "y": 0, "width": 2560, "height": 1600, "is_main": true, "visible_tags": 1, "is_focused": true}, # {"id": 2, "name": "DELL U2720Q", "x": 2560, "y": 0, "width": 3840, "height": 2160, "is_main": false, "visible_tags": 1, "is_focused": false} # ] ``` -------------------------------- ### Ignore Ghostty Quick Terminal (Shell) Source: https://github.com/typester/yashiki/blob/main/docs/window-rules.md This rule ignores the Ghostty Quick Terminal by matching its application ID and the state of its fullscreen and close buttons. ```sh yashiki rule-add --app-id com.mitchellh.ghostty --fullscreen-button disabled --close-button enabled ignore ```