| 12345678910111213141516171819202122232425262728293031 |
- #!/usr/bin/env bash
- # Perplexica Search TUI launcher
- # Usage: ./search.sh [--mode MODE] [--query QUERY] [--speed SPEED] [other options]
- # NOTE: Set VENV_PATH below to your own Python virtual environment path.
- set -euo pipefail
- # Find the project directory
- SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
- VENV_PATH="${VENV_PATH:-$HOME/venv/general}" # <-- Set this to your own venv path if needed
- PYTHON_BIN="$VENV_PATH/bin/python3"
- APP="$SCRIPT_DIR/perplexica-search-tui.py"
- # Check if venv exists
- if [[ ! -x "$PYTHON_BIN" ]]; then
- echo "Error: Python interpreter not found at $PYTHON_BIN"
- echo "Please create the virtual environment at $VENV_PATH"
- exit 1
- fi
- # Check if app exists
- if [[ ! -f "$APP" ]]; then
- echo "Error: Application not found at $APP"
- exit 1
- fi
- # Activate venv (optional, for subshell)
- source "$VENV_PATH/bin/activate"
- # Forward all arguments to the Python script
- exec "$PYTHON_BIN" "$APP" "$@"
|