Skip to content

fix(end4): store the adaptive window opacity in the shell's options - #73

Merged
Schnee111 merged 1 commit into
mainfrom
fix/issue-72-adaptive-opacity-shell-config
Oct 25, 2026
Merged

Schnee111 merged 1 commit into
mainfrom
fix/issue-72-adaptive-opacity-shell-config

Conversation

@Schnee111

Copy link
Copy Markdown
Owner

Fixes #72

What this fixes

apply_adaptive_glass.sh sets window opacity from the wallpaper and writes it to shellOverrides/main.lua. When the shell's Hyprland settings page opens, it rewrites that file from its stored options in ~/.config/illogical-impulse/config.json, so the opacity went back to the last saved value (here 0.86 / 0.76 instead of 0.88 / 0.78) until the next wallpaper change.

Approach

The script now also writes hyprland.decoration.activeOpacity / inactiveOpacity into the shell's config.json, so the settings page writes back the wallpaper's value. Opacity keeps following the wallpaper, which is the intended behaviour.

  • It is skipped in solid mode, like the main.lua write, and when jq is missing.
  • The file is written only when the values differ. That avoids needless reloads, since the shell watches the file.
  • The update uses jq, then a temp file and mv on the resolved path (readlink -f). A config.json that is still a symlink into dotfiles stays a symlink, and the rename is atomic, as with the shell's own saves.
  • If the file does not parse, it is left untouched and no .tmp file is left behind.
  • tests/adaptive-glass.sh gets new checks:
    • nothing is created without config.json;
    • the tier values are written for luminance 50 and 10, through a symlink, with other keys kept;
    • solid mode writes nothing;
    • an unparsable file is left alone.

Verification

  • bash tests/run.sh: all test files pass. shellcheck is clean on both files.
  • Negative control: with the script from main and the new checks kept, the test fails with lum 50: expected [0.88,0.78], got [0.86,0.76].
  • Live run of the script against the current wallpaper (46 %):
    • config.json holds [0.88, 0.78] and is still there after the shell's reload;
    • main.lua holds 0.88 / 0.78;
    • hyprctl getoption decoration:active_opacity reads 0.88;
    • configerrors is empty.

Risk

Low. An opacity set by hand in the settings page lasts only until the next wallpaper change, which is the intended behaviour. Solid mode still pins it.

The shell's Hyprland settings page rewrites shellOverrides/main.lua from
config.json when it opens, which put back the last saved opacity over
the value apply_adaptive_glass.sh had just set from the wallpaper.
Write the same values to hyprland.decoration in config.json (skipped in
solid mode, when unchanged, or when the file does not parse), through a
symlink without replacing it.

Fixes #72
Copilot AI balanced review requested due to automatic review settings October 25, 2026 00:25

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@Schnee111 Schnee111 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Autonomous Code Review

Verdict: Approved
Target Commit: 4802799

Summary

Safely propagates adaptive window opacity values into the shell's config.json with symlink preservation, no-op verification, and comprehensive test coverage.


Shorekeeper Sentinel · Autonomous Quality Gate

@Schnee111
Schnee111 merged commit 71ddb90 into main Oct 25, 2026
1 check passed
@Schnee111
Schnee111 deleted the fix/issue-72-adaptive-opacity-shell-config branch October 25, 2026 00:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

end4: opening the shell's Hyprland settings resets the adaptive window opacity

2 participants