Thank you for your interest in improving SoundBrake! This document covers everything you need to know to make a contribution.
- Code of Conduct
- Getting Started
- Project Structure
- Development Workflow
- Building for Each Platform
- Code Conventions
- Submitting a Pull Request
- Reporting Bugs
- Requesting Features
Please be respectful and constructive in all interactions. We follow the Contributor Covenant Code of Conduct.
| Tool | Version | Notes |
|---|---|---|
| Go | 1.21+ | https://go.dev/dl/ |
| Git | any | |
| Inno Setup | 6.x | Windows installer builds only |
| create-dmg | latest | macOS .dmg builds only — brew install create-dmg |
| fpm | latest | Linux packaging only — sudo gem install fpm |
git clone https://github.com/eneswritescode/soundbrake.git
cd soundbrake
go mod downloadgo run .The app starts immediately in the system tray. Logs go to:
- Windows:
%AppData%\SoundBrake\soundbrake.log - macOS / Linux:
~/.config/SoundBrake/soundbrake.log
soundbrake/
├── main.go Entry point
├── versioninfo.json Windows EXE metadata (icon, version string)
├── resource.syso Generated — do not edit manually
├── assets/ Icons and installer images
├── internal/
│ ├── audio/ Platform-specific volume read/write
│ │ ├── audio_windows.go WASAPI via COM
│ │ ├── audio_darwin.go osascript
│ │ └── audio_linux.go pactl / PipeWire
│ ├── i18n/ Locale detection and string loading
│ ├── icon/ Runtime tray icon renderer
│ ├── monitor/ Core state machine (polling, levels, backoff)
│ ├── notification/ Platform-specific desktop notifications
│ ├── singleinstance/ Mutex/lock-file to prevent duplicate processes
│ ├── startup/ Launch-on-login registration per platform
│ ├── tray/ System tray UI (getlantern/systray)
│ └── types/ Shared type definitions (Level, Config, …)
└── setup/
├── windows/ build.bat + soundbrake.iss (Inno Setup)
├── macos/ build.sh + entitlements.plist
└── linux/ package.sh
Key invariant: every internal/ package that has platform-specific behaviour uses Go build tags (//go:build windows, //go:build darwin, //go:build linux). If you add a new platform-specific file, follow this pattern.
# 1. Create a focused branch
git checkout -b fix/notify-cooldown-reset
# 2. Make your changes
# 3. Vet — must be clean
go vet ./...
# 4. Build for your current platform
go build -o soundbrake .
# 5. Test manually
# 6. Commit with a clear message (see convention below)
git commit -m "fix(monitor): reset cooldown timer on device change"
# 7. Push and open a PR
git push origin fix/notify-cooldown-reset<type>(<scope>): <short summary>
| Type | When to use |
|---|---|
feat |
New feature |
fix |
Bug fix |
docs |
Documentation only |
refactor |
Code change that is neither a fix nor a feature |
build |
Build scripts, CI, dependencies |
chore |
Misc housekeeping |
Scope examples: monitor, audio, tray, i18n, notification, startup, ci
setup\windows\build.batProduces setup\windows\Output\SoundBrake-Setup-x.x.x.exe.
Requirements: Go, goversioninfo (go install github.com/josephspurrier/goversioninfo/cmd/goversioninfo@latest), Inno Setup 6.
./setup/macos/build.shProduces setup/macos/SoundBrake-x.x.x.dmg.
Requirements: Go, create-dmg (brew install create-dmg).
For a signed build: SIGNING_ID="Developer ID Application: ..." ./setup/macos/build.sh
./setup/linux/package.shProduces .deb and .rpm packages under setup/linux/.
Requirements: Go, fpm (sudo gem install fpm).
- Standard
gofmtformatting — rungofmt -w .before committing, or configure your editor to format on save. - No external dependencies unless strictly necessary. The current dependency list is minimal by design.
- Build tags over
_<os>suffixes — prefer//go:build windowsover filename-only_windows.goconventions, except when both are needed for clarity (current code uses both; keep them consistent). - Error handling — return errors up the call stack; do not silently swallow them. Log at the point where context is richest.
- No global mutable state outside of
Monitor— keep the core state machine self-contained.
- Open a PR against the
mainbranch. - Fill in the pull request template.
- Make sure CI passes (build + vet on Windows, macOS, Linux).
- Keep the PR focused — one logical change per PR.
- If you're fixing a bug, reference the issue number:
Fixes #123.
PRs that introduce breaking changes to the monitor behaviour (level thresholds, cooldown logic) should include an explanation of the reasoning.
Use the Bug Report issue template. Include:
- OS and version
- SoundBrake version
- Steps to reproduce
- Relevant log lines
Use the Feature Request issue template. Search existing issues first to avoid duplicates.