### Install Peashot using Package Managers or Source Source: https://context7.com/nik-rev/peashot/llms.txt Instructions for installing Peashot via Homebrew, a shell installer, PowerShell, AUR, Nix, or building from source using Cargo. ```sh # Homebrew (macOS / Linux) brew install nik-rev/tap/ferrishot ``` ```sh # Shell installer (Linux / macOS) curl --proto '=https' --tlsv1.2 -LsSf \ https://github.com/nik-rev/ferrishot/releases/latest/download/ferrishot-installer.sh | sh ``` ```powershell # PowerShell (Windows) powershell -ExecutionPolicy Bypass -c \ "irm https://github.com/nik-rev/ferrishot/releases/latest/download/ferrishot-installer.ps1 | iex" ``` ```sh # Arch Linux (AUR) yay -S ferrishot-bin ``` ```nix # Nix flake # In flake.nix inputs: # ferrishot.url = "github:nik-rev/ferrishot/main"; # Then reference the package: # inputs.ferrishot.packages.${pkgs.system}.default ``` ```sh # Cargo (requires system libraries on Linux: libgl-dev, libx11-dev, libxcbcommon-dev) cargo install ferrishot ``` -------------------------------- ### Ferrishot KDL Configuration Example Source: https://context7.com/nik-rev/peashot/llms.txt An example KDL configuration file demonstrating how to customize UI toggles, theme colors, and keybindings for Ferrishot. ```kdl // ferrishot.kdl — set a preferred upload service upload-service litterbox // Toggle the WxH size indicator in the bottom-left corner size-indicator true // Toggle action icons rendered around the selection border selection-icons true theme { // Named palette for re-use palette { bg 0x1e1e2e fg 0xcdd6f4 red 0xf38ba8 green 0xa6e3a1 overlay 0x313244 } // Use a palette reference with optional opacity non-selected-region @bg opacity=0.6 selection-frame @fg error-bg @red error-fg @bg success @green icon-bg @overlay icon-fg @fg size-indicator-bg @overlay size-indicator-fg @fg } keys { // Copy to clipboard — bound to Enter copy-to-clipboard key= // Save screenshot — Ctrl+s save-screenshot key=s mod=ctrl // Upload online — Ctrl+u upload-screenshot key=u mod=ctrl // Exit without capturing — Escape or q exit key= exit key=q // Vim-style movement: move selection edge by 1px move-selection-edge direction=left key=h move-selection-edge direction=down key=j move-selection-edge direction=up key=k move-selection-edge direction=right key=l // Jump to screen corners / edges goto top-left key=gg goto bottom-right key=G // Press ? to show keybindings cheatsheet show-cheatsheet key=? } ``` -------------------------------- ### Install Ferrishot using PowerShell Source: https://github.com/nik-rev/peashot/blob/main/README.OLD.md Execute this PowerShell command to download and install the Ferrishot installer script. ```powershell powershell -ExecutionPolicy Bypass -c "irm https://github.com/nik-rev/ferrishot/releases/latest/download/ferrishot-installer.ps1 | iex" ``` -------------------------------- ### Install Ferrishot using Shell Script Source: https://github.com/nik-rev/peashot/blob/main/README.OLD.md This command downloads and executes the installation script for Ferrishot. ```shell curl --proto '=https' --tlsv1.2 -LsSf https://github.com/nik-rev/ferrishot/releases/latest/download/ferrishot-installer.sh | sh ``` -------------------------------- ### Example i3/sway Keybinding for Silent Copy Source: https://context7.com/nik-rev/peashot/llms.txt Example configuration for i3 or sway window managers to bind a key combination to silently copy the last selected region to the clipboard. ```sh # Example i3/sway keybinding in config: # bindsym Print exec ferrishot --last-region --accept-on-select copy --silent # bindsym Shift+Print exec ferrishot --accept-on-select copy --silent ``` -------------------------------- ### Install Ferrishot using Homebrew Source: https://github.com/nik-rev/peashot/blob/main/README.OLD.md Use this command to install Ferrishot if you have Homebrew installed on your system. ```shell brew install nik-rev/tap/ferrishot ``` -------------------------------- ### Example Keyboard-Only Selection Workflow (Shell) Source: https://context7.com/nik-rev/peashot/llms.txt Illustrates a full keyboard-driven workflow for selecting and copying a screenshot using letter-grid mode and Vim-style motions. ```sh # Example full keyboard-only workflow (no mouse): # 1. Run ferrishot ferrishot # 2. Inside the UI: # Press t → activate top-left letter picker # Type "ad" → set top-left corner to zone "ad" # Press b → activate bottom-right letter picker # Type "mq" → set bottom-right corner to zone "mq" # Press Enter → copy selection to clipboard ``` -------------------------------- ### Install Ferrishot from Arch AUR Source: https://github.com/nik-rev/peashot/blob/main/README.OLD.md Use the `yay` AUR helper to install the `ferrishot-bin` package on Arch Linux. ```shell yay -S ferrishot-bin ``` -------------------------------- ### Install Ferrishot using Cargo Source: https://github.com/nik-rev/peashot/blob/main/README.OLD.md Install Ferrishot directly from source using Cargo. Ensure you have the necessary dependencies for Linux as outlined in CONTRIBUTING.md. ```rust cargo install ferrishot ``` -------------------------------- ### Dump Default Configuration (Shell) Source: https://context7.com/nik-rev/peashot/llms.txt Writes the annotated default KDL configuration file to the user's config directory (~/.config/ferrishot.kdl). Useful for starting a custom configuration. ```sh # Write the annotated default config to ~/.config/ferrishot.kdl ferrishot --dump-default-config ``` -------------------------------- ### Add Ferrishot to Nix Configuration Source: https://github.com/nik-rev/peashot/blob/main/README.OLD.md Example of how to add Ferrishot as an input and use it within a Nix flake configuration, particularly for home-manager. ```nix # add it to your inputs inputs.ferrishot.url = "github:nik-rev/ferrishot/main"; # then use it in home-manager for example inputs.ferrishot.packages.${pkgs.system}.default ``` -------------------------------- ### Clone and Build Peashot Source: https://context7.com/nik-rev/peashot/llms.txt Clones the Peashot repository and builds the project using Cargo. Includes commands for installing Linux dependencies. ```sh # Clone and build git clone https://github.com/nik-rev/peashot cd peashot # Linux dependencies (apt) sudo apt install libgl-dev libx11-dev libxcbcommon-dev # Wayland additionally: sudo apt install libwayland-dev # Run cargo run # Build release binary cargo build --release # Binary at: target/release/ferrishot ``` -------------------------------- ### Upload Screenshot and Get URL (Shell) Source: https://context7.com/nik-rev/peashot/llms.txt Command to upload a screenshot and receive its public URL along with an estimated expiry time. Requires `--last-region` and `--accept-on-select` flags. ```sh # Upload and get back the public URL + expiry estimate ferrishot --last-region --accept-on-select upload # Prints: https://litterbox.catbox.moe/files/2025/05/abc123.png (expires in 3 days) ``` -------------------------------- ### Image Actions: Copy, Save, Upload Source: https://context7.com/nik-rev/peashot/llms.txt Perform core image actions (copy, save, upload) either via keybindings within the UI or as command-line arguments using `--accept-on-select`. ```sh # Inside the UI (default keybindings): # Enter → copy to clipboard # Ctrl+s → save to file (opens native file picker, or uses --save-path) # Ctrl+u → upload to the internet → shows URL + QR code ``` ```sh # From the CLI with a pre-defined region: ferrishot --region 640x480+0+0 --accept-on-select copy ``` ```sh ferrishot --region 640x480+0+0 --accept-on-select save --save-path /tmp/out.webp ``` ```sh ferrishot --region 640x480+0+0 --accept-on-select upload --json ``` -------------------------------- ### Generate Documentation Source: https://github.com/nik-rev/peashot/blob/main/CONTRIBUTING.md Command to generate documentation for the project, including private items. ```sh cargo docgen ``` -------------------------------- ### Launch Debug Overlay at Startup Source: https://context7.com/nik-rev/peashot/llms.txt Launches Peashot with the debug overlay enabled from startup. The overlay can also be toggled at runtime with F12. ```sh # Or launch debug overlay at startup ferrishot --debug ``` -------------------------------- ### Debug CLI Options Source: https://github.com/nik-rev/peashot/blob/main/CONTRIBUTING.md These are additional command-line options available for debugging the application. Use `--debug` to launch in debug mode, which is equivalent to pressing F12. ```sh Debug: --log-level Choose a minimum level at which to log. [error, warn, info, debug, trace, off] [default: error] --log-stderr Log to standard error instead of file --log-file Path to the log file [default: /home/e/.cache/ferrishot.log] --log-filter Filter for specific Rust module or crate, instead of showing logs from all crates --debug Launch in debug mode (F12) ``` -------------------------------- ### Build Peashot with Nix Source: https://context7.com/nik-rev/peashot/llms.txt Builds Peashot using Nix, which automatically provides all necessary dependencies. Includes commands to enter the Nix develop environment and run. ```sh # Nix (all dependencies provided automatically) nix develop cargo run ``` -------------------------------- ### Use Custom Configuration File (Shell) Source: https://context7.com/nik-rev/peashot/llms.txt Instructs Ferrishot to use a configuration file located at a specified path instead of the default. ```sh # Use a custom config file path ferrishot --config-file /path/to/my-config.kdl ``` -------------------------------- ### Vim Motions with Count Prefix (Shell) Source: https://context7.com/nik-rev/peashot/llms.txt Demonstrates how to use count prefixes with Vim-style movement commands to adjust selection size by a specific number of pixels. ```sh # Inside the UI (default bindings): # Move the right edge of the selection right by 1px l # Move the right edge right by 50px (count prefix = 50) 50l # Move selection up by 200px 200k # Shrink left edge by 10px 10h # Press ? to open the full cheatsheet overlay ? ``` -------------------------------- ### Headless Capture with --accept-on-select Source: https://context7.com/nik-rev/peashot/llms.txt Perform instant captures without UI by combining `--accept-on-select` with `--last-region` or `--region`. Useful for scripting and automated workflows. ```sh # Copy last-used region to clipboard instantly (no UI) ferrishot --last-region --accept-on-select copy ``` ```sh # Save last-used region to a specific path, no file picker ferrishot --last-region --accept-on-select save --save-path ~/screenshots/shot.png ``` ```sh # Upload last-used region to the internet and print the URL ferrishot --last-region --accept-on-select upload ``` ```sh # Upload a fixed region and get JSON output (useful for scripting) ferrishot --region 1920x1080+0+0 --accept-on-select upload --json # Output: # { # "action": "upload", # "url": "https://files.catbox.moe/abc123.png", # "expires_in": "2 weeks" # } ``` ```sh # Upload interactively selected region; auto-copy to clipboard as soon as mouse released ferrishot --accept-on-select copy # Hold Ctrl while releasing the mouse to cancel auto-accept ``` -------------------------------- ### Run Peashot Application Source: https://github.com/nik-rev/peashot/blob/main/CONTRIBUTING.md Use this command to run the Peashot application after building. ```sh cargo run ``` -------------------------------- ### JSON Output for Headless Operation (Shell) Source: https://context7.com/nik-rev/peashot/llms.txt Shows how to use the `--json` flag for machine-readable output when running Ferrishot headlessly, useful for scripting and automation. ```sh ferrishot --last-region --accept-on-select upload --json # stdout: # { # "action": "upload", # "url": "https://0x0.st/xyz.png", # "expires_in": "30 days" # } ferrishot --last-region --accept-on-select save --save-path /tmp/shot.png --json ``` -------------------------------- ### Launch Peashot Application Source: https://context7.com/nik-rev/peashot/llms.txt Basic commands to launch the Peashot interactive screenshot UI. Use the `--delay` flag to capture menus or `--region` for pre-selected areas. ```sh # Open interactive screenshot UI ferrishot ``` ```sh # Wait 2 seconds before launching (useful for capturing menus) ferrishot --delay 2000 ``` ```sh # Open with a pre-selected region (absolute pixels) # Format: x++ ferrishot --region 800x600+100+50 ``` ```sh # Open with a full-screen pre-selection ferrishot --region full ``` ```sh # Re-use the last selection made in a previous session ferrishot --last-region ``` -------------------------------- ### Define Capture Region with LazyRectangle Syntax Source: https://context7.com/nik-rev/peashot/llms.txt Utilize the `--region` flag with flexible `WxH+X+Y` syntax, supporting absolute pixels, screen fractions, and relative nudges for precise selection. ```sh # Absolute: 800px wide, 600px tall, top-left at (100, 50) ferrishot --region 800x600+100+50 ``` ```sh # Relative: 50% width, 50% height, starting at screen center ferrishot --region 0.5x0.5+0.25+0.25 ``` ```sh # Full screen shorthand ferrishot --region full ``` ```sh # 100px wide, full height, horizontally centered (offset left by 50% of width) ferrishot --region "100x1.0+0.5+0-50%" ``` ```sh # Centered 400×300 box: placed at 50% of screen, then nudged back by 50% of its own size ferrishot --region "400x300+0.5+0.5-50%-50%" ``` -------------------------------- ### Theme System Color Declarations (KDL) Source: https://context7.com/nik-rev/peashot/llms.txt Defines color palettes and theme elements using hex integers or palette references with optional opacity. Used for customizing the UI's appearance. ```kdl theme { palette { black 0x000000 white 0xffffff blue 0x89b4fa } // Opaque blue selection frame selection-frame @blue // Dark background at 70% opacity behind the unselected area non-selected-region @black opacity=0.7 // Drop shadows (icons, selection border, error boxes) drop-shadow @black opacity=0.5 // Tooltip colors tooltip-bg @black opacity=0.85 tooltip-fg @white // Size indicator (bottom-left WxH box) size-indicator-bg @black opacity=0.75 size-indicator-fg @white // Errors error-bg 0xff0000 opacity=0.9 error-fg 0xffffff } ``` -------------------------------- ### Regenerate Completions and Man Page Source: https://context7.com/nik-rev/peashot/llms.txt Generates shell completions and man pages for Peashot. Outputs are placed in the 'completions/' directory. ```sh # Regenerate completions and man page cargo docgen # Outputs to: completions/ ``` -------------------------------- ### Set Preferred Upload Service (KDL) Source: https://context7.com/nik-rev/peashot/llms.txt Specifies the preferred image hosting service for uploads in the KDL configuration file. ```kdl upload-service litterbox ``` -------------------------------- ### Image Upload Services Enum (Rust) Source: https://context7.com/nik-rev/peashot/llms.txt Defines the available image upload services with their respective properties. Used to control preferred services in the KDL configuration. ```rust pub enum ImageUploadService { Litterbox, Catbox, TheNullPointer, Uguu, } ``` -------------------------------- ### Structured Logging to File Source: https://context7.com/nik-rev/peashot/llms.txt Configures Peashot to log debug information to a specified file with a given log level. Requires building with the 'debug' feature. ```sh # Structured logging to file ferrishot --features debug -- --log-level debug --log-file /tmp/ferrishot.log ``` -------------------------------- ### Capture and Save Region to File Source: https://context7.com/nik-rev/peashot/llms.txt Captures the last selected region and saves it to a specified file path. Outputs JSON indicating the action and path. ```sh ferrishot --last-region --accept-on-select copy --json # stdout: # { # "action": "copy" # } ``` -------------------------------- ### Build Peashot in Debug Mode Source: https://context7.com/nik-rev/peashot/llms.txt Builds the Peashot project with the 'debug' feature enabled, allowing for additional CLI flags for development. ```sh # Build in debug mode cargo run --features debug ``` -------------------------------- ### Log to stderr Source: https://context7.com/nik-rev/peashot/llms.txt Configures Peashot to output logs to stderr instead of a file. Requires building with the 'debug' feature. ```sh # Log to stderr instead of a file ferrishot --features debug -- --log-level info --log-stderr ``` -------------------------------- ### Capture and Copy Last Region Silently Source: https://context7.com/nik-rev/peashot/llms.txt Captures the last selected region and copies it to the clipboard without any stdout or stderr output. Useful for scripting. ```sh # Silently copy last region to clipboard; no output at all ferrishot --last-region --accept-on-select copy --silent ``` -------------------------------- ### Log from Specific Rust Module Source: https://context7.com/nik-rev/peashot/llms.txt Configures Peashot to log messages from a specific Rust module (e.g., 'ferrishot::image::upload') with a trace log level. Requires 'debug' feature. ```sh # Log only from a specific Rust module ferrishot --features debug -- --log-level trace --log-filter ferrishot::image::upload ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.