From 5e9ff5b438e7b3001324b9345c3c311a08bf99c4 Mon Sep 17 00:00:00 2001 From: benj Date: Tue, 12 May 2026 16:42:47 +0800 Subject: add dictation scripts: vosk live + whisper batch --- scripts/dictate-toggle.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 scripts/dictate-toggle.sh (limited to 'scripts/dictate-toggle.sh') diff --git a/scripts/dictate-toggle.sh b/scripts/dictate-toggle.sh new file mode 100755 index 0000000..d5248ab --- /dev/null +++ b/scripts/dictate-toggle.sh @@ -0,0 +1,21 @@ +#!/bin/bash +# Toggle nerd-dictation (VOSK live dictation, types into focused window). +VENV_PY=~/.virtualenvs/dictate/bin/python +ND=~/.local/share/nerd-dictation/nerd-dictation +NOTIFFILE="/tmp/vosk-dictate.notif_id" + +if pgrep -f "nerd-dictation begin" >/dev/null; then + "$VENV_PY" "$ND" end + NID="" + [ -f "$NOTIFFILE" ] && NID=$(cat "$NOTIFFILE") + if [ -n "$NID" ]; then + notify-send -r "$NID" -t 1000 "Dictation" "Stopped" + else + notify-send -t 1000 "Dictation" "Stopped" + fi + rm -f "$NOTIFFILE" +else + NID=$(notify-send -p -t 0 -u low "Dictation" "Listening...") + echo "$NID" > "$NOTIFFILE" + "$VENV_PY" "$ND" begin --full-sentence & +fi -- cgit v1.2.3