material palette: apply to kde material you colors

This commit is contained in:
end-4
2025-06-16 22:46:14 +02:00
parent 1cebec39f7
commit 96d17f8fcb
4 changed files with 49 additions and 21 deletions
-14
View File
@@ -25,23 +25,9 @@ output_path = '~/.config/gtk-3.0/gtk.css'
input_path = '~/.config/matugen/templates/gtk/gtk-colors.css'
output_path = '~/.config/gtk-4.0/gtk.css'
[templates.ags_source_view]
input_path = '~/.config/matugen/templates/ags/sourceviewtheme.xml'
output_path = '~/.config/ags/assets/themes/sourceviewtheme.xml'
[templates.ags_source_view_light]
input_path = '~/.config/matugen/templates/ags/sourceviewtheme-light.xml'
output_path = '~/.config/ags/assets/themes/sourceviewtheme-light.xml'
[templates.ags_scss]
input_path = '~/.config/matugen/templates/ags/_material.scss'
output_path = '~/.local/state/ags/scss/_material.scss'
post_hook = 'pidof gjs && agsv1 run-js "handleStyles(false)"'
[templates.kde_colors]
input_path = '~/.config/matugen/templates/kde/color.txt'
output_path = '~/.local/state/quickshell/user/generated/color.txt'
post_hook = '~/.config/matugen/templates/kde/kde-material-you-colors-wrapper.sh'
[templates.wallpaper]
input_path = '~/.config/matugen/templates/wallpaper.txt'
@@ -11,4 +11,36 @@ else
mode_flag="-l"
fi
kde-material-you-colors "$mode_flag" --color "$color"
# Parse --scheme-variant flag
scheme_variant_str=""
while [[ $# -gt 0 ]]; do
case "$1" in
--scheme-variant)
scheme_variant_str="$2"
shift 2
;;
*)
shift
;;
esac
done
# Map string variant to integer
case "$scheme_variant_str" in
scheme-content) sv_num=0 ;;
scheme-expressive) sv_num=1 ;;
scheme-fidelity) sv_num=2 ;;
scheme-monochrome) sv_num=3 ;;
scheme-neutral) sv_num=4 ;;
scheme-tonal-spot) sv_num=5 ;;
scheme-vibrant) sv_num=6 ;;
scheme-rainbow) sv_num=7 ;;
scheme-fruit-salad) sv_num=8 ;;
"") sv_num=5 ;;
*)
echo "Unknown scheme variant: $scheme_variant_str" >&2
exit 1
;;
esac
kde-material-you-colors "$mode_flag" --color "$color" -sv "$sv_num"
@@ -56,11 +56,5 @@ apply_qt() {
python "$CONFIG_DIR/scripts/kvantum/changeAdwColors.py" # apply config colors
}
apply_ags() {
pidof agsv1 && agsv1 run-js "handleStyles(false);"
pidof agsv1 && agsv1 run-js 'openColorScheme.value = true; Utils.timeout(2000, () => openColorScheme.value = false);'
}
apply_ags &
apply_qt &
apply_term &
@@ -10,6 +10,20 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
MATUGEN_DIR="$XDG_CONFIG_HOME/matugen"
terminalscheme="$XDG_CONFIG_HOME/quickshell/scripts/terminal/scheme-base.json"
handle_kde_material_you_colors() {
# Map $type_flag to allowed scheme variants for kde-material-you-colors-wrapper.sh
local kde_scheme_variant=""
case "$type_flag" in
scheme-content|scheme-expressive|scheme-fidelity|scheme-fruit-salad|scheme-monochrome|scheme-neutral|scheme-rainbow|scheme-tonal-spot)
kde_scheme_variant="$type_flag"
;;
*)
kde_scheme_variant="scheme-tonal-spot" # default
;;
esac
"$XDG_CONFIG_HOME"/matugen/templates/kde/kde-material-you-colors-wrapper.sh --scheme-variant "$kde_scheme_variant"
}
pre_process() {
local mode_flag="$1"
# Set GNOME color-scheme if mode_flag is dark or light
@@ -31,6 +45,8 @@ post_process() {
local screen_height="$2"
local wallpaper_path="$3"
handle_kde_material_you_colors &
# Determine the largest region on the wallpaper that's sufficiently un-busy to put widgets in
if [ ! -f "$MATUGEN_DIR/scripts/least_busy_region.py" ]; then
echo "Error: least_busy_region.py script not found in $MATUGEN_DIR/scripts/"