aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/dot_local
diff options
context:
space:
mode:
Diffstat (limited to 'dot_local')
-rw-r--r--dot_local/bin/executable_dictate6
-rw-r--r--dot_local/bin/executable_ocr5
2 files changed, 7 insertions, 4 deletions
diff --git a/dot_local/bin/executable_dictate b/dot_local/bin/executable_dictate
index ae8b14c..dbf89b6 100644
--- a/dot_local/bin/executable_dictate
+++ b/dot_local/bin/executable_dictate
@@ -65,9 +65,9 @@ stop_and_transcribe() {
text="$(
whisper-cli -m "$model" -f "$wav_file" \
- -l "$lang" -nt -np -t "$(nproc)" 2>"$log_file" \
- | tr -s '[:space:]' ' ' \
- | sed -e 's/^ //; s/ $//'
+ -l "$lang" -nt -np -t "$(nproc)" 2>"$log_file" |
+ tr -s '[:space:]' ' ' |
+ sed -e 's/^ //; s/ $//'
)"
if [ -z "$text" ]; then
diff --git a/dot_local/bin/executable_ocr b/dot_local/bin/executable_ocr
index 6f6191f..5ce8b08 100644
--- a/dot_local/bin/executable_ocr
+++ b/dot_local/bin/executable_ocr
@@ -15,7 +15,10 @@ set -eu
lang="${TESSERACT_LANG:-eng+por}"
if [ "${1:-}" ]; then
- [ -r "$1" ] || { notify-send -u critical "📋 OCR" "Cannot read: $1"; exit 1; }
+ [ -r "$1" ] || {
+ notify-send -u critical "📋 OCR" "Cannot read: $1"
+ exit 1
+ }
text="$(tesseract "$1" - -l "$lang" 2>/dev/null || true)"
else
region="$(slurp 2>/dev/null)" || exit 0