From fc6168af869b5ebc6701944383dc5d83fa0e44dd Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Wed, 22 Jul 2026 21:39:15 -0700 Subject: [PATCH] Load Voxtype hotkeys when installed --- bin/omarchy-voxtype-install | 2 +- bin/omarchy-voxtype-remove | 2 +- default/hypr/bindings/voxtype.lua | 5 +++++ default/hypr/omarchy.lua | 1 + default/hypr/toggles/voxtype.lua | 3 --- migrations/1784767406.sh | 4 ++++ test/shell.d/hyprland-default-config-test.sh | 20 ++++++++++++++++++++ 7 files changed, 32 insertions(+), 5 deletions(-) create mode 100644 default/hypr/bindings/voxtype.lua delete mode 100644 default/hypr/toggles/voxtype.lua create mode 100644 migrations/1784767406.sh diff --git a/bin/omarchy-voxtype-install b/bin/omarchy-voxtype-install index 62098e61..1fd19f9d 100755 --- a/bin/omarchy-voxtype-install +++ b/bin/omarchy-voxtype-install @@ -20,7 +20,7 @@ if gum confirm "Install Voxtype + AI model (~150MB) to enable dictation?"; then fi voxtype setup systemd - omarchy-hyprland-toggle voxtype on + hyprctl reload >/dev/null omarchy-restart-shell omarchy-notification-send -g  "Voxtype Dictation Ready" "Hold F9 to dictate (or toggle with Super + Ctrl + X)." -t 10000 fi diff --git a/bin/omarchy-voxtype-remove b/bin/omarchy-voxtype-remove index 3cab07b3..08634e60 100755 --- a/bin/omarchy-voxtype-remove +++ b/bin/omarchy-voxtype-remove @@ -18,7 +18,7 @@ if omarchy-cmd-present voxtype; then omarchy-pkg-drop voxtype-bin rm -rf ~/.config/voxtype rm -rf ~/.local/share/voxtype - omarchy-hyprland-toggle voxtype off + hyprctl reload >/dev/null else echo "Voxtype was not installed." fi diff --git a/default/hypr/bindings/voxtype.lua b/default/hypr/bindings/voxtype.lua new file mode 100644 index 00000000..df594b83 --- /dev/null +++ b/default/hypr/bindings/voxtype.lua @@ -0,0 +1,5 @@ +if o.cmd_present("voxtype") then + o.bind("SUPER + CTRL + X", "Toggle dictation", "voxtype record toggle") + o.bind("F9", "Start dictation (push-to-talk)", "voxtype record start") + o.bind("F9", "Stop dictation (push-to-talk)", "voxtype record stop", { release = true }) +end diff --git a/default/hypr/omarchy.lua b/default/hypr/omarchy.lua index e4c38c30..22432001 100644 --- a/default/hypr/omarchy.lua +++ b/default/hypr/omarchy.lua @@ -10,6 +10,7 @@ if _G.omarchy_default_bindings ~= false then require("default.hypr.bindings.clipboard") require("default.hypr.bindings.tiling") require("default.hypr.bindings.utilities") + require("default.hypr.bindings.voxtype") require_optional.module("default.hypr.bindings.applications") end require("default.hypr.envs") diff --git a/default/hypr/toggles/voxtype.lua b/default/hypr/toggles/voxtype.lua deleted file mode 100644 index aa1b81b4..00000000 --- a/default/hypr/toggles/voxtype.lua +++ /dev/null @@ -1,3 +0,0 @@ -o.bind("SUPER + CTRL + X", "Toggle dictation", "voxtype record toggle") -o.bind("F9", "Start dictation (push-to-talk)", "voxtype record start") -o.bind("F9", "Stop dictation (push-to-talk)", "voxtype record stop", { release = true }) diff --git a/migrations/1784767406.sh b/migrations/1784767406.sh new file mode 100644 index 00000000..9586e1a2 --- /dev/null +++ b/migrations/1784767406.sh @@ -0,0 +1,4 @@ +echo "Remove the obsolete Voxtype Hyprland toggle" + +rm -f "$HOME/.local/state/omarchy/toggles/hypr/voxtype.lua" +hyprctl reload >/dev/null 2>&1 || true diff --git a/test/shell.d/hyprland-default-config-test.sh b/test/shell.d/hyprland-default-config-test.sh index c4ab10e4..8eea6b45 100644 --- a/test/shell.d/hyprland-default-config-test.sh +++ b/test/shell.d/hyprland-default-config-test.sh @@ -130,6 +130,26 @@ no_bindings_output=$(run_omarchy_bindings "$no_bindings_home" 'omarchy_default_b [[ -z $no_bindings_output ]] || fail "default binding variable disables all Omarchy bindings" "$no_bindings_output" pass "default binding variable disables all Omarchy bindings" +voxtype_home="$tmpdir/voxtype-home" +voxtype_bin="$tmpdir/voxtype-bin" +mkdir -p "$voxtype_home" "$voxtype_bin" +touch "$voxtype_bin/voxtype" +chmod +x "$voxtype_bin/voxtype" +voxtype_output=$(PATH="$voxtype_bin:$PATH" run_omarchy_bindings "$voxtype_home") +grep -Fq $'SUPER + CTRL + X Toggle dictation' <<<"$voxtype_output" || + fail "installed Voxtype enables its toggle binding" +grep -Fq $'F9 Start dictation (push-to-talk)' <<<"$voxtype_output" || + fail "installed Voxtype enables its push-to-talk binding" +grep -Fq $'F9 Stop dictation (push-to-talk)' <<<"$voxtype_output" || + fail "installed Voxtype enables its release binding" +pass "installed Voxtype conditionally enables dictation bindings" + +missing_voxtype_output=$(run_omarchy_bindings "$voxtype_home") +if grep -Fq $'SUPER + CTRL + X Toggle dictation' <<<"$missing_voxtype_output"; then + fail "missing Voxtype skips its bindings" +fi +pass "missing Voxtype skips dictation bindings" + migration=$(grep -rl 'Move stock Hyprland user overrides into package defaults' "$ROOT/migrations" | head -n 1 || true) [[ -n $migration ]] || fail "Hyprland default config migration exists"