Native Rust tray app that binds global shortcuts to mute/unmute individual applications' audio, plus a Mute All / Restore All shortcut. - AudioController trait with per-OS backends: WASAPI sessions (Windows), Core Audio process taps (macOS 14.2+, mute only), PulseAudio/PipeWire sink inputs (Linux) - Dedicated audio thread; hotkey presses go straight to it - Snapshot-based Mute All that restores exactly the previous state - Slint UI with software renderer; window destroyed on close - Non-activating on-screen confirmation and tray icon flash - TOML config, launch at login, start minimized, dark/light theme - Procedurally drawn icon embedded into the Windows executable - Docs, AGENTS.md, CLAUDE.md, contributing guide and CI for all three OSes
3.5 KiB
3.5 KiB
Contributing to HushKey
Thanks for helping! HushKey spans three operating systems with very different audio stacks, so testing on real machines is the most valuable contribution of all. A bug report from a Mac or a Wayland desktop is genuinely useful.
Development setup
-
Install stable Rust via rustup.
-
Install your platform's system dependencies, listed in docs/building.md.
-
Clone and run:
git clone https://github.com/X4Lo/HushKey.git cd HushKey cargo run -
Useful while developing:
cargo test # unit tests, no audio hardware needed cargo run -- --list # what does the backend see on this machine? RUST_LOG=hushkey=debug cargo run # verbose logs
Read docs/architecture.md before changing anything under src/audio/ or src/app.rs.
Coding style
cargo fmt(config inrustfmt.toml) andcargo clippy --all-targets -- -D warningsmust pass. CI enforces both.- Keep OS-specific code in
src/audio/<os>.rsbehind theAudioControllertrait. Small#[cfg]blocks elsewhere are fine when unavoidable (window attributes, tray quirks). - Don't fake capabilities a platform lacks. Return
AudioError::Unsupportedand document the limitation in the module comment,platform_note()anddocs/design-decisions.md. - No
unwrap()/expect()on OS or I/O calls in app code. Surface errors to the user via the status banner or toast. - Pure logic (parsing, state machines) gets unit tests next to the code (
#[cfg(test)] mod tests). - UI: edit
ui/*.slint. UseThemetokens fromui/theme.slintinstead of hard-coded colours, and set accessibility properties (accessible-role,accessible-label) on interactive elements. - Keep the idle footprint small: no polling while the window is hidden, no new background threads without a good reason, no webviews or GPU renderers.
Branches and pull requests
- Branch from
main:feat/<short-name>,fix/<short-name>,docs/<short-name>. - Commit messages follow Conventional Commits:
feat(audio): …,fix(macos): …,docs: …. - Keep PRs focused: one feature or fix per PR.
- In the PR description, list the OSes you actually ran the change on (e.g. "Tested: Windows 11 24H2. Compile-checked: macOS. Not tested: Linux"). Reviewers rely on this, because CI can only build and run unit tests.
- Update the docs when behaviour or platform support changes (README capability table,
docs/). - CI must be green on all three OSes before merge.
Reporting bugs
Please use the issue templates. Platform-specific details matter more than usual here:
- OS and version, e.g. Windows 11 23H2, macOS 15.1 (Apple Silicon), Ubuntu 24.04.
- Linux: session type (
echo $XDG_SESSION_TYPE), desktop environment, and audio server (pactl info | grep "Server Name"). - macOS: whether HushKey was run from an app bundle, and whether Screen & System Audio Recording permission is granted.
- HushKey version, shown in Settings → About.
- Output of
hushkey --listwhile the problem app is playing. - Logs: run with
RUST_LOG=hushkey=debugand attach the output. On Windows release builds, redirect to a file:hushkey.exe > log.txt 2>&1. - What you pressed, what you expected, and what happened. For shortcut problems, say which keyboard layout you use.
Security
Please report security issues privately via GitHub's "Report a vulnerability" feature rather than a public issue.