Fix stdin when piped, improve binary detection, replace YOUR_USERNAME

- Add `exec < /dev/tty` so `read` works correctly when run via
  `bash <(curl ...)` — fixes script failing after pasting API keys
  or clicking terminal links
- Search /opt/, /usr/lib/, /snap/bin/ and `dpkg -L` for the
  open-whispr binary — fixes "Could not find openwhispr in PATH"
- Replace YOUR_USERNAME with outis1one in all files
- Show detected binary name in summary useful commands

https://claude.ai/code/session_01XKYC1basxdwtHy71tky7xm
This commit is contained in:
Claude
2026-03-25 13:29:17 +00:00
parent da73b43b1d
commit eb092825c2
4 changed files with 68 additions and 25 deletions
+7 -7
View File
@@ -19,23 +19,23 @@ git init
git add .
git commit -m "Initial release v1.0.0"
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
```
## 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
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:
```bash
git add -A
git commit -m "Replace YOUR_USERNAME with actual username"
git commit -m "Replace outis1one with actual username"
git push
```
@@ -77,12 +77,12 @@ In the same **About** section, set the description to:
- [ ] ShellCheck CI runs on push (check **Actions** tab)
- [ ] Issue templates appear when creating new issues
- [ ] 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!
Share the one-liner with anyone who wants to install OpenWhispr:
```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
Copyright (c) 2026 YOUR_USERNAME
Copyright (c) 2026 outis1one
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
+4 -4
View File
@@ -1,7 +1,7 @@
# OpenWhispr Easy Setup
[![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.
@@ -10,13 +10,13 @@
## Quick install
```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)
```
Or clone and run:
```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
bash setup-openwhispr.sh
```
@@ -107,7 +107,7 @@ The script is idempotent:
## Troubleshooting
- [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
+56 -13
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
# 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
# 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 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 ─────────────────────────────────────────────────────
if [[ -t 1 ]]; then
@@ -565,22 +572,56 @@ OpenWhispr will open now for first-run setup.
LAUNCH_INFO
LAUNCHED=false
if command_exists openwhispr; then
openwhispr &>/dev/null &
LAUNCHED=true
elif command_exists open-whispr; then
open-whispr &>/dev/null &
LAUNCH_CMD=""
# Check PATH first, then common Electron install locations
for cmd in openwhispr open-whispr; do
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
fi
if [[ "$LAUNCHED" == true ]]; then
info "OpenWhispr launched in the background."
else
warn "Could not find openwhispr in PATH."
warn "Could not auto-detect OpenWhispr binary location."
warn "Try launching manually:"
warn " openwhispr"
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
# ══════════════════════════════════════════════════════════════════════════════
@@ -594,9 +635,11 @@ divider
# shellcheck disable=SC2059
printf "${BOLD} OpenWhispr is ready${RESET}\n"
divider
DISPLAY_CMD="${LAUNCH_CMD:-open-whispr}"
DISPLAY_CMD_BASE="$(basename "$DISPLAY_CMD")"
cat <<EOF
Hotkey: backtick (\`) — change in Settings
Hotkey: backtick (\`) — change in Settings → Hotkey
STT: ${STT_LABEL}
AI cleanup: ${CLEANUP_LABEL}
@@ -604,15 +647,15 @@ cat <<EOF
Apply now: source ${BASHRC}
Useful commands:
openwhispr launch the app
openwhispr --help show options
${DISPLAY_CMD_BASE} launch the app
${DISPLAY_CMD_BASE} --help show options
Settings → Hotkey change your hotkey
Settings → Models download better speech models
Settings → Processing change STT or AI provider
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
divider