From 16ce4cabec6a361ab1dce4d6fea27277b9071776 Mon Sep 17 00:00:00 2001 From: Brad Stein Date: Thu, 16 Apr 2026 14:22:20 -0300 Subject: [PATCH] lesavka: verify client runtime prerequisites --- scripts/install/client.sh | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/scripts/install/client.sh b/scripts/install/client.sh index 2960596..a0ca13d 100755 --- a/scripts/install/client.sh +++ b/scripts/install/client.sh @@ -12,6 +12,16 @@ log() { printf '==> %s\n' "$*" } +require_command() { + local cmd=$1 + local pkg_hint=$2 + if command -v "$cmd" >/dev/null 2>&1; then + return 0 + fi + echo "❌ required command '$cmd' is unavailable after install (expected via $pkg_hint)" >&2 + exit 1 +} + mkdir -p "$TMPDIR" log "1. Installing base packages" @@ -19,7 +29,7 @@ log "1. Installing base packages" # tightly versioned PipeWire packages, and Lesavka should not force an audio # stack upgrade just to install the client. sudo pacman -Sq --needed --noconfirm \ - git rustup protobuf gcc clang evtest base-devel \ + git rustup protobuf gcc clang evtest base-devel libpulse \ gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad gst-plugins-ugly gst-libav \ wmctrl qt6-tools wl-clipboard xclip xsel desktop-file-utils @@ -50,6 +60,21 @@ fi log "1c. Ensuring input group access for $ORIG_USER" sudo usermod -aG input "$ORIG_USER" +log "1d. Verifying runtime tools" +require_command pactl "libpulse" +require_command wmctrl "wmctrl" +require_command qdbus6 "qt6-tools" +if ! command -v wl-paste >/dev/null 2>&1 \ + && ! command -v xclip >/dev/null 2>&1 \ + && ! command -v xsel >/dev/null 2>&1; then + echo "❌ no clipboard reader found after install (expected one of wl-clipboard/xclip/xsel)" >&2 + exit 1 +fi +if ! sudo -u "$ORIG_USER" pactl info >/dev/null 2>&1; then + echo "⚠️ pactl is installed, but no PulseAudio/PipeWire Pulse server is reachable right now." + echo " Lesavka will still install, but local speaker/mic staging may stay empty until the host audio session is up." +fi + # 2. Rust tool-chain for both root & user log "2. Ensuring Rust toolchain" sudo rustup default stable