Skip to content

Make locked Hyprland groups follow the theme - #13565

Open
omarchybot wants to merge 3 commits into
quattrofrom
omabot/pr-7999
Open

omarchybot wants to merge 3 commits into
quattrofrom
omabot/pr-7999

Conversation

@omarchybot

Copy link
Copy Markdown
Collaborator

Locked Hyprland groups fall back to Hyprland's own defaults — an orange and brown border and groupbar — because Omarchy sets only the unlocked group colours. On a stock install hyprctl getoption group:col.border_locked_active reads 66775500 while group:col.border_active follows the theme.

This sets border_locked_active and border_locked_inactive to the same colours as the unlocked group border, in default/hypr/looknfeel.lua, in the theme template default/themed/hyprland.lua.tpl, and in the five stock themes that ship a handwritten hyprland.lua (Kanagawa, Last Horizon, Lumon, Retro 82, Solitude). Kanagawa and Retro 82 set only an active border, so their locked inactive border takes the default inactive colour, as their unlocked one does. The groupbar's locked_active and locked_inactive backgrounds get the same translucent black as unlocked tabs. The locked groupbar text colours are left unset on purpose: Hyprland falls back from them to text_color and text_color_inactive, so a user who themes the groupbar text in their own looknfeel.lua gets the same text on a locked group too.

A migration re-stages the current theme so existing installs pick up the new template and theme files. It skips when theme.name names a theme that no longer exists: omarchy-theme-remove will remove the current theme, omarchy-theme-set then exits 1, and a failing migration stays pending and holds every migration after it. test/shell.d/locked-group-theme-migration-test.sh covers that case, and test/cli checks the template, the handwritten themes and the defaults, including that the locked text keys stay unset.

Written by Opus 5.5 in Claude Code and reviewed by Codex at Medium effort. The review is what found the locked text fallback.

Supersedes #7999 by @jondkinney, whose commits this carries unchanged, with the fixes above on top.

jondkinney and others added 3 commits August 23, 2026 23:37
omarchy-theme-remove will remove the theme that is current, leaving theme.name naming a directory that no longer exists. omarchy-theme-refresh then fails, and a failing migration stays pending and stops every migration after it. Skip the refresh in that case, as migrations/1787481315.sh does: there is nothing left to re-stage from.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Hyprland leaves text_color_locked_active and text_color_locked_inactive unset and falls back to text_color and text_color_inactive. Setting them to the same white as the defaults changed nothing for a stock install, but it cut that fallback, so a user who sets darker groupbar text in their own looknfeel.lua would get white text again on a locked group. The groupbar background and border colours still need setting: they have no fallback, and their defaults are orange.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Codex Medium <noreply@openai.com>
@llstrk

llstrk commented Sep 29, 2026

Copy link
Copy Markdown

Automated AI review

Community review: Independent automated community review, unaffiliated with the Omarchy team, intended to help prepare PRs for their review.

Outcome: The new handwritten-theme check in test/cli rejects themes with their own locked colour and fails when merged with open #12488.

Handwritten-theme check requires one exact value

The loop requires border_locked_active = active_border_color, verbatim in each theme hyprland.lua that sets border_active. Merged with #12488, test/cli fails at dino-dawn, which sets border_locked_active = "rgb(F2D18E)". Impact: test-only; whichever PR lands second must change.

Suggested change: require each border_locked_* key, with any value, only when its unlocked key is set.

