Merge pull request #2 from outis1one/claude/create-bash-installer-GSmST

Fix stdin when piped, improve binary detection, replace YOUR_USERNAME
This commit is contained in:
Outis
2026-03-25 09:32:27 -04:00
committed by GitHub
4 changed files with 67 additions and 24 deletions
+7 -7
View File
@@ -19,23 +19,23 @@ git init
git add . git add .
git commit -m "Initial release v1.0.0" git commit -m "Initial release v1.0.0"
git branch -M main git branch -M main
git remote add origin https://github.com/YOUR_USERNAME/openwhispr-easy-setup.git git remote add origin https://github.com/outis1one/openwhispr-easy-setup.git
git push -u origin main git push -u origin main
``` ```
## 3. Replace YOUR_USERNAME placeholder ## 3. Replace outis1one placeholder
Replace `YOUR_USERNAME` with your actual GitHub username in all files: Replace `outis1one` with your actual GitHub username in all files:
```bash ```bash
sed -i 's/YOUR_USERNAME/your-actual-username/g' setup-openwhispr.sh README.md GITHUB_SETUP.md LICENSE sed -i 's/outis1one/your-actual-username/g' setup-openwhispr.sh README.md GITHUB_SETUP.md LICENSE
``` ```
Then commit: Then commit:
```bash ```bash
git add -A git add -A
git commit -m "Replace YOUR_USERNAME with actual username" git commit -m "Replace outis1one with actual username"
git push git push
``` ```
@@ -77,12 +77,12 @@ In the same **About** section, set the description to:
- [ ] ShellCheck CI runs on push (check **Actions** tab) - [ ] ShellCheck CI runs on push (check **Actions** tab)
- [ ] Issue templates appear when creating new issues - [ ] Issue templates appear when creating new issues
- [ ] PR template appears when opening a pull request - [ ] PR template appears when opening a pull request
- [ ] `bash <(curl -fsSL https://raw.githubusercontent.com/YOUR_USERNAME/openwhispr-easy-setup/main/setup-openwhispr.sh)` works - [ ] `bash <(curl -fsSL https://raw.githubusercontent.com/outis1one/openwhispr-easy-setup/main/setup-openwhispr.sh)` works
## Done! ## Done!
Share the one-liner with anyone who wants to install OpenWhispr: Share the one-liner with anyone who wants to install OpenWhispr:
```bash ```bash
bash <(curl -fsSL https://raw.githubusercontent.com/YOUR_USERNAME/openwhispr-easy-setup/main/setup-openwhispr.sh) bash <(curl -fsSL https://raw.githubusercontent.com/outis1one/openwhispr-easy-setup/main/setup-openwhispr.sh)
``` ```
+1 -1
View File
@@ -1,6 +1,6 @@
MIT License MIT License
Copyright (c) 2026 YOUR_USERNAME Copyright (c) 2026 outis1one
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
+3 -3
View File
@@ -1,7 +1,7 @@
# OpenWhispr Easy Setup # OpenWhispr Easy Setup
[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE) [![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
[![ShellCheck](https://github.com/YOUR_USERNAME/openwhispr-easy-setup/actions/workflows/lint.yml/badge.svg)](https://github.com/YOUR_USERNAME/openwhispr-easy-setup/actions/workflows/lint.yml) [![ShellCheck](https://github.com/outis1one/openwhispr-easy-setup/actions/workflows/lint.yml/badge.svg)](https://github.com/outis1one/openwhispr-easy-setup/actions/workflows/lint.yml)
**One-command installer for [OpenWhispr](https://github.com/OpenWhispr/openwhispr) on Linux** — distro detection, dependencies, API keys, first-run setup. **One-command installer for [OpenWhispr](https://github.com/OpenWhispr/openwhispr) on Linux** — distro detection, dependencies, API keys, first-run setup.
@@ -16,7 +16,7 @@ bash <(curl -fsSL https://raw.githubusercontent.com/outis1one/openwhispr-easy-se
Or clone and run: Or clone and run:
```bash ```bash
git clone https://github.com/YOUR_USERNAME/openwhispr-easy-setup.git git clone https://github.com/outis1one/openwhispr-easy-setup.git
cd openwhispr-easy-setup cd openwhispr-easy-setup
bash setup-openwhispr.sh bash setup-openwhispr.sh
``` ```
@@ -107,7 +107,7 @@ The script is idempotent:
## Troubleshooting ## Troubleshooting
- [OpenWhispr Troubleshooting Guide](https://github.com/OpenWhispr/openwhispr/blob/main/TROUBLESHOOTING.md) - [OpenWhispr Troubleshooting Guide](https://github.com/OpenWhispr/openwhispr/blob/main/TROUBLESHOOTING.md)
- [Open an issue](https://github.com/YOUR_USERNAME/openwhispr-easy-setup/issues/new/choose) - [Open an issue](https://github.com/outis1one/openwhispr-easy-setup/issues/new/choose)
## License ## License
+56 -13
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# setup-openwhispr.sh — One-command installer for OpenWhispr on Linux # setup-openwhispr.sh — One-command installer for OpenWhispr on Linux
# https://github.com/YOUR_USERNAME/openwhispr-easy-setup # https://github.com/outis1one/openwhispr-easy-setup
# License: MIT # License: MIT
# Do NOT use set -e — we handle errors explicitly # Do NOT use set -e — we handle errors explicitly
@@ -11,6 +11,13 @@ readonly MARKER="# Added by openwhispr-easy-setup"
readonly GITHUB_API="https://api.github.com/repos/OpenWhispr/openwhispr/releases/latest" readonly GITHUB_API="https://api.github.com/repos/OpenWhispr/openwhispr/releases/latest"
readonly TMP_DIR="/tmp/openwhispr-install" readonly TMP_DIR="/tmp/openwhispr-install"
# ── Ensure interactive input works when piped (bash <(curl ...)) ──────────────
# When run via bash <(curl ...), stdin is the curl stream, not the terminal.
# We must read user input from /dev/tty instead.
if [[ ! -t 0 ]] && [[ -e /dev/tty ]]; then
exec < /dev/tty
fi
# ── Colours & formatting ───────────────────────────────────────────────────── # ── Colours & formatting ─────────────────────────────────────────────────────
if [[ -t 1 ]]; then if [[ -t 1 ]]; then
@@ -565,22 +572,56 @@ OpenWhispr will open now for first-run setup.
LAUNCH_INFO LAUNCH_INFO
LAUNCHED=false LAUNCHED=false
if command_exists openwhispr; then LAUNCH_CMD=""
openwhispr &>/dev/null &
LAUNCHED=true # Check PATH first, then common Electron install locations
elif command_exists open-whispr; then for cmd in openwhispr open-whispr; do
open-whispr &>/dev/null & if command_exists "$cmd"; then
LAUNCH_CMD="$cmd"
break
fi
done
# If not in PATH, search common install directories
if [[ -z "$LAUNCH_CMD" ]]; then
for path in \
/opt/OpenWhispr/open-whispr \
/opt/open-whispr/open-whispr \
/opt/openwhispr/openwhispr \
/usr/lib/open-whispr/open-whispr \
/usr/lib/openwhispr/openwhispr \
/snap/bin/openwhispr \
/snap/bin/open-whispr; do
if [[ -x "$path" ]]; then
LAUNCH_CMD="$path"
break
fi
done
fi
# Last resort: ask dpkg where it installed the binary
if [[ -z "$LAUNCH_CMD" ]] && command_exists dpkg; then
LAUNCH_CMD="$(dpkg -L open-whispr 2>/dev/null | grep -E '/bin/|/opt/' | head -1 || true)"
if [[ -n "$LAUNCH_CMD" && ! -x "$LAUNCH_CMD" ]]; then
LAUNCH_CMD=""
fi
fi
if [[ -n "$LAUNCH_CMD" ]]; then
"$LAUNCH_CMD" &>/dev/null &
LAUNCHED=true LAUNCHED=true
fi fi
if [[ "$LAUNCHED" == true ]]; then if [[ "$LAUNCHED" == true ]]; then
info "OpenWhispr launched in the background." info "OpenWhispr launched in the background."
else else
warn "Could not find openwhispr in PATH." warn "Could not auto-detect OpenWhispr binary location."
warn "Try launching manually:" warn "Try launching manually:"
warn " openwhispr"
warn " open-whispr" warn " open-whispr"
warn " /opt/openwhispr/openwhispr" warn " openwhispr"
if command_exists dpkg; then
warn " Find it: dpkg -L open-whispr | grep bin"
fi
fi fi
# ══════════════════════════════════════════════════════════════════════════════ # ══════════════════════════════════════════════════════════════════════════════
@@ -594,9 +635,11 @@ divider
# shellcheck disable=SC2059 # shellcheck disable=SC2059
printf "${BOLD} OpenWhispr is ready${RESET}\n" printf "${BOLD} OpenWhispr is ready${RESET}\n"
divider divider
DISPLAY_CMD="${LAUNCH_CMD:-open-whispr}"
DISPLAY_CMD_BASE="$(basename "$DISPLAY_CMD")"
cat <<EOF cat <<EOF
Hotkey: backtick (\`) — change in Settings Hotkey: backtick (\`) — change in Settings → Hotkey
STT: ${STT_LABEL} STT: ${STT_LABEL}
AI cleanup: ${CLEANUP_LABEL} AI cleanup: ${CLEANUP_LABEL}
@@ -604,15 +647,15 @@ cat <<EOF
Apply now: source ${BASHRC} Apply now: source ${BASHRC}
Useful commands: Useful commands:
openwhispr launch the app ${DISPLAY_CMD_BASE} launch the app
openwhispr --help show options ${DISPLAY_CMD_BASE} --help show options
Settings → Hotkey change your hotkey Settings → Hotkey change your hotkey
Settings → Models download better speech models Settings → Models download better speech models
Settings → Processing change STT or AI provider Settings → Processing change STT or AI provider
Troubleshoot: https://github.com/OpenWhispr/openwhispr/blob/main/TROUBLESHOOTING.md Troubleshoot: https://github.com/OpenWhispr/openwhispr/blob/main/TROUBLESHOOTING.md
This installer: https://github.com/YOUR_USERNAME/openwhispr-easy-setup This installer: https://github.com/outis1one/openwhispr-easy-setup
EOF EOF
divider divider