Pick the Neovim theme symlink target based on the installed Omarchy version
omarchy-nvim-setup hardcoded theme.lua to the Omarchy 4 theme location (~/.local/state/omarchy/current), which doesn't exist on Omarchy 3.x, so fresh 3.8.3 installs errored on nvim startup with "Failed to load plugins.theme" (basecamp/omarchy#6309). Detect the right location at runtime: prefer whichever current-theme directory exists, and fall back to the installed Omarchy version for fresh 3.x installs where setup runs before the first theme is set. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
94ee311b25
commit
2eb15bc726
@@ -1,6 +1,6 @@
|
||||
# Maintainer: Ryan Hughes <ryan@omarchy.org>
|
||||
pkgname=omarchy-nvim
|
||||
pkgver=2026.7.16
|
||||
pkgver=2026.7.17
|
||||
pkgrel=1
|
||||
pkgdesc="Pre-built LazyVim configuration with cached plugins"
|
||||
arch=('any')
|
||||
|
||||
@@ -116,9 +116,20 @@ if (( EUID == 0 )); then
|
||||
fi
|
||||
|
||||
# Use a relative symlink so the same config works from /etc/skel and from any
|
||||
# user's home directory.
|
||||
# user's home directory. Omarchy 4 keeps the active theme under
|
||||
# ~/.local/state/omarchy/current while Omarchy 3.x keeps it under
|
||||
# ~/.config/omarchy/current. Fresh 3.x installs run this before the first
|
||||
# theme is set, so when neither location exists yet, decide by the installed
|
||||
# Omarchy version.
|
||||
theme_dir=".local/state/omarchy/current/theme"
|
||||
if [[ ! -d "$HOME/.local/state/omarchy/current" ]]; then
|
||||
omarchy_version=$(cat "${OMARCHY_PATH:-$HOME/.local/share/omarchy}/version" 2>/dev/null || true)
|
||||
if [[ -d "$HOME/.config/omarchy/current" || ${omarchy_version%%.*} == "3" ]]; then
|
||||
theme_dir=".config/omarchy/current/theme"
|
||||
fi
|
||||
fi
|
||||
mkdir -p "${CONFIG_DIR}/lua/plugins"
|
||||
ln -snf "../../../../.local/state/omarchy/current/theme/neovim.lua" "${CONFIG_DIR}/lua/plugins/theme.lua"
|
||||
ln -snf "../../../../${theme_dir}/neovim.lua" "${CONFIG_DIR}/lua/plugins/theme.lua"
|
||||
|
||||
# Restore git working trees from the packaged lazy plugin cache.
|
||||
for dir in "$DATA_DIR"/lazy/*/; do
|
||||
|
||||
Reference in New Issue
Block a user