diff --git a/GITHUB_SETUP.md b/GITHUB_SETUP.md index 3e05bf5..5180dad 100644 --- a/GITHUB_SETUP.md +++ b/GITHUB_SETUP.md @@ -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) ``` diff --git a/LICENSE b/LICENSE index 9eff88f..59975cb 100644 --- a/LICENSE +++ b/LICENSE @@ -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 diff --git a/README.md b/README.md index 48bc54f..e6e4075 100644 --- a/README.md +++ b/README.md @@ -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. @@ -16,7 +16,7 @@ bash <(curl -fsSL https://raw.githubusercontent.com/outis1one/openwhispr-easy-se 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 diff --git a/setup-openwhispr.sh b/setup-openwhispr.sh index ca9e0d5..3dd2929 100755 --- a/setup-openwhispr.sh +++ b/setup-openwhispr.sh @@ -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 <