diff --git a/bin/omarchy-install-ai-mlx b/bin/omarchy-install-ai-mlx index e7dbe07f266..b646439542d 100755 --- a/bin/omarchy-install-ai-mlx +++ b/bin/omarchy-install-ai-mlx @@ -35,6 +35,7 @@ for artifact in \ "$PREFIX" \ "$BIN/mlx-omarchy" \ "$BIN/mlx-omarchy-demo" \ + "$BIN/mlx-omarchy-info" \ "$APPS/mlx-omarchy-demo.desktop"; do [ -e "$artifact" ] && existing+=("$artifact") done @@ -54,8 +55,8 @@ fi # Pinned installer commit and its checksum. Bump both together; never point at a # moving branch, because this menu entry runs on other people's machines. INSTALLER_REPO="joshuaswarren/mlx-omarchy" -INSTALLER_REF="286ef7297b0db6576c70d9999c6f6b005ce1c8de" -INSTALLER_SHA256="cdfa8a985d38984c68053c2765b50cc8875b7f894001c44d4c6732e47921ebf1" +INSTALLER_REF="0545dc7f8678c9d25800d37f96ab7262cb07fc2b" +INSTALLER_SHA256="993bf0222c998367c7a82732f03477723aa7d5b1a44e89edb56ee1fa977444e8" tmp="$(mktemp -d)" trap 'rm -rf "$tmp"' EXIT @@ -92,7 +93,7 @@ if [ "$status" -ne 0 ]; then else echo "Cleanup did not finish. Files may remain in:" >&2 echo " $PREFIX" >&2 - echo " $BIN/mlx-omarchy, $BIN/mlx-omarchy-demo" >&2 + echo " $BIN/mlx-omarchy, $BIN/mlx-omarchy-demo, $BIN/mlx-omarchy-info" >&2 echo " $APPS/mlx-omarchy-demo.desktop" >&2 echo "Run 'omarchy-remove-ai-mlx' before trying again." >&2 fi diff --git a/bin/omarchy-remove-ai-mlx b/bin/omarchy-remove-ai-mlx index ac5e2acd6e3..b228e6943ce 100755 --- a/bin/omarchy-remove-ai-mlx +++ b/bin/omarchy-remove-ai-mlx @@ -8,8 +8,8 @@ set -euo pipefail # Same pinned installer as the install entry: it owns the uninstall path, so the # two stay in step. Bump both together. INSTALLER_REPO="joshuaswarren/mlx-omarchy" -INSTALLER_REF="286ef7297b0db6576c70d9999c6f6b005ce1c8de" -INSTALLER_SHA256="cdfa8a985d38984c68053c2765b50cc8875b7f894001c44d4c6732e47921ebf1" +INSTALLER_REF="0545dc7f8678c9d25800d37f96ab7262cb07fc2b" +INSTALLER_SHA256="993bf0222c998367c7a82732f03477723aa7d5b1a44e89edb56ee1fa977444e8" tmp="$(mktemp -d)" trap 'rm -rf "$tmp"' EXIT diff --git a/default/omarchy/omarchy-menu.jsonc b/default/omarchy/omarchy-menu.jsonc index 3deb8e4129b..19cce816da1 100644 --- a/default/omarchy/omarchy-menu.jsonc +++ b/default/omarchy/omarchy-menu.jsonc @@ -240,7 +240,7 @@ "install.ai.chatgpt": {"icon":"","iconFont":"omarchy","label":"ChatGPT Desktop","disabled":"omarchy-pkg-present openai-codex-desktop","action":"omarchy-launch-floating-terminal-with-presentation omarchy-install-ai-chatgpt"}, "install.ai.dictation": {"icon":"","label":"Dictation","disabled":"omarchy-pkg-present voxtype-bin","action":"omarchy-launch-floating-terminal-with-presentation omarchy-voxtype-install"}, "install.ai.grok-bot": {"icon":"","iconFont":"omarchy","label":"Grok Bot","disabled":"omarchy-pkg-present grok-bot","action":"omarchy-install-and-launch 'Grok Bot' grok-bot grok-bot"}, - "install.ai.mlx": {"icon":"4","label":"MLX (Apple GPU)","description":"Apple MLX on the M1 GPU via Vulkan, with a chat demo","disabled":"omarchy-cmd-present mlx-omarchy-demo","action":"omarchy-launch-floating-terminal-with-presentation omarchy-install-ai-mlx"}, + "install.ai.mlx": {"icon":"4","label":"MLX (Apple GPU)","description":"Apple MLX on the M1 GPU via Vulkan, with a chat demo","disabled":"omarchy-cmd-present mlx-omarchy-info","action":"omarchy-launch-floating-terminal-with-presentation omarchy-install-ai-mlx"}, "install.ai.lm-studio": {"icon":"","iconFont":"omarchy","label":"LM Studio","disabled":"omarchy-pkg-present lmstudio-bin","action":"omarchy-install-app 'LM Studio' lmstudio-bin"}, "install.ai.ollama": {"icon":"","iconFont":"omarchy","label":"Ollama","disabled":"omarchy-cmd-present ollama","action":"if omarchy-cmd-present nvidia-smi; then ollama_pkg=ollama-cuda; elif omarchy-cmd-present rocminfo; then ollama_pkg=ollama-rocm; else ollama_pkg=ollama; fi; omarchy-install-app Ollama \"$ollama_pkg\""}, "install.ai.t3-code": {"icon":"","iconFont":"omarchy","label":"T3 Code","disabled":"omarchy-pkg-present t3code-bin","action":"omarchy-install-and-launch 'T3 Code' t3code-bin t3code"}, @@ -305,7 +305,7 @@ "remove.ai.chatgpt": {"icon":"","iconFont":"omarchy","label":"ChatGPT Desktop","when":"omarchy-pkg-present openai-codex-desktop","action":"omarchy-launch-floating-terminal-with-presentation omarchy-remove-ai-chatgpt"}, "remove.ai.dictation": {"icon":"","label":"Dictation","when":"omarchy-pkg-present voxtype-bin","action":"omarchy-launch-floating-terminal-with-presentation omarchy-voxtype-remove"}, "remove.ai.grok-bot": {"icon":"","iconFont":"omarchy","label":"Grok Bot","when":"omarchy-pkg-present grok-bot","action":"omarchy-launch-floating-terminal-with-presentation omarchy-remove-ai-grok-bot"}, - "remove.ai.mlx": {"icon":"4","label":"MLX (Apple GPU)","when":"omarchy-cmd-present mlx-omarchy-demo","action":"omarchy-launch-floating-terminal-with-presentation omarchy-remove-ai-mlx"}, + "remove.ai.mlx": {"icon":"4","label":"MLX (Apple GPU)","when":"omarchy-cmd-present mlx-omarchy-info","action":"omarchy-launch-floating-terminal-with-presentation omarchy-remove-ai-mlx"}, "remove.ai.lm-studio": {"icon":"","iconFont":"omarchy","label":"LM Studio","when":"omarchy-pkg-present lmstudio-bin","action":"omarchy-launch-floating-terminal-with-presentation omarchy-remove-ai-lm-studio"}, "remove.ai.ollama": {"icon":"","iconFont":"omarchy","label":"Ollama","when":"omarchy-pkg-present ollama","action":"omarchy-launch-floating-terminal-with-presentation omarchy-remove-ai-ollama"}, "remove.ai.t3-code": {"icon":"","iconFont":"omarchy","label":"T3 Code","when":"omarchy-pkg-present t3code-bin","action":"omarchy-launch-floating-terminal-with-presentation omarchy-remove-ai-t3-code"}, diff --git a/migrations/1789233600.sh b/migrations/1789233600.sh new file mode 100644 index 00000000000..2a22e067a6b --- /dev/null +++ b/migrations/1789233600.sh @@ -0,0 +1,19 @@ +echo "Add the MLX capability reporter to existing installations" + +migrate_mlx_info() ( + set -euo pipefail + local bin="$HOME/.local/bin" runner info temporary + [[ -e "$bin/mlx-omarchy-info" || -L "$bin/mlx-omarchy-info" ]] && return 0 + runner="$bin/mlx-omarchy" + [[ -x "$runner" ]] || return 0 + info=$("$runner" -I -c 'import os, mlx +print(next(p for root in mlx.__path__ + if os.access(p := os.path.join(root, "bin", "mlx-omarchy-info"), os.X_OK)))') + temporary=$(mktemp "$bin/.mlx-omarchy-info.XXXXXX") + trap 'rm -f "$temporary"' EXIT + printf '#!/usr/bin/env bash\nexec %q "$@"\n' "$info" >"$temporary" + chmod +x "$temporary" + mv -n "$temporary" "$bin/mlx-omarchy-info" +) + +migrate_mlx_info diff --git a/tests/test-ai-mlx-install-guards.sh b/tests/test-ai-mlx-install-guards.sh index 0b8af7b57d3..c9e03a102e9 100755 --- a/tests/test-ai-mlx-install-guards.sh +++ b/tests/test-ai-mlx-install-guards.sh @@ -80,10 +80,11 @@ run_entry() { echo echo "=== it refuses when an installation already exists ===" -# Each artifact on its own, because the installer's --uninstall deletes all four -# and any one of them means something is already there. +# Each artifact on its own, because the installer's --uninstall deletes all +# five and any one of them means something is already there. bin-info is the +# installed-state key the menu keys on, so it guards like the rest. i=0 -for artifact in prefix bin-launcher bin-demo desktop-entry; do +for artifact in prefix bin-launcher bin-demo bin-info desktop-entry; do i=$((i + 1)) home="$work/home$i" prefix="$home/.local/share/mlx-omarchy" @@ -92,6 +93,7 @@ for artifact in prefix bin-launcher bin-demo desktop-entry; do prefix) mkdir -p "$prefix" && echo keep >"$prefix/marker" ;; bin-launcher) echo keep >"$home/.local/bin/mlx-omarchy" ;; bin-demo) echo keep >"$home/.local/bin/mlx-omarchy-demo" ;; + bin-info) echo keep >"$home/.local/bin/mlx-omarchy-info" ;; desktop-entry) echo keep >"$home/.local/share/applications/mlx-omarchy-demo.desktop" ;; esac @@ -109,6 +111,7 @@ for artifact in prefix bin-launcher bin-demo desktop-entry; do prefix) [[ -f "$prefix/marker" ]] || fail "the existing installation was deleted" ;; bin-launcher) [[ -f "$home/.local/bin/mlx-omarchy" ]] || fail "the existing launcher was deleted" ;; bin-demo) [[ -f "$home/.local/bin/mlx-omarchy-demo" ]] || fail "the existing demo launcher was deleted" ;; + bin-info) [[ -f "$home/.local/bin/mlx-omarchy-info" ]] || fail "the existing info launcher was deleted" ;; desktop-entry) [[ -f "$home/.local/share/applications/mlx-omarchy-demo.desktop" ]] || fail "the existing desktop entry was deleted" ;; esac pass "$artifact present: refuses before any change, and keeps it"