#!/bin/bash

# archypr:summary=Install and configure Voxtype dictation
# archypr:requires-sudo=true

set -e

# Install voxtype and configure it for use.

if gum confirm "Install Voxtype + AI model (~150MB) to enable dictation?"; then
  archypr-pkg-add wtype voxtype-bin

  # Setup voxtype
  mkdir -p ~/.config/voxtype
  cp $ARCHYPR_PATH/default/voxtype/config.toml ~/.config/voxtype/

  voxtype setup --download --no-post-install
  if archypr-hw-vulkan; then
    voxtype setup gpu --enable || true
  fi
  voxtype setup systemd

  archypr-restart-waybar
  notify-send "    Voxtype Dictation Ready" "Hold F9 to dictate (or toggle with Super + Ctrl + X)." -t 10000
fi
