From 2eb15bc7265c5293985f7e5f483e39df7be9c548 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sun, 19 Jul 2026 20:52:38 -0700 Subject: [PATCH] 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 --- pkgbuilds/omarchy-nvim/PKGBUILD | 2 +- pkgbuilds/omarchy-nvim/omarchy-nvim-setup | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/pkgbuilds/omarchy-nvim/PKGBUILD b/pkgbuilds/omarchy-nvim/PKGBUILD index 4e0ef79..924e551 100644 --- a/pkgbuilds/omarchy-nvim/PKGBUILD +++ b/pkgbuilds/omarchy-nvim/PKGBUILD @@ -1,6 +1,6 @@ # Maintainer: Ryan Hughes pkgname=omarchy-nvim -pkgver=2026.7.16 +pkgver=2026.7.17 pkgrel=1 pkgdesc="Pre-built LazyVim configuration with cached plugins" arch=('any') diff --git a/pkgbuilds/omarchy-nvim/omarchy-nvim-setup b/pkgbuilds/omarchy-nvim/omarchy-nvim-setup index e7f238f..f7e2d5a 100755 --- a/pkgbuilds/omarchy-nvim/omarchy-nvim-setup +++ b/pkgbuilds/omarchy-nvim/omarchy-nvim-setup @@ -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