hyprshell

repository·hyprshell-release·Indexed 20 days ago

https://github.com/h3rmt/hyprshell

A modern GTK4-based window switcher and application launcher designed for the Hyprland compositor. Version 4.10.8 includes a modular architecture with crates for configuration management (hyprshell-config-lib), GUI configuration editing (hyprshell-config-edit-lib), core data exchange (hyprshell-core-lib), low-level command execution (hyprshell-exec-lib), and the launcher engine (hyprshell-launcher-lib).

Tokens
57.4K
Snippets
202
Records
260
Agent score
64%

What's inside hyprshell

  1. Overview of hyprland-rs modules

    hyprshell-release

    The hyprland crate is an unofficial Rust wrapper for Hyprland's IPC. It is organized into several modules that allow you to interact with the compositor:

    • data: Retrieve information about the compositor state.
    • event_listener: Provides the EventListener struct to listen for real-time compositor events.
    • dispatch: Call Hyprland dispatchers.
    • keyword: Manage configuration options (keywords).
    • config::binds: Modify keybindings (future updates may include full config generation).
    • ctl: Execute hyprctl commands.
    • Shared module: Provides common types used across the crate.
  2. Overview of hyprshell-config-lib

    hyprshell-release

    The hyprshell-config-lib crate is responsible for managing Hyprshell configuration. Its primary responsibilities include:

    • Parsing: Converting on-disk configuration files into the internal data structures used by the application at runtime.
    • Writing: Saving configuration changes back to disk.
    • Migration: Managing versioned migration paths to ensure that user configurations remain functional as the configuration schema evolves over time.
  3. Overview of hyprshell-exec-lib

    hyprshell-release

    The hyprshell-exec-lib crate provides low-level command execution helpers used across the Hyprshell ecosystem. Its primary responsibility is implementing Hyprland-specific logic for loading system data, such as windows and workspaces.

    This crate serves as an abstraction layer for window manager interaction. To port Hyprshell to a different window manager, a developer would theoretically only need to reimplement the public functions provided by this crate.

  4. Overview of hyprshell-launcher-lib

    hyprshell-release

    The hyprshell-launcher-lib crate is the core engine for the hyprshell launcher. It is responsible for managing the lifecycle of search results and user interactions.

    Key responsibilities include:

    • Result Management: Building both static and dynamic result sets.
    • Scoring & Selection: Scoring user input against available items and determining which item is the primary candidate for display or execution.
    • Action Handling: Managing how actions are triggered once an item is selected.
    • Integrations: Providing built-in support for calculators and path resolution.
    • Matching Logic: Implementing custom matching algorithms, including support for actions that require arguments.
  5. Use hyprshell-config-edit-lib for GUI configuration editing

    hyprshell-release
    The hyprshell-config-edit-lib crate provides the GUI-side logic and data transformation helpers required to build or power a settings editor for Hyprshell. It is specifically designed to handle the component logic and data transformations for different configuration sections, allowing the application to present launcher, plugin, and runtime settings in a structured, editable format.
  6. Relm4 Ecosystem and Tools

    hyprshell-release

    Beyond the core library, the Relm4 ecosystem includes several specialized crates and tools:

    • relm4-macros: Macros for declarative UI definitions.
    • relm4-components: A collection of reusable UI components.
    • relm4-icons: A set of icons for applications.
    • relm4-template: A starter template for creating Relm4 applications in the Flatpak package format.
    • relm4-snippets: VS Code snippets to accelerate development.
  7. Use wl-clipboard-rs for Wayland clipboard operations

    hyprshell-release

    Overview

    wl-clipboard-rs is a safe Rust crate designed for terminal applications, clipboard managers, and utilities that do not spawn Wayland surfaces (windows).

    Protocol Requirements

    This crate interacts with the Wayland clipboard using either the ext-data-control or wlr-data-control protocols.

    • Regular Clipboard: Requires any version of either protocol.
    • Primary Selection: Requires any version of ext-data-control or version 2 of wlr-data-control.

    Implementation Options

    By default, the crate uses a pure Rust implementation of the Wayland client. You can change this via Cargo features:

    • native_lib: Links to libwayland-client.so for communication.
    • dlopen: Loads libwayland-client.so dynamically at runtime.

    Included Terminal Utilities

    The crate provides several command-line tools:

    • wl-paste: Mimics wl-paste from wl-clipboard.
    • wl-copy: Mimics wl-copy from wl-clipboard.
    • wl-clip: A Wayland-native version of xclip.
  8. Understand the Hyprshell project structure

    hyprshell-release

    Hyprshell is organized as a Rust workspace. The directory structure is as follows:

    Internal Libraries (crates/)

    • clipboard-lib: Clipboard management and history.
    • core-lib: Fundamental types and utilities.
    • config-lib: Configuration loading, generation, and migration.
    • config-edit-lib: The GUI settings editor.
    • exec-lib: Hyprland specific logic and plugin management.
    • launcher-lib: Logic for the application launcher.
    • windows-lib: Logic for the window switcher.

    Vendored Dependencies (dep-crates/)

    Contains local versions or forks of external libraries:

    • hyprland-rs: A fork of the Hyprland IPC library.
    • wl-clipboard-rs: A fork of the Wayland clipboard library.
    • relm4 / relm4-components: A fork of the Relm4 library.

    Other Directories

    • src/: Main entry point for the hyprshell binary.
    • scripts/: Helper scripts for CI and development.
    • nix/: Nix-related files for building and development shells.
    • docs/: Documentation files.
    • packaging/: Files for packaging Hyprshell.
  9. Understand the role of hyprshell-core-lib

    hyprshell-release
    The hyprshell-core-lib crate serves as the foundational layer for the Hyprshell ecosystem. It provides the shared types, identifiers, and transfer structs used to facilitate communication between different components of the project, such as the launcher, the configuration layer, and the UI crates. If you are building extensions or working with the internal data flow of Hyprshell, this crate defines the 'common language' for data exchange.
  10. Add hyprland-rs to your Rust project

    hyprshell-release

    To use the hyprland crate in your project, add it to your Cargo.toml dependencies. You can use the stable beta version or the master branch from GitHub if you need the latest unreleased features or fixes.

    Stable Beta Version:

    hyprland = "0.4.0-beta.3"

    Master Branch (Git): Note: Using the git dependency will prevent your crate from being published to crates.io.

    hyprland = { git = "https://github.com/hyprland-community/hyprland-rs", branch = "master" }