This commit is contained in:
+32
-7
@@ -34,19 +34,44 @@ mkdir -p "${HOME}/.config/jarvis"
|
||||
"${BARE}" packaging/write-config.js "${HOME}/.config/jarvis/config.json" "${WAKE_PHRASE}" "${MODEL_PROFILE}" "${TTS_ENABLED}"
|
||||
echo "Saved wake phrase: ${WAKE_PHRASE}; model profile: ${MODEL_PROFILE}; TTS: ${TTS_ENABLED}"
|
||||
echo
|
||||
|
||||
# The daemon owns the session D-Bus name. Start it after writing the config and
|
||||
# wait for that name before sending the preview or smoke-test request.
|
||||
DAEMON_BUS_READY=false
|
||||
if command -v systemctl >/dev/null && command -v busctl >/dev/null && [[ -n "${DBUS_SESSION_BUS_ADDRESS:-}" ]]; then
|
||||
systemctl --user daemon-reload || true
|
||||
systemctl --user enable jarvisd.service || true
|
||||
systemctl --user restart jarvisd.service || true
|
||||
for _ in {1..30}; do
|
||||
if busctl --user status io.qvac.Jarvis >/dev/null 2>&1; then
|
||||
DAEMON_BUS_READY=true
|
||||
break
|
||||
fi
|
||||
sleep 0.5
|
||||
done
|
||||
fi
|
||||
|
||||
echo "[4/5] TTS preview"
|
||||
if [[ "${TTS_ENABLED}" == true && -n "${DBUS_SESSION_BUS_ADDRESS:-}" ]]; then
|
||||
busctl --user call io.qvac.Jarvis /io/qvac/Jarvis io.qvac.Jarvis.Session Say s "JARVIS local voice preview" || true
|
||||
if [[ "${TTS_ENABLED}" == true && "${DAEMON_BUS_READY}" == true ]]; then
|
||||
busctl --user call io.qvac.Jarvis /io/qvac/Jarvis io.qvac.Jarvis.Session Say s "JARVIS local voice preview"
|
||||
elif [[ "${TTS_ENABLED}" == true ]]; then
|
||||
echo "Daemon did not register io.qvac.Jarvis; preview skipped."
|
||||
else
|
||||
echo "Session D-Bus is unavailable or TTS is disabled; preview skipped."
|
||||
echo "TTS is disabled; preview skipped."
|
||||
fi
|
||||
echo
|
||||
echo "[5/5] Typed smoke test"
|
||||
read -r -p "Type a test prompt (default: say hello): " PROMPT
|
||||
PROMPT="${PROMPT:-say hello}"
|
||||
if command -v busctl >/dev/null && [[ -n "${DBUS_SESSION_BUS_ADDRESS:-}" ]]; then
|
||||
busctl --user call io.qvac.Jarvis /io/qvac/Jarvis io.qvac.Jarvis.Session Ask s "${PROMPT}" || true
|
||||
if [[ "${DAEMON_BUS_READY}" == true ]]; then
|
||||
busctl --user call io.qvac.Jarvis /io/qvac/Jarvis io.qvac.Jarvis.Session Ask s "${PROMPT}"
|
||||
else
|
||||
echo "Session D-Bus is unavailable; saved setup and skipped live prompt."
|
||||
echo "Daemon is not available on the session D-Bus; saved setup and skipped live prompt."
|
||||
echo "Inspect with: systemctl --user status jarvisd.service"
|
||||
echo "Logs: journalctl --user -u jarvisd.service -n 80 --no-pager"
|
||||
fi
|
||||
if [[ "${DAEMON_BUS_READY}" == true ]]; then
|
||||
echo "First-run setup complete; jarvisd is running."
|
||||
else
|
||||
echo "First-run setup saved. Start with: systemctl --user enable --now jarvisd.service"
|
||||
fi
|
||||
echo "First-run setup complete. Start with: systemctl --user enable --now jarvisd.service"
|
||||
|
||||
@@ -44,7 +44,8 @@ if [[ ! -f "${CONFIG_DIR}/qvac.config.json" ]]; then
|
||||
fi
|
||||
if [[ "${1:-}" == "--enable" ]]; then
|
||||
systemctl --user daemon-reload
|
||||
systemctl --user enable --now jarvisd.service
|
||||
systemctl --user enable jarvisd.service
|
||||
systemctl --user restart jarvisd.service
|
||||
fi
|
||||
echo "Installed JARVIS-QVAC to ${APP_DIR}"
|
||||
echo "Run: ${APP_DIR}/packaging/first-run.sh"
|
||||
|
||||
Reference in New Issue
Block a user