From 5ea7f8b200b263cb590c26dab4b2d40b3c28d7b4 Mon Sep 17 00:00:00 2001 From: trigz Date: Sat, 15 Aug 2026 17:20:31 +1000 Subject: [PATCH 1/4] Guard the Dictation indicator click against a missing Voxtype install Clicking the bar's dictation indicator unconditionally ran `voxtype configure`, which fails with a raw "command not found" shell error when Voxtype isn't installed. Check for the binary first and route to the installer instead, matching the existing guard in the Hyprland keybindings. --- shell/plugins/bar/indicators/Dictation.qml | 2 +- test/shell.d/fixtures/indicator-contract/shell.qml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/shell/plugins/bar/indicators/Dictation.qml b/shell/plugins/bar/indicators/Dictation.qml index 57f3c3196ebe..82e438f67aab 100644 --- a/shell/plugins/bar/indicators/Dictation.qml +++ b/shell/plugins/bar/indicators/Dictation.qml @@ -33,6 +33,6 @@ BarIndicator { onPressed: function() { if (!root.bar) return - root.bar.run("omarchy-voxtype-config") + root.bar.run("omarchy-cmd-missing voxtype && omarchy-launch-floating-terminal-with-presentation omarchy-voxtype-install || omarchy-voxtype-config") } } diff --git a/test/shell.d/fixtures/indicator-contract/shell.qml b/test/shell.d/fixtures/indicator-contract/shell.qml index 0adc6adef2f5..9c985eedca5f 100644 --- a/test/shell.d/fixtures/indicator-contract/shell.qml +++ b/test/shell.d/fixtures/indicator-contract/shell.qml @@ -204,7 +204,7 @@ ShellRoot { root.injectBar(dictation) dictation.triggerPress(Qt.LeftButton) dictation.triggerPress(Qt.RightButton) - root.assertTrue(root.commandCount("omarchy-voxtype-config") === 2, "Dictation clicks run config command") + root.assertTrue(root.commandCount("omarchy-cmd-missing voxtype && omarchy-launch-floating-terminal-with-presentation omarchy-voxtype-install || omarchy-voxtype-config") === 2, "Dictation clicks check voxtype install state before opening config") root.assertTrue(root.commandCount("omarchy-voxtype-model") === 0, "Dictation clicks do not run model command") } From d6dd952acc8617f9d605a75e1dfeabdb82abc2ad Mon Sep 17 00:00:00 2001 From: trigz Date: Sat, 15 Aug 2026 17:20:36 +1000 Subject: [PATCH 2/4] Backfill the Voxtype install invitation for upgraded accounts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The one-time "Install Dictation with Voxtype" notification is registered by first-run provisioning, which existing accounts already have marked complete from before Quattro introduced Voxtype — so upgrading users never receive it and can only discover dictation is missing by hitting the raw error the previous commit fixes. Same gap already fixed once for the agent-picker invitation in 1786549201.sh; apply the same backfill here. --- migrations/1786719479.sh | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 migrations/1786719479.sh diff --git a/migrations/1786719479.sh b/migrations/1786719479.sh new file mode 100644 index 000000000000..d7728b2799c7 --- /dev/null +++ b/migrations/1786719479.sh @@ -0,0 +1,9 @@ +echo "Invite existing installs to install Voxtype dictation" + +# The invitation is installed by first-run, which existing accounts have already +# marked complete, so they would never receive it — the same gap fixed for the +# agent-picker invitation in 1786549201.sh. +# +# Post-update hooks run later in this same update, so the invitation appears +# without waiting for another one. The hook decides whether to notify. +omarchy-hook-install post-update "$OMARCHY_PATH/install/user/first-run/install-voxtype.hook" From 77cfd5fc25a677803436effbb2968baefc2c063d Mon Sep 17 00:00:00 2001 From: trigz Date: Sat, 15 Aug 2026 17:31:54 +1000 Subject: [PATCH 3/4] Move the Dictation click dispatch into a dedicated command Address review feedback on the previous commit: the inline `A && B || C` shell string in Dictation.qml could fall through to C (config) if B (the installer launch) itself failed to start, defeating the guard. Extract the dispatch into bin/omarchy-voxtype-open-config with a plain if/else, matching how every other indicator click hands off to a single omarchy-* command rather than embedding shell logic in QML. Also removes the brittle long command-string assertion from the indicator-contract fixture, and adds a focused test for the new command's install/config branching. --- bin/omarchy-voxtype-open-config | 11 ++++ shell/plugins/bar/indicators/Dictation.qml | 2 +- .../fixtures/indicator-contract/shell.qml | 2 +- test/shell.d/voxtype-open-config-test.sh | 50 +++++++++++++++++++ 4 files changed, 63 insertions(+), 2 deletions(-) create mode 100755 bin/omarchy-voxtype-open-config create mode 100755 test/shell.d/voxtype-open-config-test.sh diff --git a/bin/omarchy-voxtype-open-config b/bin/omarchy-voxtype-open-config new file mode 100755 index 000000000000..5e671ad31276 --- /dev/null +++ b/bin/omarchy-voxtype-open-config @@ -0,0 +1,11 @@ +#!/bin/bash + +# omarchy:summary=Open Voxtype configuration, or the installer if Voxtype isn't installed yet + +set -e + +if omarchy-cmd-missing voxtype; then + omarchy-launch-floating-terminal-with-presentation omarchy-voxtype-install +else + omarchy-voxtype-config +fi diff --git a/shell/plugins/bar/indicators/Dictation.qml b/shell/plugins/bar/indicators/Dictation.qml index 82e438f67aab..44aa2a6fe89f 100644 --- a/shell/plugins/bar/indicators/Dictation.qml +++ b/shell/plugins/bar/indicators/Dictation.qml @@ -33,6 +33,6 @@ BarIndicator { onPressed: function() { if (!root.bar) return - root.bar.run("omarchy-cmd-missing voxtype && omarchy-launch-floating-terminal-with-presentation omarchy-voxtype-install || omarchy-voxtype-config") + root.bar.run("omarchy-voxtype-open-config") } } diff --git a/test/shell.d/fixtures/indicator-contract/shell.qml b/test/shell.d/fixtures/indicator-contract/shell.qml index 9c985eedca5f..da81ac00f3d7 100644 --- a/test/shell.d/fixtures/indicator-contract/shell.qml +++ b/test/shell.d/fixtures/indicator-contract/shell.qml @@ -204,7 +204,7 @@ ShellRoot { root.injectBar(dictation) dictation.triggerPress(Qt.LeftButton) dictation.triggerPress(Qt.RightButton) - root.assertTrue(root.commandCount("omarchy-cmd-missing voxtype && omarchy-launch-floating-terminal-with-presentation omarchy-voxtype-install || omarchy-voxtype-config") === 2, "Dictation clicks check voxtype install state before opening config") + root.assertTrue(root.commandCount("omarchy-voxtype-open-config") === 2, "Dictation clicks open config, checking voxtype install state first") root.assertTrue(root.commandCount("omarchy-voxtype-model") === 0, "Dictation clicks do not run model command") } diff --git a/test/shell.d/voxtype-open-config-test.sh b/test/shell.d/voxtype-open-config-test.sh new file mode 100755 index 000000000000..fe48cccb13e0 --- /dev/null +++ b/test/shell.d/voxtype-open-config-test.sh @@ -0,0 +1,50 @@ +#!/bin/bash + +source "$(dirname "$0")/base-test.sh" + +test_bin=$(mktemp -d) +log_file=$(mktemp) + +cleanup() { + rm -rf "$test_bin" + rm -f "$log_file" +} +trap cleanup EXIT + +cat >"$test_bin/omarchy-launch-floating-terminal-with-presentation" <<'EOF' +#!/bin/bash +echo "install:$*" >>"$TEST_LOG" +EOF +chmod +x "$test_bin/omarchy-launch-floating-terminal-with-presentation" + +cat >"$test_bin/omarchy-voxtype-config" <<'EOF' +#!/bin/bash +echo "config" >>"$TEST_LOG" +EOF +chmod +x "$test_bin/omarchy-voxtype-config" + +run_open_config() { + local path=$1 + PATH="$path" TEST_LOG="$log_file" /bin/bash "$ROOT/bin/omarchy-voxtype-open-config" +} + +# voxtype missing: use a PATH scoped to the stubs so a real voxtype +# elsewhere on the host (e.g. this dev machine) can't leak in. +run_open_config "$test_bin:$ROOT/bin" +[[ $(cat "$log_file") == "install:omarchy-voxtype-install" ]] || + fail "opens the installer when voxtype is missing" "$(cat "$log_file")" + +: >"$log_file" + +cat >"$test_bin/voxtype" <<'EOF' +#!/bin/bash +exit 0 +EOF +chmod +x "$test_bin/voxtype" + +# voxtype present: only config runs, never the installer +run_open_config "$test_bin:$ROOT/bin" +[[ $(cat "$log_file") == "config" ]] || + fail "opens config when voxtype is installed" "$(cat "$log_file")" + +pass "Voxtype open-config dispatches to the installer or config based on install state, never both" From 95aeac0c714f1821e3fef1d3698505c64b6aa757 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sat, 15 Aug 2026 03:16:53 -0700 Subject: [PATCH 4/4] Skip the Voxtype invitation when Voxtype is already installed The backfill migration hands this hook to upgraded accounts, and Voxtype predates the upgrade, so anyone already dictating would have been served a critical toast inviting them to install what they run. Co-Authored-By: Claude Opus 5 (1M context) --- install/user/first-run/install-voxtype.hook | 4 +++- test/shell.d/voxtype-invitation-test.sh | 25 ++++++++++++++++++--- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/install/user/first-run/install-voxtype.hook b/install/user/first-run/install-voxtype.hook index eb180f810c0c..73fb8a0dc297 100644 --- a/install/user/first-run/install-voxtype.hook +++ b/install/user/first-run/install-voxtype.hook @@ -2,7 +2,9 @@ set -e -if omarchy-done ensure voxtype-install-invitation; then +# Upgraded accounts reach this hook through a backfill migration, and Voxtype +# predates the upgrade, so many of them already run it. Invite only who needs it. +if omarchy-cmd-missing voxtype && omarchy-done ensure voxtype-install-invitation; then omarchy-notification-send -u critical -g  "Install Dictation with Voxtype" \ "Click to install voice dictation for Omarchy." \ --exec "omarchy-launch-floating-terminal-with-presentation omarchy-voxtype-install" diff --git a/test/shell.d/voxtype-invitation-test.sh b/test/shell.d/voxtype-invitation-test.sh index b3eabb43f452..0d99f3611f1e 100644 --- a/test/shell.d/voxtype-invitation-test.sh +++ b/test/shell.d/voxtype-invitation-test.sh @@ -33,12 +33,30 @@ echo "systemd-run:$*" >>"$TEST_LOG" EOF chmod +x "$test_bin/systemd-run" +# Stub the presence check rather than the PATH: the hook needs the real +# coreutils, so a voxtype on the host (e.g. this dev machine) would otherwise +# decide the test. +cat >"$test_bin/omarchy-cmd-missing" <<'EOF' +#!/bin/bash +[[ -n $TEST_VOXTYPE_MISSING ]] +EOF +chmod +x "$test_bin/omarchy-cmd-missing" + run_invitation_hook() { + local voxtype_missing=$1 + cp "$ROOT/install/user/first-run/install-voxtype.hook" "$hook_path" - HOME="$test_home" PATH="$test_bin:$ROOT/bin:$PATH" TEST_LOG="$log_file" bash "$hook_path" + HOME="$test_home" PATH="$test_bin:$ROOT/bin:$PATH" TEST_LOG="$log_file" \ + TEST_VOXTYPE_MISSING="$voxtype_missing" bash "$hook_path" } -run_invitation_hook +run_invitation_hook "" + +[[ -s $log_file ]] && fail "Voxtype invitation stays quiet when voxtype is installed" "$(cat "$log_file")" +[[ -f $test_home/.local/state/omarchy/done/voxtype-install-invitation ]] && + fail "Voxtype invitation keeps its one-time marker unspent while voxtype is installed" + +run_invitation_hook 1 [[ -f $test_home/.local/state/omarchy/done/voxtype-install-invitation ]] || fail "Voxtype invitation records completion" [[ -f $hook_path ]] || fail "Voxtype invitation keeps its hook installed" @@ -47,7 +65,8 @@ grep -qx 'exec:omarchy-launch-floating-terminal-with-presentation omarchy-voxtyp fail "Voxtype invitation attaches the installer to the notification" grep -q '^systemd-run:' "$log_file" && fail "Voxtype invitation needs no unit to hold an unanswered toast" -HOME="$test_home" PATH="$test_bin:$ROOT/bin:$PATH" TEST_LOG="$log_file" bash "$hook_path" +HOME="$test_home" PATH="$test_bin:$ROOT/bin:$PATH" TEST_LOG="$log_file" \ + TEST_VOXTYPE_MISSING=1 bash "$hook_path" [[ -f $hook_path ]] || fail "completed Voxtype invitation keeps its hook installed" [[ $(grep -c '^notification$' "$log_file") -eq 1 ]] || fail "completed Voxtype invitation hook does not notify again"