Skip to content

Commit b19cff0

Browse files
committed
chore: add config docs, all setting, and normalize volume defaults to 1
1 parent 02dd861 commit b19cff0

File tree

6 files changed

+39
-17
lines changed

6 files changed

+39
-17
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ After installation, use the `hyprwhspr` CLI to manage your installation:
211211
- `--no-systemd` - Skip systemd service setup
212212
- `--hypr-bindings` - Enable Hyprland compositor bindings
213213
- `hyprwhspr config` - Manage configuration (init/show/edit)
214+
- `hyprwhspr config show --all` - Show all settings including defaults
214215
- `hyprwhspr waybar` - Manage Waybar integration (install/remove/status)
215216
- `hyprwhspr mic-osd` - Manage microphone visualization overlay (enable/disable/status)
216217
- `hyprwhspr systemd` - Manage systemd services (install/enable/disable/status/restart)

docs/CONFIGURATION.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,25 @@ Perform basic setup and configuration via `hyprwhspr setup`.
44

55
Or use the CLI, or edit `~/.config/hyprwhspr/config.json` directly.
66

7+
The config file uses **sparse storage** and will only contain values you've explicitly changed from the defaults. This keeps your config clean and means upstream default changes apply automatically on update.
8+
9+
There is also a `$schema` reference for IDE autocompletion and validation:
10+
11+
```jsonc
12+
{
13+
"$schema": "https://raw.githubusercontent.com/goodroot/hyprwhspr/main/share/config.schema.json",
14+
"transcription_backend": "rest-api",
15+
"language": "en"
16+
}
17+
```
18+
19+
To view your overrides or the full resolved config:
20+
21+
```bash
22+
hyprwhspr config show # Show your overrides only
23+
hyprwhspr config show --all # Show all settings including defaults
24+
```
25+
726
## Minimal configuration
827

928
Only 2 essential options:

lib/cli.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ def main():
8585
config_parser = subparsers.add_parser('config', help='Configuration management')
8686
config_subparsers = config_parser.add_subparsers(dest='config_action', help='Config actions')
8787
config_subparsers.add_parser('init', help='Create default config')
88-
config_subparsers.add_parser('show', help='Display current config')
88+
config_show_parser = config_subparsers.add_parser('show', help='Display current config')
89+
config_show_parser.add_argument('--all', action='store_true', dest='show_all', help='Show all settings including defaults')
8990
config_subparsers.add_parser('edit', help='Open config in editor')
9091

9192
# waybar command
@@ -222,7 +223,7 @@ def main():
222223
if not args.config_action:
223224
config_parser.print_help()
224225
sys.exit(1)
225-
config_command(args.config_action)
226+
config_command(args.config_action, show_all=getattr(args, 'show_all', False))
226227
elif args.command == 'waybar':
227228
if not args.waybar_action:
228229
waybar_parser.print_help()

lib/src/cli_commands.py

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2172,12 +2172,12 @@ def omarchy_command(args=None):
21722172

21732173
# ==================== Config Commands ====================
21742174

2175-
def config_command(action: str):
2175+
def config_command(action: str, show_all: bool = False):
21762176
"""Handle config subcommands"""
21772177
if action == 'init':
21782178
setup_config()
21792179
elif action == 'show':
2180-
show_config()
2180+
show_config(show_all=show_all)
21812181
elif action == 'edit':
21822182
edit_config()
21832183
elif action == 'secondary-shortcut':
@@ -2240,17 +2240,18 @@ def setup_config(backend: Optional[str] = None, model: Optional[str] = None, rem
22402240
log_error(f"Failed to update config: {e}")
22412241

22422242

2243-
def show_config():
2243+
def show_config(show_all: bool = False):
22442244
"""Display current config"""
2245-
config_file = USER_CONFIG_DIR / 'config.json'
2246-
2247-
if not config_file.exists():
2248-
log_error("Config file not found. Run 'hyprwhspr config init' first.")
2249-
return
2250-
22512245
try:
2252-
with open(config_file, 'r', encoding='utf-8') as f:
2253-
config = json.load(f)
2246+
if show_all:
2247+
config = ConfigManager().get_all_settings()
2248+
else:
2249+
config_file = USER_CONFIG_DIR / 'config.json'
2250+
if not config_file.exists():
2251+
log_error("Config file not found. Run 'hyprwhspr config init' first.")
2252+
return
2253+
with open(config_file, 'r', encoding='utf-8') as f:
2254+
config = json.load(f)
22542255
print(json.dumps(config, indent=2))
22552256
except (json.JSONDecodeError, IOError) as e:
22562257
log_error(f"Failed to read config: {e}")

lib/src/config_manager.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,10 @@ def __init__(self):
8080
'onnx_asr_use_vad': True, # Use VAD for long recordings (>30s)
8181
# Audio feedback settings
8282
'audio_feedback': False, # Play sounds on recording start/stop/error
83-
'audio_volume': 0.5, # Master audio feedback volume (0.0-1.0)
83+
'audio_volume': 1.0, # Master audio feedback volume (0.0-1.0)
8484
'start_sound_volume': 1.0, # Volume multiplier for start sound
8585
'stop_sound_volume': 1.0, # Volume multiplier for stop sound
86-
'error_sound_volume': 0.5, # Volume multiplier for error sound
86+
'error_sound_volume': 1.0, # Volume multiplier for error sound
8787
'start_sound_path': None, # Custom path for start sound (None = built-in ping-up.ogg)
8888
'stop_sound_path': None, # Custom path for stop sound (None = built-in ping-down.ogg)
8989
'error_sound_path': None, # Custom path for error sound (None = built-in ping-error.ogg)

share/config.schema.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@
253253
"type": "number",
254254
"minimum": 0,
255255
"maximum": 1,
256-
"default": 0.5,
256+
"default": 1.0,
257257
"description": "Master audio feedback volume (0.0-1.0)"
258258
},
259259
"start_sound_volume": {
@@ -274,7 +274,7 @@
274274
"type": "number",
275275
"minimum": 0,
276276
"maximum": 1,
277-
"default": 0.5,
277+
"default": 1.0,
278278
"description": "Volume multiplier for error sound"
279279
},
280280
"start_sound_path": {

0 commit comments

Comments
 (0)