Skip to content

40-steam.sh: invisible Steam buttons when theme lacks color0-color15 (Aether-created themes) #9

Description

@Eidan78

Summary

With themes created by Aether (Omarchy v4) that only define named colors (background, foreground, accent, green, red, ...) and no color0color15, the bundled Steam plugin (theme-set.d/40-steam.sh) generates a broken Adwaita colortheme. The Steam Play button becomes invisible (black text painted on a near-black page), and several backgrounds/accents also collapse to black.

Environment

  • Linux (NVIDIA/Wayland/Hyprland)
  • Steam client build 1785799196, skin: Adwaita-for-Steam (installed by the plugin)
  • Theme: Omarchy v4 theme created with Aether (e.g. Industrial) — colors.toml has only named colors, no color0color15
  • thpm branch thpm

Root cause

  1. lib/theme-env.sh derives normal_black..bright_white only from color0color15 (lines ~299-314):

    normal_black=$(extract_color "color0")
    ...
    bright_white=$(extract_color "color15")
  2. Aether-created themes have no color0color15, so extract_color "color0" returns empty, and hex2rgb "" falls back to 0, 0, 0.

  3. theme-set.d/40-steam.sh then writes the empty/black values into the colortheme, e.g.:

    --adw-success-fg-rgb: 0, 0, 0;      /* normal_black was empty */
    --adw-view-bg-rgb:    0, 0, 0;
    --adw-headerbar-border-rgb: 0, 0, 0;

    The green Play button in the Steam client is styled from the --adw-success-* variables. In the current Steam build the button background is not painted by the skin, so the text renders black on the near-black page → invisible button (still clickable).

Second, independent bug

40-steam.sh also sets the accent/warning button text to the page background color:

--adw-accent-fg-rgb: ${rgb_primary_background};   /* line 22 */
--adw-warning-fg-rgb: ${rgb_primary_background};  /* line 36 */

This makes the text identical to the background even on themes that do provide color0–15.

Steps to reproduce

  1. Use/create an Omarchy theme with only named colors in colors.toml (Aether-generated, e.g. Industrial).
  2. thpm enable steam and run thpm run (or switch themes).
  3. Open the Steam library → the Play button text is invisible (black on black).

Expected behavior

Button/text colors remain readable for any theme, independent of whether color0–15 exists.

Suggested fix

Read named keys and pick a readable foreground from luminance, with fallbacks:

readable_fg() {  # luminance-based, returns "255, 255, 255" or "0, 0, 0"
    ...
}

--adw-success-bg-rgb: $(hex2rgb "$(extract_color green)");
--adw-success-fg-rgb: $(readable_fg "$(extract_color green)");
--adw-accent-fg-rgb:  $(readable_fg "$(extract_color accent)");

and fall back to background/foreground/muted (not color0color15) for view/headerbar/sidebar tints.

Related (minor)

require_restart "steam" only emits a notification; a running Steam does not pick up the new theme until a manual restart. Consider auto-restarting Steam when a game is not running.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions