### Configure Hotshot Source: https://github.com/jeffjose/hotshot/blob/main/README.md Example configuration file for customizing storage, image format, and behavior. ```toml # Base directory for screenshots storage_dir = "~/Screenshots" [image] format = "png" # png, jpeg, webp quality = 90 # 1-100 (jpeg/webp only) filename_template = "{timestamp}-{random}" [storage] organize_by = "month" # "month" (YYYY-MM subdirs) or "none" [behavior] copy_to_clipboard = false # auto-copy to clipboard after capture notification = false # desktop notification after capture ``` -------------------------------- ### Install Hotshot Source: https://github.com/jeffjose/hotshot/blob/main/README.md Commands to install the CLI tool with or without the GUI feature. ```sh # CLI only cargo install --path crates/hotshot-cli # CLI + GUI cargo install --path crates/hotshot-cli --features gui ``` -------------------------------- ### Build with GUI Support Source: https://context7.com/jeffjose/hotshot/llms.txt Installs the hotshot-cli with GUI support enabled. This command is used to build the application with the necessary features for the graphical interface. ```bash cargo install --path crates/hotshot-cli --features gui ``` -------------------------------- ### Display Management Source: https://context7.com/jeffjose/hotshot/llms.txt Lists and manages connected monitors for multi-display setups. ```APIDOC ## Display Management ### Description Lists and manages connected monitors for multi-display setups. ### Method CLI Command ### Endpoint N/A (CLI command) ### Parameters #### Command Arguments - **display list** - Required - Lists all connected monitors with their geometry. ### Request Example ```bash hotshot display list ``` ### Response #### Success Response Lists connected monitors with their index, name, and geometry. #### Response Example ``` 0: eDP-1: 1920x1080+0+0 1: HDMI-1: 2560x1440+1920+0 ``` ``` -------------------------------- ### Get and Update Application Configuration Source: https://context7.com/jeffjose/hotshot/llms.txt Reads the current application configuration and allows updating specific settings. Use `getConfig` to view current settings and `updateConfig` to change them. ```typescript import { getConfig, updateConfig } from "$lib/api"; // Get current config const config = await getConfig(); console.log(`Storage: ${config.storage_dir}`); console.log(`Format: ${config.image.format}`); console.log(`Quality: ${config.image.quality}`); console.log(`Organize by: ${config.storage.organize_by}`); console.log(`Auto-clipboard: ${config.behavior.copy_to_clipboard}`); // Update config values await updateConfig("format", "webp"); await updateConfig("quality", "85"); await updateConfig("copy_to_clipboard", "true"); await updateConfig("organize_by", "none"); ``` -------------------------------- ### Launch GUI Source: https://context7.com/jeffjose/hotshot/llms.txt Launches the Tauri-based graphical interface for annotation and gallery management. Requires the 'gui' feature to be enabled during build. ```bash hotshot gui ``` -------------------------------- ### Build and Develop GUI Source: https://github.com/jeffjose/hotshot/blob/main/README.md Commands for building the CLI with GUI features and running the development environment. ```sh cargo build -p hotshot-cli --features gui ``` ```sh cd crates/hotshot-ui && pnpm install && pnpm tauri dev ``` -------------------------------- ### Manage configuration with Config::load_or_create() Source: https://context7.com/jeffjose/hotshot/llms.txt Handles loading, modifying, and saving application configuration files. ```rust use hotshot_core::Config; // Load or create config let config = Config::load_or_create()?; println!("Storage dir: {:?}", config.storage_dir); println!("Image format: {}", config.image.format); println!("Quality: {}", config.image.quality); println!("Organize by: {}", config.storage.organize_by); println!("Copy to clipboard: {}", config.behavior.copy_to_clipboard); // Modify and save config let mut config = Config::load_or_create()?; config.set_value("format", "webp")?; config.set_value("quality", "85")?; config.set_value("copy_to_clipboard", "true")?; config.save()?; // Get config file path let path = Config::config_path(); println!("Config at: {:?}", path); ``` -------------------------------- ### Launch GUI Source: https://context7.com/jeffjose/hotshot/llms.txt Opens the Tauri-based graphical interface for annotation and gallery management. ```APIDOC ## Launch GUI ### Description Opens the Tauri-based graphical interface for annotation and gallery management (requires `gui` feature). ### Method CLI Command ### Endpoint N/A (CLI command) ### Parameters #### Command Arguments - **gui** - Launches the graphical user interface. ### Request Example ```bash hotshot gui ``` ### Response #### Success Response Launches the Hotshot GUI application. #### Response Example N/A (GUI application launch) ``` -------------------------------- ### Config::load_or_create() Source: https://context7.com/jeffjose/hotshot/llms.txt Loads configuration from the default path or creates a default config file if it does not exist. ```APIDOC ## Config::load_or_create() ### Description Loads configuration from `~/.config/hotshot/config.toml` or creates default config if it doesn't exist. ``` -------------------------------- ### Capture Screenshots via CLI Source: https://github.com/jeffjose/hotshot/blob/main/README.md Commands for capturing different screen areas and launching the GUI. ```sh hotshot capture fullscreen # capture entire screen hotshot capture region # interactive region selection hotshot capture region --geometry 100,200,800,600 hotshot capture window # capture focused window hotshot gui # launch the GUI (requires --features gui) ``` -------------------------------- ### Configuration Management Source: https://context7.com/jeffjose/hotshot/llms.txt View, edit, and set Hotshot configuration values. Use 'show' to display current config, 'path' for file location, 'edit' to open in $EDITOR, 'set' for specific values, and 'reset' to revert to defaults. ```bash hotshot config show ``` ```bash hotshot config path ``` ```bash hotshot config edit ``` ```bash hotshot config set format=webp ``` ```bash hotshot config set quality=85 ``` ```bash hotshot config set copy_to_clipboard=true ``` ```bash hotshot config set storage_dir=~/Pictures/Screenshots ``` ```bash hotshot config set organize_by=none ``` ```bash hotshot config reset ``` -------------------------------- ### Manage monitors with capture::list_monitors() Source: https://context7.com/jeffjose/hotshot/llms.txt Retrieves connected monitor information and resolves displays by index or name. ```rust use hotshot_core::capture::{list_monitors, resolve_display}; // List all monitors let monitors = list_monitors()?; for (i, monitor) in monitors.iter().enumerate() { println!("{}: {} ({}x{} at +{}+{})", i, monitor.name, monitor.width, monitor.height, monitor.x, monitor.y); } // Resolve display by index or name let monitor = resolve_display("0")?; // By index let monitor = resolve_display("HDMI-1")?; // By name // Convert monitor to capture region let region = monitor.to_region(); ``` -------------------------------- ### Copy Image to Clipboard Source: https://context7.com/jeffjose/hotshot/llms.txt Capture the current screen and copy the resulting RGBA image to the system clipboard. ```rust use hotshot_core::capture::{capture, CaptureMode}; use hotshot_core::clipboard::copy_image; let image = capture(&CaptureMode::Fullscreen, None)?; copy_image(&image)?; println!("Image copied to clipboard"); ``` -------------------------------- ### Manage Metadata and Database Source: https://context7.com/jeffjose/hotshot/llms.txt Create, persist, and query screenshot metadata using the Metadata and MetadataDb structures. ```rust use hotshot_core::metadata::{Metadata, MetadataDb}; use std::path::PathBuf; // Create new metadata entry let mut meta = Metadata::new( "20240115-143022-a1b2", PathBuf::from("/home/user/Screenshots/2024-01/20240115-143022-a1b2.png"), 1920, // width 1080, // height "png", // format "fullscreen", // capture mode "x11", // display server ); meta.file_size = 245_000; meta.add_tags(&["work".to_string(), "screenshot".to_string()]); // Load metadata database let mut db = MetadataDb::load()?; db.add(meta); db.save()?; // Search and query let results = db.search("work"); let sorted = db.list_sorted(); // Newest first // Find by ID prefix let (index, entry) = db.find("20240115")?; let entry = db.find_mut("20240115")?; entry.notes = "Important screenshot".to_string(); db.save()?; ``` -------------------------------- ### Query storage with Storage::list() and Storage::search() Source: https://context7.com/jeffjose/hotshot/llms.txt Retrieves lists of screenshots or performs searches based on tags, notes, or IDs. ```rust use hotshot_core::config::Config; use hotshot_core::storage::Storage; let config = Config::load_or_create()?; let storage = Storage::new(config); // List recent screenshots (newest first) let screenshots = storage.list(Some(20))?; for meta in &screenshots { println!("{} - {}x{} [{}]", meta.id, meta.width, meta.height, meta.tags.join(", ")); } // List all screenshots let all = storage.list(None)?; // Search by query (matches tags, notes, ID) let results = storage.search("project")?; for meta in &results { println!("Found: {} - {:?}", meta.id, meta.path); } ``` -------------------------------- ### Capture Fullscreen Screenshot Source: https://context7.com/jeffjose/hotshot/llms.txt Captures the entire screen or a specific monitor. Use --clipboard to copy to clipboard, -d to specify a monitor by index or name, --format to set image format, and --output to specify a custom path. ```bash hotshot capture fullscreen ``` ```bash hotshot capture fullscreen --clipboard ``` ```bash hotshot capture fullscreen -d 0 ``` ```bash hotshot capture fullscreen -d HDMI-1 ``` ```bash hotshot capture fullscreen --format webp ``` ```bash hotshot capture fullscreen --output ~/screenshot.png ``` -------------------------------- ### Storage::list() and Storage::search() Source: https://context7.com/jeffjose/hotshot/llms.txt Lists screenshots or searches for them by tag, note, or ID. ```APIDOC ## Storage::list() ### Description Lists all screenshots sorted by date. ## Storage::search() ### Description Searches for screenshots by tag, note, or ID. ### Parameters #### Request Body - **query** (String) - Required - The search query string. ``` -------------------------------- ### Detect display server with capture::detect_display_server() Source: https://context7.com/jeffjose/hotshot/llms.txt Identifies the active display server environment, returning either X11 or Wayland. ```rust use hotshot_core::capture::{detect_display_server, DisplayServer}; let display_server = detect_display_server()?; match display_server { DisplayServer::X11 => println!("Running on X11"), DisplayServer::Wayland => println!("Running on Wayland"), } ``` -------------------------------- ### Capture Fullscreen via GUI API Source: https://context7.com/jeffjose/hotshot/llms.txt Capture the screen from the Tauri GUI with options for display selection and clipboard behavior. ```typescript import { captureFullscreen } from "$lib/api"; // Capture fullscreen (copies to clipboard by default) const metadata = await captureFullscreen(); console.log(`Captured: ${metadata.id} (${metadata.width}x${metadata.height})`); // Capture specific display const metadata = await captureFullscreen("HDMI-1"); // Capture without clipboard copy const metadata = await captureFullscreen(undefined, false); // Capture specific display without clipboard const metadata = await captureFullscreen("0", false); ``` -------------------------------- ### Manage Multi-monitor Captures Source: https://github.com/jeffjose/hotshot/blob/main/README.md Commands to list monitors and target specific displays for capture. ```sh hotshot display list # show connected monitors hotshot capture fullscreen -d 0 # capture only the first monitor hotshot capture fullscreen -d HDMI-1 # capture by name hotshot capture region -d 0 # interactive selection on one monitor ``` -------------------------------- ### Manage Screenshots Source: https://github.com/jeffjose/hotshot/blob/main/README.md Commands for listing, opening, deleting, tagging, and searching screenshots. ```sh hotshot list # list recent screenshots hotshot open # open screenshot in default viewer hotshot delete # move screenshot to trash hotshot tag # add tags hotshot search # search by tag, note, or id ``` -------------------------------- ### Display Management Source: https://context7.com/jeffjose/hotshot/llms.txt Lists all connected monitors with their geometry. The output format includes monitor index, name, and resolution/position. ```bash hotshot display list ``` -------------------------------- ### Capture screenshots with capture::capture() Source: https://context7.com/jeffjose/hotshot/llms.txt Captures screen content using various modes like fullscreen, region, or active window. Requires the hotshot_core::capture module. ```rust use hotshot_core::capture::{capture, CaptureMode, Region, detect_display_server}; // Fullscreen capture let mode = CaptureMode::Fullscreen; let image = capture(&mode, None)?; println!("Captured {}x{}", image.width(), image.height()); // Capture specific region let region = Region { x: 100, y: 200, width: 800, height: 600 }; let mode = CaptureMode::Region(region); let image = capture(&mode, None)?; // Interactive region selection let mode = CaptureMode::RegionInteractive; let image = capture(&mode, None)?; // Active window capture let mode = CaptureMode::ActiveWindow; let image = capture(&mode, None)?; // Capture on specific display bounds let display_bounds = Some(Region { x: 1920, y: 0, width: 2560, height: 1440 }); let image = capture(&CaptureMode::Fullscreen, display_bounds)?; ``` -------------------------------- ### Configuration API Source: https://context7.com/jeffjose/hotshot/llms.txt Methods for reading and updating application configuration settings. ```APIDOC ## getConfig() ### Description Reads the current application configuration. ### Response - **Returns** (Object) - Configuration object containing storage_dir, image settings (format, quality), and behavior settings (copy_to_clipboard, organize_by). ## updateConfig(key, value) ### Description Updates a specific configuration value. ### Parameters #### Arguments - **key** (string) - Required - The configuration key to update. - **value** (string) - Required - The new value for the configuration key. ``` -------------------------------- ### Tauri GUI Capture API Source: https://context7.com/jeffjose/hotshot/llms.txt Functions for capturing fullscreen, regions, or windows via the Tauri GUI. ```APIDOC ## captureFullscreen(display?: string, copyToClipboard?: boolean) ### Description Captures the fullscreen, optionally specifying a display and whether to copy to the clipboard. ## captureRegion(display?: string, copyToClipboard?: boolean) ### Description Initiates an interactive region capture. ## captureWindow(copyToClipboard?: boolean) ### Description Captures the currently active window. ``` -------------------------------- ### Capture Window Screenshot Source: https://context7.com/jeffjose/hotshot/llms.txt Captures the currently focused/active window. Use --clipboard to copy to clipboard and --format to specify image format. ```bash hotshot capture window ``` ```bash hotshot capture window --clipboard ``` ```bash hotshot capture window --format jpeg ``` -------------------------------- ### Save images with Storage::save() Source: https://context7.com/jeffjose/hotshot/llms.txt Persists captured images to disk with metadata, supporting format overrides. ```rust use hotshot_core::capture::{capture, CaptureMode, detect_display_server}; use hotshot_core::config::{Config, ImageFormat}; use hotshot_core::storage::Storage; let config = Config::load_or_create()?; let storage = Storage::new(config); // Capture and save let mode = CaptureMode::Fullscreen; let display_server = detect_display_server()?; let image = capture(&mode, None)?; // Save with default format from config let metadata = storage.save(&image, &mode, display_server, None)?; println!("Saved: {:?}", metadata.path); println!("ID: {}", metadata.id); // Save with specific format override let format = ImageFormat::Webp; let metadata = storage.save(&image, &mode, display_server, Some(&format))?; ``` -------------------------------- ### listMonitors() Source: https://context7.com/jeffjose/hotshot/llms.txt Retrieves information about connected displays. ```APIDOC ## listMonitors() ### Description Retrieves a list of connected monitor information for multi-display support. ### Response - **Returns** (Array) - A list of monitor objects containing: - **name** (string) - Monitor identifier. - **width** (number) - Width in pixels. - **height** (number) - Height in pixels. - **x** (number) - X coordinate. - **y** (number) - Y coordinate. ``` -------------------------------- ### Capture Fullscreen Screenshot Source: https://context7.com/jeffjose/hotshot/llms.txt Captures the entire screen or a specific monitor and saves it to the configured storage directory with automatic organization. ```APIDOC ## Capture Fullscreen Screenshot ### Description Captures the entire screen or a specific monitor and saves it to the configured storage directory with automatic organization. ### Method CLI Command ### Endpoint N/A (CLI command) ### Parameters #### Command Arguments - **capture fullscreen** - Required - Specifies the fullscreen capture mode. - **--clipboard** - Optional - Copies the screenshot to the clipboard. - **-d, --display** (string) - Optional - Specifies the monitor to capture by index or name (e.g., `0`, `HDMI-1`). - **--format** (string) - Optional - Specifies the image format (e.g., `png`, `jpeg`, `webp`). - **--output** (string) - Optional - Specifies a custom output path for the screenshot. ### Request Example ```bash hotshot capture fullscreen hotshot capture fullscreen --clipboard -d 0 --format webp --output ~/screenshot.png ``` ### Response #### Success Response Screenshots are saved to the configured storage directory or copied to the clipboard. #### Response Example N/A (CLI output, files saved) ``` -------------------------------- ### Manage Screenshots with Storage Source: https://context7.com/jeffjose/hotshot/llms.txt Perform operations on individual screenshots including finding by ID, tagging, and moving to trash. ```rust use hotshot_core::config::Config; use hotshot_core::storage::Storage; let config = Config::load_or_create()?; let storage = Storage::new(config); // Find by ID (or ID prefix) let meta = storage.find_by_id("20240115-143022-a1b2")?; let meta = storage.find_by_id("20240115")?; // Partial match // Add tags to screenshot let tags = vec!["work".to_string(), "important".to_string()]; let updated = storage.tag("20240115", &tags)?; println!("Tags: {:?}", updated.tags); // Delete screenshot (moves to trash) let deleted = storage.delete("20240115")?; println!("Deleted: {}", deleted.id); ``` -------------------------------- ### capture::list_monitors() Source: https://context7.com/jeffjose/hotshot/llms.txt Retrieves a list of all connected monitors with their names and geometry information. ```APIDOC ## capture::list_monitors() ### Description Retrieves a list of all connected monitors with their names and geometry information. ``` -------------------------------- ### Capture Window Screenshot Source: https://context7.com/jeffjose/hotshot/llms.txt Captures the currently focused/active window. ```APIDOC ## Capture Window Screenshot ### Description Captures the currently focused/active window. ### Method CLI Command ### Endpoint N/A (CLI command) ### Parameters #### Command Arguments - **capture window** - Required - Specifies the window capture mode. - **--clipboard** - Optional - Copies the screenshot to the clipboard. - **--format** (string) - Optional - Specifies the image format (e.g., `jpeg`). ### Request Example ```bash hotshot capture window hotshot capture window --clipboard --format jpeg ``` ### Response #### Success Response Screenshots are saved to the configured storage directory or copied to the clipboard. #### Response Example N/A (CLI output, files saved) ``` -------------------------------- ### Hotshot TOML Configuration File Source: https://context7.com/jeffjose/hotshot/llms.txt Defines storage, image, and behavior settings for Hotshot. Includes options for storage directory, image format and quality, filename templates, organization methods, and clipboard/notification behavior. ```toml # Base directory for screenshots storage_dir = "/home/user/Screenshots" [image] # Image format: png, jpeg, webp format = "png" # Compression quality for jpeg/webp (1-100, ignored for png) quality = 90 # Filename template. Variables: {timestamp}, {random} filename_template = "{timestamp}-{random}" [storage] # How to organize screenshots: "month" (YYYY-MM subdirs) or "none" (flat) organize_by = "month" [behavior] # Automatically copy screenshot to clipboard after capture copy_to_clipboard = false # Show desktop notification after capture notification = false ``` -------------------------------- ### capture::capture() Source: https://context7.com/jeffjose/hotshot/llms.txt Captures a screenshot using the appropriate display server with specified capture modes and optional display bounds. ```APIDOC ## capture::capture() ### Description Captures a screenshot using the appropriate display server (X11 or Wayland) with the specified capture mode and optional display bounds. ### Parameters #### Request Body - **mode** (CaptureMode) - Required - The capture mode (Fullscreen, Region, RegionInteractive, or ActiveWindow). - **display_bounds** (Option) - Optional - Specific display bounds for the capture. ``` -------------------------------- ### List and Search Screenshots via GUI API Source: https://context7.com/jeffjose/hotshot/llms.txt Retrieve screenshot history or search through existing metadata. ```typescript import { listScreenshots, searchScreenshots, getScreenshot } from "$lib/api"; // List recent screenshots const screenshots = await listScreenshots(20); screenshots.forEach(s => { console.log(`${s.id}: ${s.width}x${s.height} [${s.tags.join(", ")}]`); }); // List all screenshots const all = await listScreenshots(); // Search screenshots const results = await searchScreenshots("project"); console.log(`Found ${results.length} matches`); // Get specific screenshot by ID const screenshot = await getScreenshot("20240115-143022-a1b2"); console.log(`Path: ${screenshot.path}`); ``` -------------------------------- ### Configuration Management Source: https://context7.com/jeffjose/hotshot/llms.txt View and modify Hotshot configuration stored at `~/.config/hotshot/config.toml`. ```APIDOC ## Configuration Management ### Description View and modify Hotshot configuration stored at `~/.config/hotshot/config.toml`. ### Method CLI Command ### Endpoint N/A (CLI command) ### Parameters #### Command Arguments - **config show** - Shows the current configuration. - **config path** - Shows the path to the configuration file. - **config edit** - Opens the configuration file in the default editor. - **config set** (key=value) - Sets a specific configuration value (e.g., `format=webp`, `quality=85`). - **config reset** - Resets the configuration to default values. ### Request Example ```bash hotshot config show hotshot config path hotshot config edit hotshot config set format=webp hotshot config set storage_dir=~/Pictures/Screenshots hotshot config reset ``` ### Response #### Success Response Displays configuration information or modifies settings. #### Response Example N/A (CLI output, configuration modified) ``` -------------------------------- ### Screenshot Organization and Management Source: https://context7.com/jeffjose/hotshot/llms.txt Commands for listing, searching, tagging, and deleting saved screenshots. Use -n for custom limit, --tag for filtering by tag, and search by tag, note, or ID. Open screenshots with 'hotshot open' and add tags with 'hotshot tag'. ```bash hotshot list ``` ```bash hotshot list -n 50 ``` ```bash hotshot list --tag work ``` ```bash hotshot search "project" ``` ```bash hotshot open 20240115-143022-a1b2 ``` ```bash hotshot open 20240115 ``` ```bash hotshot tag 20240115-143022-a1b2 work important ``` ```bash hotshot delete 20240115-143022-a1b2 ``` -------------------------------- ### Storage::save() Source: https://context7.com/jeffjose/hotshot/llms.txt Saves a captured image to disk with metadata, organizing files by date. ```APIDOC ## Storage::save() ### Description Saves a captured image to disk with metadata, organizing files by date according to configuration. ### Parameters #### Request Body - **image** (Image) - Required - The captured image data. - **mode** (CaptureMode) - Required - The mode used for capture. - **display_server** (DisplayServer) - Required - The detected display server. - **format** (Option) - Optional - Override for the image format. ``` -------------------------------- ### List Connected Monitors Source: https://context7.com/jeffjose/hotshot/llms.txt Retrieves information about connected monitors, including their names, dimensions, and positions. This is useful for multi-display configurations. ```typescript import { listMonitors } from "$lib/api"; const monitors = await listMonitors(); monitors.forEach((m, i) => { console.log(`${i}: ${m.name} - ${m.width}x${m.height} at (${m.x}, ${m.y})`); }); // Example output: // 0: eDP-1 - 1920x1080 at (0, 0) // 1: HDMI-1 - 2560x1440 at (1920, 0) ``` -------------------------------- ### Capture Region or Window via GUI API Source: https://context7.com/jeffjose/hotshot/llms.txt Perform interactive region selection or capture the active window. ```typescript import { captureRegion, captureWindow } from "$lib/api"; // Interactive region capture const metadata = await captureRegion(); console.log(`Region: ${metadata.width}x${metadata.height}`); // Region capture on specific display const metadata = await captureRegion("0", true); // Active window capture const metadata = await captureWindow(); console.log(`Window captured: ${metadata.id}`); // Window capture without clipboard const metadata = await captureWindow(false); ``` -------------------------------- ### Tauri GUI Screenshot Management Source: https://context7.com/jeffjose/hotshot/llms.txt Functions for listing, searching, tagging, and deleting screenshots from the GUI. ```APIDOC ## listScreenshots(limit?: number) ### Description Retrieves a list of recent screenshots. ## searchScreenshots(query: string) ### Description Searches screenshot history based on tags or metadata. ## tagScreenshot(id: string, tags: string[]) ### Description Updates the tags for a specific screenshot. ## deleteScreenshot(id: string) ### Description Deletes a screenshot by moving it to the trash. ``` -------------------------------- ### Rust Storage Operations Source: https://context7.com/jeffjose/hotshot/llms.txt Operations for finding, tagging, and deleting individual screenshots using the Rust Storage module. ```APIDOC ## Storage Operations ### Description Provides methods to interact with stored screenshots, including finding by ID, tagging, and moving to trash. ### Methods - **find_by_id(id: &str)**: Retrieves metadata by ID or ID prefix. - **tag(id: &str, tags: &[String])**: Adds tags to a specific screenshot. - **delete(id: &str)**: Moves a screenshot to the trash. ``` -------------------------------- ### Screenshot Organization Source: https://context7.com/jeffjose/hotshot/llms.txt Commands for listing, searching, tagging, and managing saved screenshots. ```APIDOC ## Screenshot Organization ### Description Commands for listing, searching, tagging, and managing saved screenshots. ### Method CLI Command ### Endpoint N/A (CLI command) ### Parameters #### Command Arguments - **list** - Lists recent screenshots (default 20). - **-n, --limit** (integer) - Optional - Sets the number of screenshots to list. - **--tag** (string) - Optional - Filters screenshots by a specific tag. - **search** (string) - Searches screenshots by tag, note, or ID. - **open** (string) - Opens a screenshot by its ID (full or partial). - **tag** (string) - Adds tags to a specific screenshot ID. - **screenshot_id** (string) - Required - The ID of the screenshot to tag. - **tags** (string...) - Required - One or more tags to add. - **delete** (string) - Deletes a screenshot (moves to trash) by its ID. - **screenshot_id** (string) - Required - The ID of the screenshot to delete. ### Request Example ```bash hotshot list hotshot list -n 50 --tag work hotshot search "project" hotshot open 20240115-143022-a1b2 hotshot tag 20240115-143022-a1b2 work important hotshot delete 20240115-143022-a1b2 ``` ### Response #### Success Response Operations like listing, searching, tagging, opening, and deleting screenshots. #### Response Example N/A (CLI output, files managed) ``` -------------------------------- ### Tag and Delete Screenshots via GUI API Source: https://context7.com/jeffjose/hotshot/llms.txt Update tags or remove screenshots from the system via the GUI API. ```typescript import { tagScreenshot, deleteScreenshot } from "$lib/api"; // Add tags to screenshot const updated = await tagScreenshot("20240115-143022-a1b2", ["work", "important"]); console.log(`Tags: ${updated.tags.join(", ")}`); // Delete screenshot (moves to trash) const deleted = await deleteScreenshot("20240115"); console.log(`Deleted: ${deleted.id}`); ``` -------------------------------- ### Image Retrieval API Source: https://context7.com/jeffjose/hotshot/llms.txt Methods for loading screenshot images as base64 data URLs or custom protocol URLs. ```APIDOC ## readScreenshotImage(id) ### Description Retrieves a base64 data URL for a specific screenshot image. ### Parameters #### Arguments - **id** (string) - Required - The unique identifier of the screenshot. ### Response - **Returns** (string) - A base64 encoded data URL (e.g., "data:image/png;base64,..."). ## imageUrl(path) ### Description Generates a custom protocol URL for a local screenshot file. ### Parameters #### Arguments - **path** (string) - Required - The absolute file path to the screenshot. ### Response - **Returns** (string) - A hotshot:// protocol URL. ``` -------------------------------- ### Capture Region Screenshot Source: https://context7.com/jeffjose/hotshot/llms.txt Captures a selected region of the screen. Supports interactive selection or explicit geometry coordinates (X,Y,Width,Height or WxH+X+Y). Use -d for specific monitor and --clipboard for copying to clipboard. ```bash hotshot capture region ``` ```bash hotshot capture region --geometry 100,200,800,600 ``` ```bash hotshot capture region --geometry 800x600+100+200 ``` ```bash hotshot capture region -d 0 ``` ```bash hotshot capture region --clipboard --format png ``` -------------------------------- ### Parse geometry strings with capture::parse_region() Source: https://context7.com/jeffjose/hotshot/llms.txt Converts geometry strings into Region objects using comma-separated or X11-style formats. ```rust use hotshot_core::capture::parse_region; // Parse comma-separated format let region = parse_region("100,200,800,600")?; assert_eq!(region.x, 100); assert_eq!(region.y, 200); assert_eq!(region.width, 800); assert_eq!(region.height, 600); // Parse X11-style geometry format let region = parse_region("800x600+100+200")?; assert_eq!(region.width, 800); assert_eq!(region.height, 600); assert_eq!(region.x, 100); assert_eq!(region.y, 200); ``` -------------------------------- ### Capture Region Screenshot Source: https://context7.com/jeffjose/hotshot/llms.txt Captures a selected region of the screen, either through interactive selection or with explicit geometry coordinates. ```APIDOC ## Capture Region Screenshot ### Description Captures a selected region of the screen, either through interactive selection or with explicit geometry coordinates. ### Method CLI Command ### Endpoint N/A (CLI command) ### Parameters #### Command Arguments - **capture region** - Required - Specifies the region capture mode. - **--geometry** (string) - Optional - Specifies the region geometry in `X,Y,Width,Height` or `WxH+X+Y` format. - **-d, --display** (string) - Optional - Specifies the monitor for region selection by index or name. - **--clipboard** - Optional - Copies the screenshot to the clipboard. - **--format** (string) - Optional - Specifies the image format (e.g., `png`, `jpeg`). ### Request Example ```bash hotshot capture region hotshot capture region --geometry 100,200,800,600 hotshot capture region --geometry 800x600+100+200 --clipboard ``` ### Response #### Success Response Screenshots are saved to the configured storage directory or copied to the clipboard. #### Response Example N/A (CLI output, files saved) ``` -------------------------------- ### Load Screenshot Image Data Source: https://context7.com/jeffjose/hotshot/llms.txt Reads screenshot images and returns a base64 data URL for display. Use this when you need to embed images directly into HTML or other contexts that support data URLs. ```typescript import { readScreenshotImage, imageUrl } from "$lib/api"; // Get base64 data URL for image const dataUrl = await readScreenshotImage("20240115-143022-a1b2"); // Returns: "data:image/png;base64,iVBORw0KGgo..." // Use in img element const img = document.createElement("img"); img.src = dataUrl; ``` ```typescript // Alternative: use custom protocol URL const url = imageUrl("/home/user/Screenshots/2024-01/screenshot.png"); // Returns: "hotshot://localhost/home/user/Screenshots/2024-01/screenshot.png" ``` -------------------------------- ### capture::parse_region() Source: https://context7.com/jeffjose/hotshot/llms.txt Parses region geometry strings in X,Y,W,H or WxH+X+Y formats. ```APIDOC ## capture::parse_region() ### Description Parses region geometry strings in two supported formats: `X,Y,W,H` or `WxH+X+Y`. ### Parameters #### Request Body - **geometry_string** (String) - Required - The geometry string to parse. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.