Load Voxtype hotkeys when installed

This commit is contained in:
David Heinemeier Hansson
2026-07-22 21:39:15 -07:00
parent e294d8278f
commit fc6168af86
7 changed files with 32 additions and 5 deletions
+1 -1
View File
@@ -20,7 +20,7 @@ if gum confirm "Install Voxtype + AI model (~150MB) to enable dictation?"; then
fi fi
voxtype setup systemd voxtype setup systemd
omarchy-hyprland-toggle voxtype on hyprctl reload >/dev/null
omarchy-restart-shell omarchy-restart-shell
omarchy-notification-send -g  "Voxtype Dictation Ready" "Hold F9 to dictate (or toggle with Super + Ctrl + X)." -t 10000 omarchy-notification-send -g  "Voxtype Dictation Ready" "Hold F9 to dictate (or toggle with Super + Ctrl + X)." -t 10000
fi fi
+1 -1
View File
@@ -18,7 +18,7 @@ if omarchy-cmd-present voxtype; then
omarchy-pkg-drop voxtype-bin omarchy-pkg-drop voxtype-bin
rm -rf ~/.config/voxtype rm -rf ~/.config/voxtype
rm -rf ~/.local/share/voxtype rm -rf ~/.local/share/voxtype
omarchy-hyprland-toggle voxtype off hyprctl reload >/dev/null
else else
echo "Voxtype was not installed." echo "Voxtype was not installed."
fi fi
+5
View File
@@ -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
+1
View File
@@ -10,6 +10,7 @@ if _G.omarchy_default_bindings ~= false then
require("default.hypr.bindings.clipboard") require("default.hypr.bindings.clipboard")
require("default.hypr.bindings.tiling") require("default.hypr.bindings.tiling")
require("default.hypr.bindings.utilities") require("default.hypr.bindings.utilities")
require("default.hypr.bindings.voxtype")
require_optional.module("default.hypr.bindings.applications") require_optional.module("default.hypr.bindings.applications")
end end
require("default.hypr.envs") require("default.hypr.envs")
-3
View File
@@ -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 })
+4
View File
@@ -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
@@ -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" [[ -z $no_bindings_output ]] || fail "default binding variable disables all Omarchy bindings" "$no_bindings_output"
pass "default binding variable disables all Omarchy bindings" 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) 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" [[ -n $migration ]] || fail "Hyprland default config migration exists"