Skip to content

feat(theme): terminal background opacity and wallpaper-tinted colors - #3662

Merged
bbedward merged 5 commits into
duxlabs-dev:masterfrom
Conava:terminal-settings
Oct 15, 2026
Merged

bbedward merged 5 commits into
duxlabs-dev:masterfrom
Conava:terminal-settings

Conversation

@Conava

@Conava Conava commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Description

This PR adds terminal background opacity and an option for terminal colors to follow the wallpaper.

Compositor opacity (window rules, decoration.*_opacity) fades the whole window, text included. Only the terminal itself can make just its background translucent, and DMS already generates a theme file for each terminal, so that's where the setting goes. Separately, dank16 keeps red, green and yellow close to their canonical hues (pulled 4-12% toward the primary), so a large part of the terminal palette looks the same on every wallpaper.

  • App theming → Portal & terminals gets Opacity, Colors from wallpaper and Intensity (Low / Medium / High, shown while Colors from wallpaper is on)
  • Opacity adds the terminal's own key to the per-run template copy, the same mechanism "Terminals always dark" uses: background_opacity + dynamic_background_opacity yes for kitty, alpha for foot, background-opacity for ghostty, [window] opacity for alacritty. At 100 nothing is written. WezTerm's generated file is a color scheme, which can't carry opacity, so the docs give the wezterm.lua line instead
  • dank16 gets --profile low|medium|high: slots 1-4 and 9-14 rotate their HCT hue toward the primary by 25/50/85% of min(0.8 × distance, 100°), keeping chroma, tone and the existing contrast guards. Slots 0, 5-8 and 15 never change (so the 5-on-6 pairing holds), and default is byte-identical to today
  • Terminals are now signaled after every template render, not only when dms-colors.json changed. Otherwise an opacity-only change never reloads kitty or ghostty. This also fixes "Terminals always dark" in light mode, which rewrote the terminal files without signaling them

No new strings: every label is an existing term ("Opacity", "Colors from wallpaper", "Intensity", "Low", "Medium", "High").

A few things worth flagging:

  • The shell passes --terminal-opacity/--terminal-palette only when they aren't the default, so an older dms binary keeps working with defaults and the matugen run key doesn't change on upgrade. With a non-default value, an older binary rejects the flag and the whole theme run fails, the same as --source-mode today.
  • kitty only applies a runtime background_opacity change in windows started with dynamic_background_opacity on, so windows open when Opacity is first lowered stay opaque until restarted. Later changes apply live.
  • Terminals are now signaled on every non-colors-only build. If you'd rather keep that to runs where a terminal file actually changed, I can narrow it.
  • Colors from wallpaper also applies to stock and custom themes, toward the theme's primary.
  • The rotation idea is inspired by caelestia-cli's terminal palette, but it rotates dank16's own slots instead of a separate base palette, so Default and Low are close.

Validation

Slots 1-3 (red, green, yellow), dark mode, from dms dank16 <hex> --json --profile <p> on this branch:

Primary Profile red green yellow
#5b9694 default #b37553 #4b9650 #bbb354
#5b9694 low #a77c41 #34985f #a3b965
#5b9694 medium #958441 #11996d #8bbd7a
#5b9694 high #748c57 #009881 #6cc09a
#8ad0ee default #ff72a0 #77ee84 #fff672
#8ad0ee high #879bff #00ecf6 #b8fff6
#ffb693 default #ff7872 #97ff7f #ffe572
#ffb693 high #fd7d4e #ffe2be #ffe0c7
  • --profile default output is byte-identical to upstream/master for 5 primaries, dark and light (10/10 cmp)
  • Sandboxed dms matugen generate --terminal-opacity 80 (XDG dirs in a temp dir) wrote opacity = 0.8 into alacritty's theme file
  • Tested by hand on Hyprland with kitty: Opacity applies to newly started windows and then changes live; Colors from wallpaper and each Intensity level recolor the ANSI colors of a running kitty
  • New Go tests: per-terminal opacity lines and the always-dark combination, unchanged output at 0/100, profile goldens for dark and light, rotation monotonic across levels, slots 0/5-8/15 untouched, contrast floor, malformed primary or container doesn't panic
  • go test ./... (everything except internal/screenshot's TestWaylandOutputBoundsScaled, which also fails on upstream/master on this machine), GOOS=freebsd go build ./..., make lint-qml, make build, python3 quickshell/tests/run-qml.py logic qt lock, settings search index regenerated, prek run on the changed files. Skipped the qml-tests hook (needs niri) and the go-test hook (the screenshot test above)

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that changes existing behavior)
  • Refactor / internal cleanup
  • Documentation
  • Other

Related issues

