Skip to content

Latest commit

 

History

History
135 lines (95 loc) · 3.07 KB

File metadata and controls

135 lines (95 loc) · 3.07 KB

Contributing to hypr-switcher

Thank you for your interest in contributing! This guide will help you get started.

Getting Started

  1. Fork the repository on GitHub
  2. Clone your fork locally:
git clone https://github.com/<your-username>/hypr-switcher.git
cd hypr-switcher
  1. Install dependencies (Arch Linux example):
sudo pacman -S wayland wayland-protocols libxkbcommon
  1. Build the project:
cargo build
  1. Run the tests to make sure everything works:
cargo test

Making Changes

  1. Create a branch from develop:
git checkout develop
git checkout -b feature/your-feature-name
  1. Write tests first. This project follows TDD (Test-Driven Development). Add or update tests before writing implementation code.

  2. Implement your changes. Keep them focused and minimal.

  3. Run the full test suite to make sure nothing is broken:

cargo test
  1. Build in release mode to catch any optimized-build issues:
cargo build --release

Commit Guidelines

This project uses Conventional Commits with emoji prefixes:

Type Emoji Example
feat ✨ feat(ui): add grid layout
fix 🐛 🐛 fix(ipc): handle socket timeout
docs 📝 📝 docs(readme): update installation guide
test ✅ test(app): add navigation tests
refactor ♻️ ♻️ refactor(icons): simplify fallback chain
perf ⚡ perf(ipc): reduce socket read latency
chore 🔧 🔧 chore: update dependencies

Rules:

  • Write commit messages in English, imperative mood ("add", not "added")
  • Keep the first line under 72 characters
  • One logical change per commit

Submitting a Pull Request

  1. Push your branch to your fork:
git push origin feature/your-feature-name
  1. Open a Pull Request against the develop branch (not main)

  2. In the PR description, include:

    • What the change does and why
    • How to test it
    • Screenshots if it changes the UI
  3. Wait for review. Address any feedback with new commits (don't force-push).

Project Structure

src/
├── main.rs              # Entry point, PID management, IPC listener
├── app.rs               # Application state, update loop, keyboard handling
├── hyprland/
│   ├── ipc.rs           # Hyprland Unix socket IPC
│   └── types.rs         # Data types (HyprClient, WindowEntry)
├── icons/
│   └── resolver.rs      # XDG icon resolution with theme support
└── ui/
    ├── style.rs          # Design tokens (colors, dimensions)
    └── window_list.rs    # Window card grid rendering

Testing

Run all tests:

cargo test

Run tests for a specific module:

cargo test app::
cargo test hyprland::
cargo test icons::
cargo test ui::

Run with debug logging:

RUST_LOG=debug cargo run

Code of Conduct

Be respectful and constructive. We are all here to build something useful together.