add option to disable theming (#1586)

This commit is contained in:
end-4
2025-07-12 20:13:26 +07:00
parent f6bb5385cf
commit e59dd2cab2
5 changed files with 89 additions and 2 deletions
@@ -57,5 +57,16 @@ apply_qt() {
python "$CONFIG_DIR/scripts/kvantum/changeAdwColors.py" # apply config colors
}
apply_qt &
apply_term &
# Check if terminal theming is enabled in config
CONFIG_FILE="$XDG_CONFIG_HOME/illogical-impulse/config.json"
if [ -f "$CONFIG_FILE" ]; then
enable_terminal=$(jq -r '.appearance.wallpaperTheming.enableTerminal' "$CONFIG_FILE")
if [ "$enable_terminal" = "true" ]; then
apply_term &
fi
else
echo "Config file not found at $CONFIG_FILE. Applying terminal theming by default."
apply_term &
fi
# apply_qt & # Qt theming is already handled by kde-material-colors
@@ -12,6 +12,15 @@ MATUGEN_DIR="$XDG_CONFIG_HOME/matugen"
terminalscheme="$SCRIPT_DIR/terminal/scheme-base.json"
handle_kde_material_you_colors() {
# Check if Qt app theming is enabled in config
CONFIG_FILE="$XDG_CONFIG_HOME/illogical-impulse/config.json"
if [ -f "$CONFIG_FILE" ]; then
enable_qt_apps=$(jq -r '.appearance.wallpaperTheming.enableQtApps' "$CONFIG_FILE")
if [ "$enable_qt_apps" == "false" ]; then
return
fi
fi
# Map $type_flag to allowed scheme variants for kde-material-you-colors-wrapper.sh
local kde_scheme_variant=""
case "$type_flag" in
@@ -46,6 +55,7 @@ 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
@@ -242,6 +252,16 @@ switch() {
pre_process "$mode_flag"
# Check if app and shell theming is enabled in config
CONFIG_FILE="$XDG_CONFIG_HOME/illogical-impulse/config.json"
if [ -f "$CONFIG_FILE" ]; then
enable_apps_shell=$(jq -r '.appearance.wallpaperTheming.enableAppsAndShell' "$CONFIG_FILE")
if [ "$enable_apps_shell" == "false" ]; then
echo "App and shell theming disabled, skipping matugen and color generation"
return
fi
fi
matugen "${matugen_args[@]}"
source "$(eval echo $ILLOGICAL_IMPULSE_VIRTUAL_ENV)/bin/activate"
python3 "$SCRIPT_DIR/generate_colors_material.py" "${generate_colors_material_args[@]}" \