switchwall: less duplicate config file declaration

This commit is contained in:
end-4
2025-07-20 08:39:12 +07:00
parent cbd1b48b93
commit a000abc908
@@ -14,9 +14,8 @@ terminalscheme="$SCRIPT_DIR/terminal/scheme-base.json"
handle_kde_material_you_colors() { handle_kde_material_you_colors() {
# Check if Qt app theming is enabled in config # Check if Qt app theming is enabled in config
CONFIG_FILE="$XDG_CONFIG_HOME/illogical-impulse/config.json" if [ -f "$SHELL_CONFIG_FILE" ]; then
if [ -f "$CONFIG_FILE" ]; then enable_qt_apps=$(jq -r '.appearance.wallpaperTheming.enableQtApps' "$SHELL_CONFIG_FILE")
enable_qt_apps=$(jq -r '.appearance.wallpaperTheming.enableQtApps' "$CONFIG_FILE")
if [ "$enable_qt_apps" == "false" ]; then if [ "$enable_qt_apps" == "false" ]; then
return return
fi fi
@@ -254,9 +253,8 @@ switch() {
pre_process "$mode_flag" pre_process "$mode_flag"
# Check if app and shell theming is enabled in config # Check if app and shell theming is enabled in config
CONFIG_FILE="$XDG_CONFIG_HOME/illogical-impulse/config.json" if [ -f "$SHELL_CONFIG_FILE" ]; then
if [ -f "$CONFIG_FILE" ]; then enable_apps_shell=$(jq -r '.appearance.wallpaperTheming.enableAppsAndShell' "$SHELL_CONFIG_FILE")
enable_apps_shell=$(jq -r '.appearance.wallpaperTheming.enableAppsAndShell' "$CONFIG_FILE")
if [ "$enable_apps_shell" == "false" ]; then if [ "$enable_apps_shell" == "false" ]; then
echo "App and shell theming disabled, skipping matugen and color generation" echo "App and shell theming disabled, skipping matugen and color generation"
return return
@@ -285,7 +283,7 @@ main() {
noswitch_flag="" noswitch_flag=""
get_type_from_config() { get_type_from_config() {
jq -r '.appearance.palette.type' "$XDG_CONFIG_HOME/illogical-impulse/config.json" 2>/dev/null || echo "auto" jq -r '.appearance.palette.type' "$SHELL_CONFIG_FILE" 2>/dev/null || echo "auto"
} }
detect_scheme_type_from_image() { detect_scheme_type_from_image() {