New Settings
screenshot_2026-10-02_20-10-03
Screenshots / video

Current look:
screenshot_2026-10-02_20-12-25

Use wallpaper colors setting high:
screenshot_2026-10-02_20-12-32

Checklist

  • My code follows the conventions in CONTRIBUTING.md
  • I have tested my changes locally
  • New user-facing strings are wrapped in I18n.tr() with translator context, reusing existing terms where possible
  • Go changes: ran make fmt, added/updated tests, make test passes, and go mod tidy is clean
  • QML changes: ran make lint-qml with no new warnings
  • I have opened a corresponding pull request in dlx-docs to document any new behaviors: docs: terminal opacity and wallpaper colors dux-docs#154

Compositor opacity fades the whole window, text included; only the
terminal can make just its background translucent. DMS already writes a
theme file per terminal, so a new Opacity setting adds each terminal's
own key to the per-run template copy, the same mechanism "Terminals
always dark" uses: background_opacity plus dynamic_background_opacity
for kitty, alpha for foot, background-opacity for ghostty and
[window] opacity for alacritty. At 100 nothing is written.

dank16 keeps red, green and yellow close to their canonical hues, so
much of the terminal palette looks the same on every wallpaper. A new
profile (low, medium, high) rotates slots 1-4 and 9-14 toward the
primary's HCT hue by 25/50/85% of min(0.8 x distance, 100 degrees),
keeping chroma, tone and the existing contrast guards. Slots 0, 5-8 and
15 never change, and the default profile is byte-identical. Settings
exposes it as "Colors from wallpaper" with an Intensity choice.

Terminals are now signaled after every template render instead of only
when dms-colors.json changed, so opacity- or palette-only changes reload
kitty and ghostty. This also covers "Terminals always dark" in light
mode, which rewrote terminal files without signaling.

The shell passes the new flags only when they differ from the defaults.
Copilot AI balanced review requested due to automatic review settings October 2, 2026 17:40

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 reached their quota limit.

@bbedward

bbedward commented Oct 3, 2026

Copy link
Copy Markdown
Member

/claude review

Comment thread core/internal/matugen/matugen.go Resolved
@claude

claude Bot commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

Claude review

One scope issue; the rest looks correct.

  • The terminal palette profile also changes editor themes (vscode, emacs, zed, zen) that use dank16 for syntax colors, core/internal/matugen/matugen.go:500
    Checked: dank16 profile rotation and contrast guards, per-terminal opacity snippets against the kitty/foot/ghostty/alacritty templates, the moved signalTerminals call, the CLI/socket option plumbing, and the Theme.qml args and run key, SettingsSpec and ThemeAppsTab i18n. Model: claude-opus-5-5.

Conava added 2 commits October 9, 2026 15:13
The wallpaper terminal palette rotated the shared dank16 palette, which
every template reads, so it also recolored the VS Code, Emacs, Zed and
Zen themes and users' own templates. dank16 is now always generated
without a profile, and the rotated palette is passed to matugen as
dank16term, which only the terminal templates read.
# Conflicts:
#	core/internal/matugen/spec_test.go
@Conava

Conava commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

Fixed: dank16 doesn't get the terminal palette anymore, so editor themes and user templates stay as they were. The rotated palette is passed separately as dank16term, and only the five terminal templates read it.
Maybe we could add a toggle for those who want full theming of the other apps too but I dont really care about that.

# Conflicts:
#	core/internal/matugen/matugen_test.go
#	core/internal/matugen/spec_test.go
#	core/internal/server/matugen_handler.go
@bbedward

Copy link
Copy Markdown
Member

/claude review

@claude

claude Bot commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Claude review

No issues found. The earlier scope finding is fixed: editor and user templates still read dank16, and only the five terminal templates read dank16term.
Checked: the dank16 profile rotation and its per-slot contrast guards (matching GeneratePalette in dark and light), dank16term injection on both the stock path and the matugen path, the per-terminal opacity snippets against the foot/alacritty/ghostty/kitty templates and output paths, the always-dark + opacity tmp-template rewrite, the moved signalTerminals call, the CLI/socket plumbing, the Theme.qml args, SettingsSpec, the ThemeAppsTab widgets and I18n reuse, and deprecated shims. Model: claude-opus-5-5.

}

SettingsButtonGroupRow {
text: I18n.tr("Intensity")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is one case where we should have a short description with translator context, it isnt clear to me what intensity would do as a user.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

added it. This setting dictates how strongly the colors shift towards the wallpaper palette

Describe what the Intensity setting changes.
@bbedward
bbedward merged commit 549cbf6 into duxlabs-dev:master Oct 15, 2026
4 checks passed
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.

3 participants