blitztext-app-linux/linux/install.sh
mARTin-B78 80da5c6d15 Add Blitztext for Linux v1.0.0 — native dictation tool
The upstream app is macOS-only (Swift/SwiftUI, CoreML/WhisperKit) and can't
run on Linux or in a container. This adds a native host tool under linux/ that
reproduces the workflow: focus any text field, press a hotkey, speak, and the
optionally-rewritten text is typed into that field.

- Engine: pynput global hotkeys → mic record → local faster-whisper →
  optional OpenAI-compatible rewrite → xdotool typing into the focused window
- Frontends: system tray (AppIndicator, default), tkinter control panel,
  and headless modes
- Config-driven workflows in ~/.config/blitztext/config.toml with per-workflow
  prompt/model/temperature overrides
- Packaging: install.sh, requirements.txt, systemd user unit
- Targets X11; local transcription runs CPU int8 on this arm64 host

See linux/CHANGELOG.md and linux/README.md for details.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-03 22:44:28 +02:00

50 lines
1.7 KiB
Bash
Executable File

#!/usr/bin/env bash
# Set up Blitztext for Linux: create a venv, install deps, check host tools,
# and write the default config. Run from the linux/ directory.
set -euo pipefail
cd "$(dirname "$0")"
VENV=".venv"
echo "==> Checking host tools"
need_pkg=()
command -v xdotool >/dev/null || need_pkg+=("xdotool")
command -v notify-send >/dev/null || need_pkg+=("libnotify-bin")
if ! command -v pw-record >/dev/null && ! command -v arecord >/dev/null && ! command -v parecord >/dev/null; then
need_pkg+=("pipewire-bin (or alsa-utils)")
fi
if ((${#need_pkg[@]})); then
echo " Missing host tools: ${need_pkg[*]}"
echo " On Ubuntu/Debian: sudo apt install xdotool libnotify-bin pipewire-bin"
echo " (continuing — install them before running the daemon)"
fi
# --system-site-packages lets the venv see an apt-installed PyGObject (python3-gi)
# for the optional system-tray mode; harmless if it's not installed.
echo "==> Creating venv at $VENV"
python3 -m venv --system-site-packages "$VENV"
"$VENV/bin/pip" install --upgrade pip -q
"$VENV/bin/pip" install -r requirements.txt
echo "==> Writing default config (if absent)"
"$VENV/bin/python" -m blitztext config-path
cat <<EOF
Done. To start it:
$VENV/bin/python -m blitztext tray # system tray (needs: sudo apt install python3-gi)
$VENV/bin/python -m blitztext gui # control-panel window
$VENV/bin/python -m blitztext run # headless, hotkeys only
Edit your config (hotkeys, Whisper model, rewrite endpoint) at:
\$($VENV/bin/python -m blitztext config-path)
For the rewrite workflows, export your key first, e.g.:
export OPENAI_API_KEY=sk-...
To run it in the background on login, see blitztext.service in this folder.
EOF