Add tests and multi-platform keybind support (Linux, macOS, Windows)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-01 18:11:12 +03:00
parent cecd50361c
commit 4f94c4f20b
6 changed files with 340 additions and 20 deletions
+25 -9
View File
@@ -34,13 +34,14 @@ Examples: `ctrl+shift+m`, `alt+f9`, `ctrl+alt+delete`
### Modifiers
| Value | Key |
|---------|--------------|
| `ctrl` | Control |
| `shift` | Shift |
| `alt` | Alt |
| `win` | Windows key |
| `super` | Windows key |
| Value | Windows | Linux | macOS |
|---------|-------------|-------------|-------------|
| `ctrl` | Control | Control | Control |
| `shift` | Shift | Shift | Shift |
| `alt` | Alt | Alt (Mod1) | Option |
| `win` | Windows key | Super (Mod4)| Cmd |
| `super` | Windows key | Super (Mod4)| Cmd |
| `cmd` | — | — | Cmd |
### Keys
@@ -61,8 +62,23 @@ Examples: `ctrl+shift+m`, `alt+f9`, `ctrl+alt+delete`
## Build
Cross-compile for Windows from Linux/macOS:
```bash
# Windows
GOOS=windows GOARCH=amd64 go build -ldflags="-s -w" -o discord-lobby-mute.exe .
# Linux
go build -ldflags="-s -w" -o discord-lobby-mute .
# macOS
go build -ldflags="-s -w" -o discord-lobby-mute .
```
> **macOS**: the app needs Accessibility permission to register global hotkeys. Grant it in System Settings → Privacy & Security → Accessibility.
> **Linux**: requires X11 (`libx11-dev`) and CGO enabled.
## Tests
```bash
GOOS=windows GOARCH=amd64 go build -ldflags="-s -w" -o discord-lobby-mute.exe .
go test ./...
```