From 64ebfc4e1ee54c810695b982239835609bbe02c3 Mon Sep 17 00:00:00 2001 From: mARTin-B78 Date: Fri, 5 Jun 2026 16:14:35 +0200 Subject: [PATCH] Add one-line installer (curl | bash) for Ubuntu/Debian install-linux.sh: standalone script that clones from GitHub, builds the .deb, installs it with apt, and cleans up. Works on any Ubuntu/Debian machine with a single curl command. README: add the one-liner as the primary install option (Option A). --- README.md | 14 +++++-- install-linux.sh | 100 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 111 insertions(+), 3 deletions(-) create mode 100755 install-linux.sh diff --git a/README.md b/README.md index 890716d..e43f4dc 100644 --- a/README.md +++ b/README.md @@ -90,9 +90,17 @@ Stream: hotkey → mic PCM chunks → Riva/NIM WebSocket → live words typed ## Installation & Setup -### Option A — Debian Package (recommended for Ubuntu/Debian) +### Option A — One-line installer (recommended) -Build a `.deb` and install it. No pip, no network needed at install time: +Install on any Ubuntu/Debian machine with a single command: + +```bash +curl -fsSL https://raw.githubusercontent.com/mARTin-B78/blitztext-app-linux/main/install-linux.sh | bash +``` + +This clones the repo, builds a `.deb`, installs it with `apt` (pulling in all dependencies), and cleans up. After it finishes, **Blitztext** appears in your app grid. + +### Option B — Build the Debian package yourself ```bash git clone https://github.com/mARTin-B78/blitztext-app-linux.git @@ -103,7 +111,7 @@ sudo apt install ./dist/blitztext_*.deb This installs Blitztext to `/opt/blitztext`, adds a **Blitztext** entry to your application menu, installs the app icon, and pulls in system dependencies automatically. Remove with `sudo apt remove blitztext`. -### Option B — Run from Source (venv) +### Option C — Run from Source (venv) ```bash git clone https://github.com/mARTin-B78/blitztext-app-linux.git diff --git a/install-linux.sh b/install-linux.sh new file mode 100755 index 0000000..388997f --- /dev/null +++ b/install-linux.sh @@ -0,0 +1,100 @@ +#!/usr/bin/env bash +# Install Blitztext for Linux from GitHub. +# +# Usage (any Ubuntu/Debian machine): +# curl -fsSL https://raw.githubusercontent.com/mARTin-B78/blitztext-app-linux/main/install-linux.sh | bash +# +# Or clone first and run locally: +# git clone https://github.com/mARTin-B78/blitztext-app-linux.git +# bash blitztext-app-linux/install-linux.sh +# +# What it does: +# 1. Installs build tools (git, fakeroot, dpkg-dev) if missing +# 2. Clones the repo to a temp directory +# 3. Builds a .deb package +# 4. Installs it with apt (pulls in all runtime dependencies) +# 5. Cleans up the temp directory +# +# After install: +# - "Blitztext" appears in your app grid +# - Or run: blitztext tray +# - Remove: sudo apt remove blitztext +set -euo pipefail + +REPO="https://github.com/mARTin-B78/blitztext-app-linux.git" +BRANCH="main" + +# --- helpers ---------------------------------------------------------------- +info() { echo -e "\033[1;34m==>\033[0m \033[1m$*\033[0m"; } +ok() { echo -e "\033[1;32m==>\033[0m \033[1m$*\033[0m"; } +fail() { echo -e "\033[1;31m==>\033[0m \033[1m$*\033[0m" >&2; exit 1; } + +command_exists() { command -v "$1" &>/dev/null; } + +# --- preflight -------------------------------------------------------------- +info "Blitztext for Linux — installer" + +# Detect package manager +if command_exists apt; then + PKG=apt +elif command_exists apt-get; then + PKG=apt-get +else + fail "This installer requires apt (Ubuntu/Debian). For other distros, install from source: see the README." +fi + +# Ensure we can sudo +if ! sudo -n true 2>/dev/null; then + info "This installer needs sudo to install packages." + sudo true || fail "sudo failed." +fi + +# --- install build dependencies --------------------------------------------- +BUILD_DEPS=() +command_exists git || BUILD_DEPS+=(git) +command_exists fakeroot || BUILD_DEPS+=(fakeroot) +command_exists dpkg-deb || BUILD_DEPS+=(dpkg-dev) + +if ((${#BUILD_DEPS[@]})); then + info "Installing build tools: ${BUILD_DEPS[*]}" + sudo $PKG install -y "${BUILD_DEPS[@]}" +fi + +# --- clone ------------------------------------------------------------------ +TMPDIR="$(mktemp -d)" +trap 'rm -rf "$TMPDIR"' EXIT + +info "Cloning $REPO ($BRANCH)…" +git clone --depth 1 --branch "$BRANCH" "$REPO" "$TMPDIR/blitztext-app-linux" + +# --- build .deb ------------------------------------------------------------- +info "Building .deb package…" +LINUX_DIR="$TMPDIR/blitztext-app-linux/linux" +OUT_DIR="$TMPDIR/out" +mkdir -p "$OUT_DIR" +OUT_DIR="$OUT_DIR" bash "$LINUX_DIR/packaging/build-deb.sh" + +DEB="$(ls "$OUT_DIR"/*.deb 2>/dev/null | head -1)" +if [ -z "$DEB" ] || [ ! -f "$DEB" ]; then + fail "Build failed — no .deb produced." +fi + +# --- install ---------------------------------------------------------------- +info "Installing $(basename "$DEB")…" +sudo $PKG install -y "$DEB" + +# --- done ------------------------------------------------------------------- +VER="$(dpkg -s blitztext 2>/dev/null | grep '^Version:' | cut -d' ' -f2)" +ok "Blitztext ${VER:-} installed!" +echo "" +echo " Launch from your app grid, or run:" +echo " blitztext tray # system tray (recommended)" +echo " blitztext gui # control-panel window" +echo " blitztext run # headless, hotkeys only" +echo "" +echo " For rewrite workflows, set your API key first:" +echo " export OPENAI_API_KEY=sk-..." +echo "" +echo " Remove:" +echo " sudo apt remove blitztext" +echo ""