RustCast Documentation

repository·master·Indexed 20 days ago

https://github.com/mystikolab/rustcast

RustCast is an open-source, high-performance popup launcher for macOS written in Rust. It provides a multi-purpose search bar for launching applications, searching files via mdfind, and performing utilities such as calculations, unit conversions, and emoji searches. Key features include a persistent SQLite-backed clipboard manager supporting text and images, window tiling via the macOS Accessibility API, and a customizable TOML configuration for hotkeys, themes, and shell commands.

Tokens
7.2K
Snippets
20
Records
46
Agent score
76%

What's inside RustCast

  1. Manage Clipboard history

    master

    RustCast includes a persistent, SQLite-backed clipboard manager:

    • Capacity: Stores up to 300 items.
    • Content Types: Supports text, images, and URLs.
    • Image Rendering: Visualizes images directly from the clipboard history.
    • Paste-on-select: Automatically pastes the selected item into the frontmost application.
    • Maintenance: You can clear the entire clipboard history via the interface.
  2. Search and Launch capabilities

    master

    RustCast provides a multi-purpose search bar for launching applications, finding files, and performing quick utilities:

    • Applications: Autoloads and searches installed macOS apps.
    • Websites: Opens raw URLs or adds https:// automatically. Use the ? suffix at the end of a query to perform a Google search.
    • Files: Searches files using mdfind (Spotlight). Results are batched and search directories are configurable.
    • Emojis: Search for emojis by name. Results are displayed in a grid layout and selecting one copies it to the clipboard.
    • Calculator: Evaluates math expressions inline using evalexpr.
    • Unit Conversions: Supports length, mass, temperature, and more.
    • Shell Commands: Execute custom shell commands with variable passing.
    • App Management: Commands to quit all apps or quit a specific app by name.
    • Personalization: Use Favourites (toggle with ♥️) and Search Aliases (map a shortcut to a longer query) to speed up workflows.
  3. Use Window Management and Tiling

    master

    RustCast can manipulate window positions and its own UI placement:

    • Window Tiling: Uses the macOS Accessibility API to tile windows into 12 specific positions:
      • Half: Left/Right, Top/Bottom
      • Quarters: Top-Left, Top-Right, Bottom-Left, Bottom-Right
      • Thirds: Left/Center/Right Third
      • Maximize
    • Launcher Positioning: The RustCast window itself can be positioned in 9 screen locations (corners, edges, or center).
    • Display Behavior: The window can be set to a Floating level (appearing above fullscreen apps) and can use Mouse-following placement (opening on the screen where the cursor is currently located).
  4. Navigate the UI with Keyboard Shortcuts

    master

    RustCast is designed for high-speed keyboard navigation:

    • Navigation:
      • Up/Down arrows for results.
      • Left/Right arrows for navigating the emoji grid.
      • Vim-style Ctrl+N (Next) and Ctrl+P (Previous).
    • Actions:
      • Enter: Open the focused result.
      • Esc: Clear search, go back, or hide the window.
      • Tab: Navigate within the settings panel.
    • Visuals: The UI supports Dark, Light, or System-following themes, custom fonts, and background effects like blur or transparency.
  5. Use RustCast features and commands

    master

    RustCast provides several built-in workflows and commands:

    • App Search: Autoloads and searches through installed applications.
    • Google Search: Type your query followed by a ? (e.g., my query?) to search Google.
    • Random Variable: Type randomvar to generate a random number between 0 and 100.
    • Clipboard History: Type cbhist to enter the clipboard history page.
    • Calculator: Perform mathematical calculations directly.
    • Unit Conversions: Convert between different units.
    • Emoji Search: Search for emojis.
    • File Search: Search for files on your system.
    • Navigation: Use CTRL n / p (Vim-style motions) to navigate search results, or use arrow keys.
  6. Configure RustCast

    master

    RustCast uses a TOML configuration file located at ~/.config/rustcast/config.toml.

    Upon first run, RustCast creates a default configuration for you. You can find the full list of configurable options in the repository's docs/config.toml or via the official Wiki.

  7. Configure RustCast via TOML

    master

    Customization is handled via a TOML configuration file located at ~/.config/rustcast/config.toml.

    Key configuration areas include:

    • Hotkeys: Define shortcuts for toggling the window (default ALT+SPACE), accessing the clipboard (default SUPER+SHIFT+C), and shell command shortcuts.
    • Modes: Map names to shell scripts to create user-defined search modes.
    • Shell Commands: Define custom commands with specific icons, aliases, and per-command hotkeys.
    • Search Aliases: Map short strings to expanded queries.
    • Buffer Rules: Control whether the search buffer clears on hide or on enter.
    • Search Settings: Configure the search URL template (defaults to DuckDuckGo) and debounce delays for file/emoji searches.
    • System Integration: Enable Start at login (via SMAppService) and Auto-update (via GitHub releases).
  8. Understand RustCast Hotkey Defaults

    master

    If hotkeys are not explicitly defined in the config.toml, RustCast falls back to the following default shortcuts:

    ActionDefault Shortcut
    Toggle UI (Show/Hide)option+space
    Clipboard Historycmd+shift+c
    ShellsDefined per shell in config
  9. Understand RustCast pages and navigation

    master

    The RustCast launcher operates across several distinct pages. You can navigate between them using the SwitchToPage(Page) message.

    Available pages:

    • Main: The primary app search interface.
    • FileSearch: Interface for searching files.
    • ClipboardHistory: Interface for viewing and managing clipboard history.
    • EmojiSearch: Interface for searching emojis.

    Note: The Settings page is handled as a separate native window outside the main launcher lifecycle.

  10. Define AppCommand behaviors

    master

    The AppCommand enum determines what happens when a user selects an app from the search results. It supports three types of actions:

    • Function(Function): Executes a specific system function (e.g., opening a URL, quitting, or tiling a window).
    • Message(Message): Dispatches a UI message within the RustCast application (e.g., switching to a different search page or opening settings).
    • Display: Performs no action other than displaying information (used for static info like version numbers).
    pub enum AppCommand {
        Function(Function),
        Message(Message),
        Display,
    }