037c4b11df
- main.py: CustomTkinter GUI (400x520) mit Status-Indikator, Conversation-Log, Screenshot-Toggle und Settings-Dialog. Thread-sicherer UI-Queue für Hotkey-Callbacks. - hotkey_listener.py: pynput globaler Hotkey (press/release) + KeyCapturer für interaktive Hotkey-Konfiguration im Settings-Dialog. - config_manager.py: JSON-Settings in ~/.hermes-voice/settings.json mit DEFAULTS, load() merged gespeicherte mit Default-Werten. - audio_input.py: Vereinfacht auf start_recording/stop_recording/transcribe (kein Wake-Word-Loop mehr, direkt hotkey-gesteuert). - ai_client.py: Settings-dict statt config.py-Imports, MC2-URL/Modelle konfigurierbar. - requirements.txt: customtkinter>=5.2.0 + pynput>=1.7.6 hinzugefügt, pystray entfernt. - build.bat: PyInstaller --onefile --windowed → dist/HermesVoice.exe. - setup.bat: Veraltete Wake-Word-Hinweise entfernt, GUI-Check angepasst. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
40 lines
1001 B
Python
40 lines
1001 B
Python
import json
|
|
from pathlib import Path
|
|
|
|
CONFIG_DIR = Path.home() / ".hermes-voice"
|
|
SETTINGS_FILE = CONFIG_DIR / "settings.json"
|
|
|
|
DEFAULTS = {
|
|
"mc2_url": "http://192.168.178.151:9001/v1",
|
|
"chat_model": "Hermes-4-14B",
|
|
"vision_model": "Qwen3-VL-2B-Instruct",
|
|
"hotkey": "ctrl_r",
|
|
"tts_voice": "de-DE-KillianNeural",
|
|
"tts_rate": "+0%",
|
|
"whisper_model": "small",
|
|
"language": "de",
|
|
"screenshot_enabled": True,
|
|
"screenshot_monitor": 1,
|
|
"max_response_tokens": 200,
|
|
"silence_timeout": 1.5,
|
|
}
|
|
|
|
|
|
def load() -> dict:
|
|
CONFIG_DIR.mkdir(exist_ok=True)
|
|
if SETTINGS_FILE.exists():
|
|
try:
|
|
saved = json.loads(SETTINGS_FILE.read_text(encoding="utf-8"))
|
|
return {**DEFAULTS, **saved}
|
|
except Exception:
|
|
pass
|
|
return dict(DEFAULTS)
|
|
|
|
|
|
def save(settings: dict):
|
|
CONFIG_DIR.mkdir(exist_ok=True)
|
|
SETTINGS_FILE.write_text(
|
|
json.dumps(settings, indent=2, ensure_ascii=False),
|
|
encoding="utf-8",
|
|
)
|