Clean up semantic theme compatibility
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
# omarchy:summary=Sync Omarchy theme to VS Code, VSCodium, and Cursor
|
||||
# omarchy:hidden=true
|
||||
|
||||
VS_CODE_THEME="$HOME/.config/omarchy/current/theme/vscode.json"
|
||||
VS_CODE_THEME_DESCRIPTOR="$HOME/.config/omarchy/current/theme/vscode.json"
|
||||
GENERATED_THEME="$HOME/.config/omarchy/current/theme/vscode-theme.json"
|
||||
|
||||
# Install generated theme as a local extension for a given editor
|
||||
@@ -50,22 +50,18 @@ set_theme() {
|
||||
|
||||
local theme_name=""
|
||||
|
||||
# Always deploy the generated theme so it's available in the theme picker
|
||||
if [[ -f "$GENERATED_THEME" ]]; then
|
||||
install_generated_extension "$ext_base/omarchy-theme"
|
||||
fi
|
||||
|
||||
if [[ -f "$VS_CODE_THEME" ]]; then
|
||||
# Theme specifies a preferred 3rd-party extension
|
||||
theme_name=$(jq -r '.name' "$VS_CODE_THEME")
|
||||
if [[ -f "$VS_CODE_THEME_DESCRIPTOR" ]]; then
|
||||
# Theme specifies a preferred 3rd-party extension/theme pair.
|
||||
theme_name=$(jq -r '.name' "$VS_CODE_THEME_DESCRIPTOR")
|
||||
local extension
|
||||
extension=$(jq -r '.extension' "$VS_CODE_THEME")
|
||||
extension=$(jq -r '.extension' "$VS_CODE_THEME_DESCRIPTOR")
|
||||
|
||||
if [[ -n $extension ]] && ! "$editor_cmd" --list-extensions 2>/dev/null | grep -Fxq "$extension"; then
|
||||
"$editor_cmd" --install-extension "$extension" >/dev/null 2>&1
|
||||
fi
|
||||
elif [[ -f "$GENERATED_THEME" ]]; then
|
||||
# No 3rd-party preference, activate the generated theme
|
||||
# VS Code only discovers local color themes through an extension package.
|
||||
install_generated_extension "$ext_base/omarchy-theme"
|
||||
theme_name="Omarchy"
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user