Development Documentation¶
Resources for building, understanding, and contributing to hyprlax.
Quick Links¶
- Building - Compile hyprlax from source
- Architecture - System design and structure
- Contributing - How to contribute code
- Testing - Running and writing tests
- Custom Builds - Advanced build configurations
Getting Started¶
First Time Setup¶
- Clone the repository
- Install dependencies (see building guide)
- Build with
make debug - Run tests with
make test
Development Workflow¶
# Create feature branch
git checkout -b feature/my-feature
# Make changes and test
make debug
./hyprlax --debug test.jpg
# Run tests
make test
# Format code
# Use your editor/clang-format. No built-in 'make format' target.
# Commit changes
git add -A
git commit -m "Add my feature"
Project Overview¶
hyprlax is organized into modular components:
- Platform Layer - OS/display server abstraction
- Compositor Adapters - Compositor-specific implementations
- Renderer - OpenGL ES 2.0 rendering
- Core - Animation, configuration, layer management
- IPC - Runtime control interface
See Architecture for detailed design documentation.
Key Files¶
| File | Purpose |
|---|---|
src/main.c |
Entry point, argument parsing |
src/hyprlax_main.c |
Main application logic |
src/platform/wayland.c |
Wayland platform implementation |
src/compositor/*.c |
Compositor adapters |
src/renderer/gles2.c |
OpenGL ES 2.0 renderer |
src/core/config.c |
Configuration parsing |
src/ipc.c |
IPC server |
Development Tools¶
Debugging¶
# Debug build with symbols
make debug
# Run with debug output
./hyprlax --debug image.jpg
# Use GDB
gdb ./hyprlax
(gdb) run --debug image.jpg
# Valgrind memory check
valgrind --leak-check=full ./hyprlax image.jpg
Performance Analysis¶
# CPU profiling with perf
perf record ./hyprlax image.jpg
perf report
# GPU profiling (NVIDIA)
nvidia-smi dmon -s u
# Benchmark suite
make bench
Code Quality¶
# Format code
make format
# Static analysis
make check
# Run tests
make test
# Coverage report
# Not provided by Makefile; use external tools if needed.
Contributing Guidelines¶
Code Style¶
- 4-space indentation
- K&R brace style
- 80-100 character line limit
- Descriptive variable names
- Comments for complex logic
Commit Messages¶
component: Brief description
Longer explanation if needed. Explain what changed
and why, not how (the code shows how).
Fixes #123
Pull Request Process¶
- Fork the repository
- Create feature branch
- Make changes with tests
- Ensure tests pass
- Submit PR with description
See Contributing for full guidelines.
Testing¶
Run All Tests¶
make test
Run Specific Test¶
./tests/test_animation
./tests/test_compositor
Add New Test¶
- Create test file in
tests/ - Add to
TESTSin Makefile - Follow existing test patterns
See Testing for test writing guide.
Documentation¶
Building Docs¶
No dedicated docs build target is provided. Edit files under docs/ directly.
Documentation Style¶
- Clear, concise language
- Code examples where helpful
- Keep reference docs up-to-date
- Update changelog for features
Release Process¶
Version Bumping¶
- Update
VERSIONfile if needed (build embeds it as HYPRLAX_VERSION) - Update CHANGELOG.md
- Tag release:
git tag -a vX.Y.Z -m "Release vX.Y.Z"
Building Release¶
# Clean build
make clean
make CFLAGS="-O3 -march=native"
# Test thoroughly
make test
make bench
# Create tarball
make dist
Getting Help¶
Resources¶
- Issue Tracker
- Discussions
- Architecture docs: architecture.md
Debug Information¶
When reporting issues, include:
# System info
uname -a
echo $XDG_SESSION_TYPE
# hyprlax version
./hyprlax --version
# Debug output
./hyprlax --debug test.jpg 2>&1 | head -100