Reproducer (fails at 81d7a75 with a one-line theme patch, and merged with #12488)

Reproducer: the handwritten-theme check requires one exact variable name

Reviewed head: 81d7a75c25069fedb0eb55da790cd5ed602609fe (PR #13565). All runs below used a clean checkout, bash test/cli from the repository root, a private HOME/TMPDIR, no network and no desktop session. Output is trimmed to the relevant lines; the unrelated find: '/themes/': No such file or directory noise that omarchy theme list prints without OMARCHY_PATH is omitted.

1. A theme that sets its locked border to the same colour as a literal

Patch applied to the PR head (Kanagawa's active_border_color is "rgb(dcd7ba)", so this changes no colour):

--- a/themes/kanagawa/hyprland.lua
+++ b/themes/kanagawa/hyprland.lua
@@ -10,7 +10,7 @@
   group = {
     col = {
       border_active = active_border_color,
-      border_locked_active = active_border_color,
+      border_locked_active = "rgb(dcd7ba)",
     },
   },
 })
$ bash test/cli
...
ok - theme templates style locked group borders
not ok - kanagawa applies its active border to locked groups
$ echo $?
1

2. Merged with open PR #12488 (themes that style locked groups on purpose)

git fetch origin pull/13565/head:pr-13565 pull/12488/head:pr-12488
git switch --detach pr-13565
git merge --no-edit pr-12488
bash test/cli

Actual output (exit 1):

ok - theme templates style locked group borders
not ok - dino-dawn applies its active border to locked groups

themes/dino-dawn/hyprland.lua on #12488 sets:

      border_active = active_border,
      border_inactive = inactive_border,
      border_locked_active = "rgb(F2D18E)",
      border_locked_inactive = inactive_border,

Eleven of the twelve themes #12488 adds set both locked keys: border_locked_active to their own literal colour (for example "rgb(F2D18E)", "rgb(D39A30)") and border_locked_inactive to their own inactive variable (inactive_border or inactiveBorderColor). A text search of the #12488 files shows none of them contains the exact strings the check looks for; the test itself stops at the first failure, dino-dawn. The twelfth, far-horizon, sets neither locked key.

For comparison, the same merge with open PR #9223 fails with not ok - hackers-1995 applies its active border to locked groups. That theme sets no locked keys at all, so that failure is a real gap in #9223.

3. Suggested check: presence of the locked key, any value

Replacing the loop body with a presence check:

for theme_hyprland in "$ROOT"/themes/*/hyprland.lua; do
  if grep -Fq 'border_active =' "$theme_hyprland"; then
    grep -Fq 'border_locked_active =' "$theme_hyprland" ||
      fail "$(basename "$(dirname "$theme_hyprland")") styles locked groups when it styles the active group border"
  fi
  if grep -Fq 'border_inactive =' "$theme_hyprland"; then
    grep -Fq 'border_locked_inactive =' "$theme_hyprland" ||
      fail "$(basename "$(dirname "$theme_hyprland")") styles locked groups when it styles the inactive group border"
  fi
done

Actual results of bash test/cli:

Tree Result
PR head with the suggested check exit 0, ok - handwritten Hyprland themes style locked group borders
same, with border_locked_inactive removed from themes/lumon/hyprland.lua exit 1, not ok - lumon styles locked groups when it styles the inactive group border
same, with the Kanagawa literal from section 1 exit 0
PR head merged with #12488, suggested check exit 1, not ok - far-horizon styles locked groups when it styles the active group border (the #12488 theme that sets no locked keys)
Details

Verified (Hyprland 0.56.2, full Omarchy config parsed with --verify-config):

  • At the merge-base, the locked active and inactive borders read 0x66775500 / 0x66FF5500; the PR cites the first.
  • After the migration, locked border and groupbar equal the unlocked values for a templated stock theme (Tokyo Night), a handwritten one (Kanagawa), a user theme with only colors.toml, and a git-installed theme.
  • Locked groupbar text keys stay unset, so Hyprland falls back to text_color / text_color_inactive.
  • The migration exits 0 with no theme.name, and with a removed current theme it leaves the staged theme untouched; a direct omarchy-theme-refresh there exits 1.
  • The PR merges cleanly into the current quattro, and its new checks pass there.

Optional notes:

  • Optional test improvement: removing border_locked_inactive = inactive_border_color, from default/hypr/looknfeel.lua leaves test/cli passing (reproducer below), although Kanagawa and Retro 82 rely on it for their locked inactive border. A matching grep -Fq next to the border_locked_active check would catch it.
  • Optional test improvement: the no-theme case in test/shell.d/locked-group-theme-migration-test.sh checks only the exit status, so a migration that refreshes with no theme set still passes. Adding [[ ! -s $CALL_LOG ]] || fail "no current theme is not refreshed" after that run makes such a mutant fail.
  • A user theme that ships its own hyprland.lua (for example a copy of a stock theme made before this change) keeps an unthemed locked border after the migration, now Omarchy's default gradient; so does a removed current theme. User looknfeel.lua overrides of the unlocked group colours don't reach locked groups, which keep the theme's colour. A release-note line may help.
Reproducer for the default-border note (passes at 81d7a75 with the line removed)

Reproducer: the default locked inactive border is not asserted

Reviewed head: 81d7a75c25069fedb0eb55da790cd5ed602609fe (PR #13565). Run with bash test/cli from the repository root in a clean checkout with a private HOME/TMPDIR, no network and no desktop session.

Patch applied to the PR head (removes only the default locked inactive border):

--- a/default/hypr/looknfeel.lua
+++ b/default/hypr/looknfeel.lua
@@ -36,7 +36,6 @@
       border_active = active_border_color,
       border_inactive = inactive_border_color,
       border_locked_active = active_border_color,
-      border_locked_inactive = inactive_border_color,
     },
 
     groupbar = {

Actual result: bash test/cli exits 0 and prints the same 119 ok lines as the unmodified head, including:

ok - theme templates style locked group borders
ok - handwritten Hyprland themes style locked group borders
ok - default Hyprland styling covers locked groups generically

Why the line matters (source, not re-run on the mutant): Kanagawa and Retro 82 set only an active border, so their locked inactive border comes from this default line. Without it Hyprland uses its own default for group:col.border_locked_inactive, 0x66ff5500 (Hyprland 0.56.2 src/config/values/ConfigValues.cpp, the group:col.border_locked_inactive entry). At the merge-base, parsing the full Omarchy config with Hyprland 0.56.2 (Hyprland --verify-config plus hl.get_config) reports group:col.border_locked_inactive = {0x66FF5500} for Tokyo Night; at the PR head after the migration, Kanagawa reports {0xAA595959}, the default inactive colour.

Suggested assertion, next to the existing border_locked_active check:

grep -Fq 'border_locked_inactive = inactive_border_color,' "$ROOT/default/hypr/looknfeel.lua" ||
  fail "default locked groups inherit the inactive border"

The string occurs exactly once in default/hypr/looknfeel.lua at the PR head (line 39).


Review information

Test scope: Source, sandboxed tests and migration runs at 81d7a75; no desktop session.

AI process: Opus 5.5 Medium coordination and synthesis, Opus 5.5 Xhigh technical review and final fact check, GPT 6 Sol Xhigh search for related issues, Opus 5.5 Medium editorial check.

Opt out: To stop receiving these reviews, reply to this comment saying so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants