[FEATURE] Allow customizing the Matugen color generation mode (--prefer)
Maintainer thường phản hồi trong vòng 1 ngày
@mylinuxforwork đang làm issue này rồi.
Từ ngày 11/7/2026.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
Is your feature request related to a problem? Please describe.
When changing wallpapers or switching themes, Matugen is automatically executed in the background to extract colors and update system theming. Currently, I see two major issues with the current implementation:
Background TTY Crashes (Fixes #1744): In Matugen 4.0.0+, if an image contains multiple dominant colors and Matugen is executed without a TTY/terminal (e.g. from wallpaper.sh via the Quickshell app or Waypaper), it crashes with Multiple source colors found, no preference was inputted, and a terminal was not detected. This prevents the status bar and other templates from updating.
No Custom Color Strategies: 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 lead to suboptimal color extraction depending on the wallpaper.
Describe the solution you'd like
II would like to have a native option to customize Matugen's color generation behavior by utilizing its --prefer flag (which supports chroma, lightness, saturation, and hue) while safeguarding the background execution with --source-color-index 0 as a default fallback.
Describe alternatives you've considered
- Introduce a configuration/setting file at
~/.config/ml4w/settings/matugen-prefercontaining the user's preference (e.g.saturation,lightness, ordefault). - Update the Matugen invocation in both
ml4w-wallpaperandhypr/scripts/wallpaper.shto dynamically resolve the Matugen binary path (supporting cargo and local installations) and pass the safe parameters:
# Detect matugen path dynamically (supporting cargo, local or global installation)
MATUGEN_BIN="matugen"
if ! command -v matugen &> /dev/null; then
if [ -f "$HOME/.local/bin/matugen" ]; then
MATUGEN_BIN="$HOME/.local/bin/matugen"
elif [ -f "$HOME/.cargo/bin/matugen" ]; then
MATUGEN_BIN="$HOME/.cargo/bin/matugen"
else
MATUGEN_BIN="$HOME/.local/bin/matugen" # Fallback to original default
fi
fi
# Load user prefer settings
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
# Resolve arguments (preventing TTY crash on default/empty settings)
if [ "$MATUGEN_PREFER" = "default" ] || [ -z "$MATUGEN_PREFER" ]; then
MATUGEN_ARGS="--source-color-index 0"
else
MATUGEN_ARGS="--prefer $MATUGEN_PREFER"
fi
# Run Matugen
$MATUGEN_BIN image "$IMAGE_PATH" -m "$mode" $MATUGEN_ARGS
Describe alternatives you've considered
Manually copying and overriding the scripts to custom folders to add these flags. This is tedious and prone to breaking during dotfile updates.
Additional context
This not only enables custom color palettes but also natively fixes the critical bug #1744 where the status bar colors fail to update due to the background Matugen crash.
Support or Contribution
- Ngôn ngữ chính
- QML
- Star
- 5.1k
- Fork
- 386
- Merge trung bình
- 16 giờ 45 phút
- Pull request đã merge (30 ngày)
- 14
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của mylinuxforwork/dotfiles
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
mylinuxforwork/dotfiles#1904 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 82/100
mylinuxforwork/dotfiles#1829 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement solved
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
mylinuxforwork/dotfiles#1807 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
mylinuxforwork/dotfiles#1765 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[FEATURE] add keycap 1 app window over all windowsCó thể đã có người làm @mylinuxforwork đã nhận 1 ngày trước. Đang mởenhancement
mylinuxforwork/dotfiles#1902 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày