Enable pause_media for voxtype by default (#5364)

Pauses MPRIS media players when recording starts so music
doesn't bleed into dictation. Adds the setting to the default
config for new installs and a migration for existing users.
This commit is contained in:
Pete Jackson
2026-04-20 13:53:22 +02:00
committed by GitHub
parent a9baa8f45f
commit b317bd5358
2 changed files with 17 additions and 0 deletions
+3
View File
@@ -25,6 +25,9 @@ sample_rate = 16000
# Maximum recording duration in seconds (safety limit)
max_duration_secs = 60
# Pause MPRIS media players during recording
pause_media = true
# [audio.feedback]
# Enable audio feedback sounds (beeps when recording starts/stops)
# enabled = true
+14
View File
@@ -0,0 +1,14 @@
echo "Enable pause_media in voxtype config"
VOXTYPE_CONF=~/.config/voxtype/config.toml
if [[ -f $VOXTYPE_CONF ]] && ! grep -q 'pause_media' "$VOXTYPE_CONF"; then
if grep -q '^\[audio\]' "$VOXTYPE_CONF"; then
sed -i '/^\[audio\]/a\
\
# Pause MPRIS media players during recording\
pause_media = true' "$VOXTYPE_CONF"
else
printf '\n[audio]\n# Pause MPRIS media players during recording\npause_media = true\n' >> "$VOXTYPE_CONF"
fi
fi