From ed795d8a13785678cba36a8635e5f8e976782ea2 Mon Sep 17 00:00:00 2001 From: Rob Zolkos Date: Thu, 13 Aug 2026 13:33:22 -0400 Subject: [PATCH] Select packaged Cursor for theme sync (#6808) --- bin/omarchy-theme-set-vscode | 2 +- test/shell.d/vscode-theme-test.sh | 41 +++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100755 test/shell.d/vscode-theme-test.sh diff --git a/bin/omarchy-theme-set-vscode b/bin/omarchy-theme-set-vscode index d91b8ba0..c87b6bb8 100755 --- a/bin/omarchy-theme-set-vscode +++ b/bin/omarchy-theme-set-vscode @@ -150,4 +150,4 @@ set_theme() { ! omarchy-toggle-enabled skip-vscode-theme-changes && set_theme "code" "$HOME/.config/Code/User/settings.json" "$HOME/.vscode/extensions" ! omarchy-toggle-enabled skip-vscode-insiders-theme-changes && set_theme "code-insiders" "$HOME/.config/Code - Insiders/User/settings.json" "$HOME/.vscode-insiders/extensions" ! omarchy-toggle-enabled skip-codium-theme-changes && set_theme "codium" "$HOME/.config/VSCodium/User/settings.json" "$HOME/.vscode-oss/extensions" -! omarchy-toggle-enabled skip-cursor-theme-changes && set_theme "cursor" "$HOME/.config/Cursor/User/settings.json" "$HOME/.cursor/extensions" +! omarchy-toggle-enabled skip-cursor-theme-changes && set_theme "/usr/bin/cursor" "$HOME/.config/Cursor/User/settings.json" "$HOME/.cursor/extensions" diff --git a/test/shell.d/vscode-theme-test.sh b/test/shell.d/vscode-theme-test.sh new file mode 100755 index 00000000..e136ed59 --- /dev/null +++ b/test/shell.d/vscode-theme-test.sh @@ -0,0 +1,41 @@ +#!/bin/bash + +source "$(dirname "$0")/base-test.sh" + +TEST_HOME=$(mktemp -d) +trap 'rm -rf "$TEST_HOME"' EXIT + +FAKE_BIN="$TEST_HOME/bin" +CURRENT_THEME="$TEST_HOME/.local/state/omarchy/current/theme" +mkdir -p "$FAKE_BIN" "$CURRENT_THEME" + +cat >"$FAKE_BIN/omarchy-cmd-present" <<'EOF' +#!/bin/bash +printf '%s\n' "$1" >>"$EDITOR_PROBE_LOG" +exit 1 +EOF + +cat >"$FAKE_BIN/omarchy-toggle-enabled" <<'EOF' +#!/bin/bash +exit 1 +EOF + +cat >"$FAKE_BIN/cursor" <<'EOF' +#!/bin/bash +touch "$CURSOR_SHIM_CALLED" +exit 1 +EOF + +chmod +x "$FAKE_BIN"/* +printf '{"name":"Hackerman","extension":"akamud.vscode-theme-onedark"}\n' >"$CURRENT_THEME/vscode.json" + +EDITOR_PROBE_LOG="$TEST_HOME/editor-probes.log" \ + CURSOR_SHIM_CALLED="$TEST_HOME/cursor-shim-called" \ + PATH="$FAKE_BIN:$ROOT/bin:$PATH" \ + HOME="$TEST_HOME" \ + "$ROOT/bin/omarchy-theme-set-vscode" + +grep -Fxq '/usr/bin/cursor' "$TEST_HOME/editor-probes.log" || fail "VS Code theme sync probes the packaged Cursor executable" +[[ ! -e $TEST_HOME/cursor-shim-called ]] || fail "VS Code theme sync ignores a PATH-provided Cursor Agent shim" +[[ ! -e $TEST_HOME/.config/Cursor/User/settings.json ]] || fail "VS Code theme sync skips Cursor when the packaged executable is unavailable" +pass "VS Code theme sync selects the packaged Cursor executable"