Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion bin/omarchy-install-dictation-voxtype
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ if [[ ! -e $config_home/voxtype/config.toml ]]; then
cp "$OMARCHY_PATH/default/voxtype/config.toml" "$config_home/voxtype/"
# A Vulkan runtime is not enough: aarch64 voxtype-bin ships no Vulkan backend.
if omarchy-hw-vulkan && [[ -x $voxtype_lib_path/voxtype-vulkan ]]; then
voxtype setup gpu --enable || true
# voxtype rewrites /usr/bin/voxtype, so this step needs sudo.
if ! sudo voxtype setup gpu --enable; then
echo "Warning: could not enable the Voxtype GPU backend." >&2
fi
fi
fi

Expand Down
21 changes: 17 additions & 4 deletions test/shell.d/dictation-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,12 @@ fi
SH
cat > "$test_tmp/bin/omarchy-hw-vulkan" <<'SH'
#!/bin/bash
exit 1
[[ ${DICTATION_VULKAN_AVAILABLE:-0} == 1 ]]
SH
cat > "$test_tmp/bin/sudo" <<'SH'
#!/bin/bash
printf 'sudo %s\n' "$*" >> "$DICTATION_LOG"
exit "${DICTATION_SUDO_EXIT:-0}"
SH
cat > "$test_tmp/bin/gum" <<'SH'
#!/bin/bash
Expand Down Expand Up @@ -219,11 +224,19 @@ pass "first-run Superwhisper setup stays in the background"
DICTATION_INSTALLED=superwhisper
CONFIRM_EXIT=1 omarchy-install-dictation-voxtype
[[ $(cat "$config") == "superwhisper" ]] || fail "cancelled installation preserves selection"
omarchy-install-dictation-voxtype
[[ $(omarchy-default-dictation) == "voxtype" ]] || fail "installer selects Voxtype"
touch "$test_tmp/voxtype-vulkan"
chmod +x "$test_tmp/voxtype-vulkan"
export OMARCHY_VOXTYPE_LIB_PATH="$test_tmp"
DICTATION_VULKAN_AVAILABLE=1 DICTATION_SUDO_EXIT=1 omarchy-install-dictation-voxtype 2> "$test_tmp/error"
grep -Fxq 'sudo voxtype setup gpu --enable' "$DICTATION_LOG" || fail "fresh Voxtype setup elevates GPU selection"
grep -Fq 'could not enable the Voxtype GPU backend' "$test_tmp/error" || fail "failed GPU selection warns the user"
[[ $(omarchy-default-dictation) == "voxtype" ]] || fail "GPU selection failure still lets the installer select Voxtype"
pass "Voxtype elevates GPU selection and reports failure without aborting setup"

DICTATION_INSTALLED="voxtype superwhisper"
: > "$DICTATION_LOG"
omarchy-install-dictation-voxtype
DICTATION_VULKAN_AVAILABLE=1 omarchy-install-dictation-voxtype
if grep -q 'setup gpu' "$DICTATION_LOG"; then fail "Voxtype rerun preserves the selected GPU backend"; fi
grep -q 'voxtype setup --download --no-post-install' "$DICTATION_LOG" || fail "installed Voxtype retries model setup"
printf '%s\n' 'custom model configuration' > "$XDG_CONFIG_HOME/voxtype/config.toml"
printf '%s\n' superwhisper > "$config"
Expand Down
Loading