setup project with daemon, socket, cmd, air, notifying, state
This commit is contained in:
@@ -1,26 +1,28 @@
|
||||
# Hyprvoice
|
||||
|
||||
> **Voice‑powered typing for Wayland/Hyprland desktops** — press a global shortcut, speak, and watch words appear in whatever window you’re focused on.
|
||||
> **Voice‑powered typing for Wayland/Hyprland desktops** — press a global shortcut, speak, and watch words appear in whatever window you're focused on.
|
||||
|
||||
**🚧 Early Development Status:** This project is currently in early development. Not ready for production use yet.
|
||||
|
||||
---
|
||||
|
||||
## Why does this hyprvoice exist?
|
||||
|
||||
Typing is slow, repetitive strain injuries are real, and proprietary speech‑to‑text solutions leak your data. This project aims to give Wayland users a fast, privacy‑respecting alternative that works entirely on their own hardware _or_ any cloud ASR they trust.
|
||||
Typing is slow, repetitive strain injuries are real. This project aims to give Wayland users a fast, privacy‑respecting alternative that works entirely on their own hardware _or_ any cloud ASR they trust.
|
||||
|
||||
---
|
||||
|
||||
## Key Features
|
||||
## Current Implementation Status
|
||||
|
||||
| Category | Highlights |
|
||||
| ------------------------- | ------------------------------------------------------------------------------------------------------------ |
|
||||
| **Hot‑key daemon** | Background service triggered by a global shortcut (via `hyprctl dispatch exec …` or other compositor hooks). |
|
||||
| **Live audio capture** | Low‑latency PipeWire input with optional VAD/noise gate. |
|
||||
| **Pluggable ASR** | 🔌 Local Whisper (via `whisper.cpp`) or cloud APIs (OpenAI, Deepgram, AssemblyAI). Select at runtime. |
|
||||
| **Optional LLM polish** | Feed raw transcript into a local Ollama model or GPT‑4o to add punctuation, change tone, etc. |
|
||||
| **Text injection** | `wtype`/`ydotool` sends keystrokes to the focused surface; clipboard fallback for stubborn clients. |
|
||||
| **Zero‑friction config** | Single `~/.config/hyprvoice/config.toml` with sensible defaults and live reload on SIGHUP. |
|
||||
| **Cross‑platform binary** | Static Go build; no Python environment required. |
|
||||
| Component | Status | Description |
|
||||
| ------------------------- | ------- | ------------------------------------------------------------ |
|
||||
| **Hot‑key daemon** | ✅ Done | Background service with Unix socket IPC for command handling |
|
||||
| **Desktop notifications** | ✅ Done | Recording state changes via `notify-send` |
|
||||
| **Service management** | ✅ Done | Install/remove systemd user service with embedded unit file |
|
||||
| **Live audio capture** | 🔄 TODO | PipeWire input with VAD/noise gate |
|
||||
| **ASR backends** | 🔄 TODO | Local Whisper or cloud APIs (OpenAI, Deepgram, AssemblyAI) |
|
||||
| **Text injection** | 🔄 TODO | `wtype`/`ydotool` keystrokes to focused window |
|
||||
| **Configuration** | 🔄 TODO | TOML config file with runtime reload |
|
||||
|
||||
---
|
||||
|
||||
@@ -39,13 +41,15 @@ hyprvoice-install run --backend whispercpp
|
||||
systemctl --user enable --now hyprvoice.service
|
||||
|
||||
# 4. Add a key binding in Hyprland conf
|
||||
bind = $mod, R, exec, hyprvoice toggle
|
||||
bind = SUPER, R, exec, hyprvoice toggle
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Configuration file (`~/.config/hyprvoice/config.toml`)
|
||||
|
||||
**Note:** Configuration file support is not yet implemented. This shows the planned format:
|
||||
|
||||
```toml
|
||||
[asr]
|
||||
backend = "whispercpp" # whispercpp | openai
|
||||
@@ -68,22 +72,46 @@ All options are documented in the sample config generated by `--init`.
|
||||
|
||||
---
|
||||
|
||||
## Architecture Overview
|
||||
## Architecture
|
||||
|
||||
```
|
||||
┌──────────┐ PCM ┌──────────┐ chunks ┌──────────┐ text ┌──────────┐
|
||||
│ Hot‑key │────────▶│ Audio │────────▶│ ASR │──────▶│ Inject │
|
||||
│ Listener │ │ Capture │ │ Adapter │ │ (wtype) │
|
||||
└──────────┘ └──────────┘ └──────────┘ └──────────┘
|
||||
▲ │ │
|
||||
│ stats / errors │ ▼
|
||||
└──────────────┬────────┘ ┌──────────┐
|
||||
│ │ Desktop │
|
||||
└──────────────────▶ UI │
|
||||
└──────────┘
|
||||
┌──────────────┐ Unix Socket ┌──────────────┐ PCM ┌──────────┐
|
||||
│ CLI Client │◄────────────────│ Hot‑key │────────▶│ Audio │
|
||||
│ (toggle/stop)│ │ Daemon │ │ Capture │
|
||||
└──────────────┘ │ (hotkeydaemon│ │ (pipewire│
|
||||
│ + bus) │ │ + VAD) │
|
||||
└──────────────┘ └──────────┘
|
||||
│ │
|
||||
│ notify-send │ chunks
|
||||
▼ ▼
|
||||
┌──────────────┐ ┌──────────┐
|
||||
│ Desktop │ │ ASR │
|
||||
│ Notification │ │ Adapter │
|
||||
└──────────────┘ │(whisper/ │
|
||||
│ openai) │
|
||||
└──────────┘
|
||||
│
|
||||
│ text
|
||||
▼
|
||||
┌──────────┐
|
||||
│ Inject │
|
||||
│ (wtype/ │
|
||||
│ ydotool) │
|
||||
└──────────┘
|
||||
```
|
||||
|
||||
Each box is a Go package inside `internal/` so you can swap implementations without touching public APIs.
|
||||
**Planned Components:**
|
||||
|
||||
- `cmd/hyprvoice`: CLI with Cobra commands (existing: `serve`, `toggle`, `stop`)
|
||||
- `internal/bus`: Unix socket IPC for daemon communication (✅ implemented)
|
||||
- `internal/hotkeydaemon`: Background service managing recording state (✅ implemented)
|
||||
- `internal/notify`: Desktop notifications via `notify-send` (✅ implemented)
|
||||
- `internal/audiocapture`: PipeWire input with VAD/noise gate (🔄 TODO)
|
||||
- `internal/asr`: ASR backends (Whisper, OpenAI, etc.) (🔄 TODO)
|
||||
- `internal/inject`: Text injection via wtype/ydotool (🔄 TODO)
|
||||
- `internal/config`: TOML configuration with runtime reload (🔄 TODO)
|
||||
|
||||
Each box will be a Go package inside `internal/` so you can swap implementations without touching public APIs.
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user