Skip to content

[FEATURE] Allow customizing the Matugen color generation mode (--prefer) #1735

Description

@tetam01

Is your feature request related to a problem? Please describe.

When changing wallpapers or switching themes, Matugen is automatically executed to extract colors and update system theming. Currently, the color extraction strategy is set to Matugen's default behavior without an option to change it. There is no built-in way for users to choose different color strategies (like prioritizing highly saturated colors, chroma, lightness, etc.), which can sometimes lead to less-than-optimal color extraction depending on the wallpaper.

Describe the solution you'd like

I would like to have a native option to customize Matugen's color generation behavior by utilizing its --prefer flag (which supports default, chroma, lightness, saturation, and hue).
Proposed Implementation:

  1. Introduce a configuration/setting file at ~/.config/ml4w/settings/matugen-prefer containing the user's preference (e.g. saturation).
  2. Modify ml4w-wallpaper to read this file and pass the preference to matugen:
    SETTINGS_MATUGEN_PREFER="$HOME/.config/ml4w/settings/matugen-prefer"
    MATUGEN_PREFER="default"
    if [ -f "$SETTINGS_MATUGEN_PREFER" ]; then
    MATUGEN_PREFER=$(grep -E -v '^#|^$' "$SETTINGS_MATUGEN_PREFER" | head -n 1 | xargs)
    fi
    $MATUGEN_BIN image "$IMAGE_PATH" -m "$mode" --prefer "$MATUGEN_PREFER"
  3. Update gtk-theme-switcher.sh (and any other scripts invoking Matugen) to also read and apply this --prefer "$MATUGEN_PREFER" flag so that manual dark/light mode toggles remain consistent.

Describe alternatives you've considered

The only alternative currently is manually copying the stock scripts (like ml4w-wallpaper) into a custom configuration folder and manually editing them to add the --prefer flag. It would be much cleaner if this was natively supported and configurable out-of-the-box.

Additional context

This setting could easily be integrated into the ML4W Settings App UI in the future as a simple dropdown menu, allowing users to switch between 'Saturation', 'Chroma', 'Lightness', 'Hue', or 'Default' color generation styles.
Integration in Settings App #1736

Support or Contribution

Metadata

Metadata

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions