From ffb8e284b442d808365adafbc276582ca76cd025 Mon Sep 17 00:00:00 2001 From: cupcat121 <75441895+cupcat121@users.noreply.github.com> Date: Sat, 6 Sep 2025 11:26:42 +0800 Subject: [PATCH 1/6] add config to force terminal theming mode --- .config/quickshell/ii/modules/common/Config.qml | 1 + .../ii/modules/settings/AdvancedConfig.qml | 14 +++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.config/quickshell/ii/modules/common/Config.qml b/.config/quickshell/ii/modules/common/Config.qml index 370b0bb34..71dab67c5 100644 --- a/.config/quickshell/ii/modules/common/Config.qml +++ b/.config/quickshell/ii/modules/common/Config.qml @@ -91,6 +91,7 @@ Singleton { property bool enableAppsAndShell: true property bool enableQtApps: true property bool enableTerminal: true + property bool forceTerminalDarkMode: false } property JsonObject palette: JsonObject { property string type: "auto" // Allowed: auto, scheme-content, scheme-expressive, scheme-fidelity, scheme-fruit-salad, scheme-monochrome, scheme-neutral, scheme-rainbow, scheme-tonal-spot diff --git a/.config/quickshell/ii/modules/settings/AdvancedConfig.qml b/.config/quickshell/ii/modules/settings/AdvancedConfig.qml index 13e97deb2..f5346e8b3 100644 --- a/.config/quickshell/ii/modules/settings/AdvancedConfig.qml +++ b/.config/quickshell/ii/modules/settings/AdvancedConfig.qml @@ -40,7 +40,19 @@ ContentPage { content: Translation.tr("Shell & utilities theming must also be enabled") } } - + } + ConfigRow { + uniform: true + ConfigSwitch { + text: Translation.tr("Force dark mode in terminal") + checked: Config.options.appearance.wallpaperTheming.forceTerminalDarkMode + onCheckedChanged: { + Config.options.appearance.wallpaperTheming.forceTerminalDarkMode = checked; + } + StyledToolTip { + content: Translation.tr("Ignored if terminal theming is not enabled") + } + } } } } From b53de43c9582b8a89be09cb4e72fc783c188a8e0 Mon Sep 17 00:00:00 2001 From: cupcat121 <75441895+cupcat121@users.noreply.github.com> Date: Sat, 6 Sep 2025 11:30:46 +0800 Subject: [PATCH 2/6] add forced theming mode for terminal --- .../quickshell/ii/scripts/colors/applycolor.sh | 18 +++++++++++++----- .../quickshell/ii/scripts/colors/switchwall.sh | 8 +++++++- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/.config/quickshell/ii/scripts/colors/applycolor.sh b/.config/quickshell/ii/scripts/colors/applycolor.sh index ddb93bd20..1d5ac9706 100755 --- a/.config/quickshell/ii/scripts/colors/applycolor.sh +++ b/.config/quickshell/ii/scripts/colors/applycolor.sh @@ -8,6 +8,7 @@ CONFIG_DIR="$XDG_CONFIG_HOME/quickshell/$QUICKSHELL_CONFIG_NAME" CACHE_DIR="$XDG_CACHE_HOME/quickshell" STATE_DIR="$XDG_STATE_HOME/quickshell" SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +SHELL_CONFIG_FILE="$XDG_CONFIG_HOME/illogical-impulse/config.json" term_alpha=100 #Set this to < 100 make all your terminals transparent # sleep 0 # idk i wanted some delay or colors dont get applied properly @@ -23,11 +24,19 @@ colorvalues=() colornames=$(cat $STATE_DIR/user/generated/material_colors.scss | cut -d: -f1) colorstrings=$(cat $STATE_DIR/user/generated/material_colors.scss | cut -d: -f2 | cut -d ' ' -f2 | cut -d ";" -f1) +colorstrings_dark=$(cat $STATE_DIR/user/generated/material_colors_dark.scss | cut -d: -f2 | cut -d ' ' -f2 | cut -d ";" -f1) IFS=$'\n' colorlist=($colornames) # Array of color names colorvalues=($colorstrings) # Array of color values +colorvalues_dark=($colorstrings_dark) # Array of color values (dark mode) apply_term() { + local applied_colorvalues=("${colorvalues[@]}") + local terminal_force_dark_theme="jq -r '.appearance.wallpaperTheming.forceTerminalDarkMode' $SHELL_CONFIG_FILE" + if [[ $(eval "$terminal_force_dark_theme") == "true" ]]; then + applied_colorvalues=("${colorvalues_dark[@]}") + fi + # Check if terminal escape sequence template exists if [ ! -f "$SCRIPT_DIR/terminal/sequences.txt" ]; then echo "Template file not found for Terminal. Skipping that." @@ -38,7 +47,7 @@ apply_term() { cp "$SCRIPT_DIR/terminal/sequences.txt" "$STATE_DIR"/user/generated/terminal/sequences.txt # Apply colors for i in "${!colorlist[@]}"; do - sed -i "s/${colorlist[$i]} #/${colorvalues[$i]#\#}/g" "$STATE_DIR"/user/generated/terminal/sequences.txt + sed -i "s/${colorlist[$i]} #/${applied_colorvalues[$i]#\#}/g" "$STATE_DIR"/user/generated/terminal/sequences.txt done sed -i "s/\$alpha/$term_alpha/g" "$STATE_DIR/user/generated/terminal/sequences.txt" @@ -58,14 +67,13 @@ apply_qt() { } # 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 [ -f "$SHELL_CONFIG_FILE" ]; then + enable_terminal=$(jq -r '.appearance.wallpaperTheming.enableTerminal' "$SHELL_CONFIG_FILE") if [ "$enable_terminal" = "true" ]; then apply_term & fi else - echo "Config file not found at $CONFIG_FILE. Applying terminal theming by default." + echo "Config file not found at $SHELL_CONFIG_FILE. Applying terminal theming by default." apply_term & fi diff --git a/.config/quickshell/ii/scripts/colors/switchwall.sh b/.config/quickshell/ii/scripts/colors/switchwall.sh index 31db37b40..c4b8e209c 100755 --- a/.config/quickshell/ii/scripts/colors/switchwall.sh +++ b/.config/quickshell/ii/scripts/colors/switchwall.sh @@ -264,11 +264,15 @@ switch() { fi fi - [[ -n "$mode_flag" ]] && matugen_args+=(--mode "$mode_flag") && generate_colors_material_args+=(--mode "$mode_flag") [[ -n "$type_flag" ]] && matugen_args+=(--type "$type_flag") && generate_colors_material_args+=(--scheme "$type_flag") generate_colors_material_args+=(--termscheme "$terminalscheme" --blend_bg_fg) generate_colors_material_args+=(--cache "$STATE_DIR/user/generated/color.txt") + generate_colors_material_dark_args=("${generate_colors_material_args[@]}") + generate_colors_material_dark_args+=(--mode "dark") + [[ -n "$mode_flag" ]] && matugen_args+=(--mode "$mode_flag") && generate_colors_material_args+=(--mode "$mode_flag") + + pre_process "$mode_flag" # Check if app and shell theming is enabled in config @@ -284,6 +288,8 @@ switch() { source "$(eval echo $ILLOGICAL_IMPULSE_VIRTUAL_ENV)/bin/activate" python3 "$SCRIPT_DIR/generate_colors_material.py" "${generate_colors_material_args[@]}" \ > "$STATE_DIR"/user/generated/material_colors.scss + python3 "$SCRIPT_DIR/generate_colors_material.py" "${generate_colors_material_dark_args[@]}" \ + > "$STATE_DIR"/user/generated/material_colors_dark.scss "$SCRIPT_DIR"/applycolor.sh deactivate From 3310d2b43178824fbd0180de76b99efb05aa9910 Mon Sep 17 00:00:00 2001 From: cupcat121 <75441895+cupcat121@users.noreply.github.com> Date: Sat, 6 Sep 2025 11:31:49 +0800 Subject: [PATCH 3/6] update zh_CN translation --- .config/quickshell/translations/zh_CN.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.config/quickshell/translations/zh_CN.json b/.config/quickshell/translations/zh_CN.json index 7d068db63..fe696900f 100644 --- a/.config/quickshell/translations/zh_CN.json +++ b/.config/quickshell/translations/zh_CN.json @@ -254,11 +254,13 @@ "Privacy Policy": "隐私政策", "Documentation": "文档", "Shell & utilities theming must also be enabled": "必须同时启用 Shell 与工具主题", + "Ignored if terminal theming is not enabled": "终端主题未启用时不生效", "illogical-impulse": "illogical-impulse", "Donate": "捐助", "Terminal": "终端", "Shell & utilities": "Shell 与工具", "Qt apps": "Qt 应用", + "Force dark mode in terminal": "终端强制使用深色模式", "Report a Bug": "报告问题", "Issues": "问题追踪", "Drag or click a region • LMB: Copy • RMB: Edit": "拖动或点击一个区域 • 鼠标左键:复制 • 鼠标右键:编辑", @@ -399,4 +401,4 @@ "Language setting saved. Please restart Quickshell (Ctrl+Super+R) to apply the new language.": "语言设置已保存。请重启 Quickshell (Ctrl+Super+R) 以应用新语言。", "Auto (System)": "自动(系统)", "Interface Language": "界面语言" -} \ No newline at end of file +} From 4ff6b2a30aad316bc9ffcb39a79aa97f328d99d4 Mon Sep 17 00:00:00 2001 From: cupcat121 <75441895+cupcat121@users.noreply.github.com> Date: Sat, 6 Sep 2025 12:21:07 +0800 Subject: [PATCH 4/6] update en_US translation --- .config/quickshell/translations/en_US.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.config/quickshell/translations/en_US.json b/.config/quickshell/translations/en_US.json index 954a1ae6b..d5889905c 100644 --- a/.config/quickshell/translations/en_US.json +++ b/.config/quickshell/translations/en_US.json @@ -238,11 +238,13 @@ "Privacy Policy": "Privacy Policy", "Documentation": "Documentation", "Shell & utilities theming must also be enabled": "Shell & utilities theming must also be enabled", + "Ignored if terminal theming is not enabled": "Ignored if terminal theming is not enabled", "illogical-impulse": "illogical-impulse", "Donate": "Donate", "Terminal": "Terminal", "Shell & utilities": "Shell & utilities", "Qt apps": "Qt apps", + "Force dark mode in terminal": "Force dark mode in terminal", "Report a Bug": "Report a Bug", "Issues": "Issues", "Drag or click a region • LMB: Copy • RMB: Edit": "Drag or click a region • LMB: Copy • RMB: Edit", @@ -394,4 +396,4 @@ "Online | Google's model\nGoogle's state-of-the-art multipurpose model that excels at coding and complex reasoning tasks.": "Online | Google's model\nGoogle's state-of-the-art multipurpose model that excels at coding and complex reasoning tasks.", "EasyEffects | Right-click to configure": "EasyEffects | Right-click to configure", "Automatically hide": "Automatically hide" -} \ No newline at end of file +} From 22918e4b4a9814b7491a3bc121f41a5b256ee8b2 Mon Sep 17 00:00:00 2001 From: cupcat121 <75441895+cupcat121@users.noreply.github.com> Date: Mon, 8 Sep 2025 18:46:52 +0800 Subject: [PATCH 5/6] move config to terminalGenerationProps --- .config/quickshell/ii/modules/common/Config.qml | 1 + .../ii/modules/settings/AdvancedConfig.qml | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/.config/quickshell/ii/modules/common/Config.qml b/.config/quickshell/ii/modules/common/Config.qml index 83529df41..0365fa831 100644 --- a/.config/quickshell/ii/modules/common/Config.qml +++ b/.config/quickshell/ii/modules/common/Config.qml @@ -95,6 +95,7 @@ Singleton { property real harmony: 0.8 property real harmonizeThreshold: 100 property real termFgBoost: 0.35 + property bool forceDarkMode: false } } property JsonObject palette: JsonObject { diff --git a/.config/quickshell/ii/modules/settings/AdvancedConfig.qml b/.config/quickshell/ii/modules/settings/AdvancedConfig.qml index d28f7fb5b..9a8aa2a3b 100644 --- a/.config/quickshell/ii/modules/settings/AdvancedConfig.qml +++ b/.config/quickshell/ii/modules/settings/AdvancedConfig.qml @@ -41,6 +41,20 @@ ContentPage { content: Translation.tr("Shell & utilities theming must also be enabled") } } + ConfigRow { + uniform: true + ConfigSwitch { + buttonIcon: "dark_mode" + text: Translation.tr("Force dark mode in terminal") + checked: Config.options.appearance.wallpaperTheming.terminalGenerationProps.forceDarkMode + onCheckedChanged: { + Config.options.appearance.wallpaperTheming.terminalGenerationProps.forceDarkMode= checked; + } + StyledToolTip { + content: Translation.tr("Ignored if terminal theming is not enabled") + } + } + } ConfigSpinBox { icon: "invert_colors" From 9582a473c67ff430398bf07adee557c96702c545 Mon Sep 17 00:00:00 2001 From: cupcat121 <75441895+cupcat121@users.noreply.github.com> Date: Mon, 8 Sep 2025 20:24:06 +0800 Subject: [PATCH 6/6] revert applycolor.sh and rewrite the main logic --- .../quickshell/ii/scripts/colors/applycolor.sh | 18 +++++------------- .../quickshell/ii/scripts/colors/switchwall.sh | 16 +++++++++------- 2 files changed, 14 insertions(+), 20 deletions(-) diff --git a/.config/quickshell/ii/scripts/colors/applycolor.sh b/.config/quickshell/ii/scripts/colors/applycolor.sh index 1d5ac9706..ddb93bd20 100755 --- a/.config/quickshell/ii/scripts/colors/applycolor.sh +++ b/.config/quickshell/ii/scripts/colors/applycolor.sh @@ -8,7 +8,6 @@ CONFIG_DIR="$XDG_CONFIG_HOME/quickshell/$QUICKSHELL_CONFIG_NAME" CACHE_DIR="$XDG_CACHE_HOME/quickshell" STATE_DIR="$XDG_STATE_HOME/quickshell" SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -SHELL_CONFIG_FILE="$XDG_CONFIG_HOME/illogical-impulse/config.json" term_alpha=100 #Set this to < 100 make all your terminals transparent # sleep 0 # idk i wanted some delay or colors dont get applied properly @@ -24,19 +23,11 @@ colorvalues=() colornames=$(cat $STATE_DIR/user/generated/material_colors.scss | cut -d: -f1) colorstrings=$(cat $STATE_DIR/user/generated/material_colors.scss | cut -d: -f2 | cut -d ' ' -f2 | cut -d ";" -f1) -colorstrings_dark=$(cat $STATE_DIR/user/generated/material_colors_dark.scss | cut -d: -f2 | cut -d ' ' -f2 | cut -d ";" -f1) IFS=$'\n' colorlist=($colornames) # Array of color names colorvalues=($colorstrings) # Array of color values -colorvalues_dark=($colorstrings_dark) # Array of color values (dark mode) apply_term() { - local applied_colorvalues=("${colorvalues[@]}") - local terminal_force_dark_theme="jq -r '.appearance.wallpaperTheming.forceTerminalDarkMode' $SHELL_CONFIG_FILE" - if [[ $(eval "$terminal_force_dark_theme") == "true" ]]; then - applied_colorvalues=("${colorvalues_dark[@]}") - fi - # Check if terminal escape sequence template exists if [ ! -f "$SCRIPT_DIR/terminal/sequences.txt" ]; then echo "Template file not found for Terminal. Skipping that." @@ -47,7 +38,7 @@ apply_term() { cp "$SCRIPT_DIR/terminal/sequences.txt" "$STATE_DIR"/user/generated/terminal/sequences.txt # Apply colors for i in "${!colorlist[@]}"; do - sed -i "s/${colorlist[$i]} #/${applied_colorvalues[$i]#\#}/g" "$STATE_DIR"/user/generated/terminal/sequences.txt + sed -i "s/${colorlist[$i]} #/${colorvalues[$i]#\#}/g" "$STATE_DIR"/user/generated/terminal/sequences.txt done sed -i "s/\$alpha/$term_alpha/g" "$STATE_DIR/user/generated/terminal/sequences.txt" @@ -67,13 +58,14 @@ apply_qt() { } # Check if terminal theming is enabled in config -if [ -f "$SHELL_CONFIG_FILE" ]; then - enable_terminal=$(jq -r '.appearance.wallpaperTheming.enableTerminal' "$SHELL_CONFIG_FILE") +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 $SHELL_CONFIG_FILE. Applying terminal theming by default." + echo "Config file not found at $CONFIG_FILE. Applying terminal theming by default." apply_term & fi diff --git a/.config/quickshell/ii/scripts/colors/switchwall.sh b/.config/quickshell/ii/scripts/colors/switchwall.sh index 013936650..8b6514f39 100755 --- a/.config/quickshell/ii/scripts/colors/switchwall.sh +++ b/.config/quickshell/ii/scripts/colors/switchwall.sh @@ -264,15 +264,19 @@ switch() { fi fi + # enforce dark mode for terminal + if [[ -n "$mode_flag" ]]; then + matugen_args+=(--mode "$mode_flag") + if [[ $(jq -r '.appearance.wallpaperTheming.terminalGenerationProps.forceDarkMode' "$SHELL_CONFIG_FILE") == "true" ]]; then + generate_colors_material_args+=(--mode "dark") + else + generate_colors_material_args+=(--mode "$mode_flag") + fi + fi [[ -n "$type_flag" ]] && matugen_args+=(--type "$type_flag") && generate_colors_material_args+=(--scheme "$type_flag") generate_colors_material_args+=(--termscheme "$terminalscheme" --blend_bg_fg) generate_colors_material_args+=(--cache "$STATE_DIR/user/generated/color.txt") - generate_colors_material_dark_args=("${generate_colors_material_args[@]}") - generate_colors_material_dark_args+=(--mode "dark") - [[ -n "$mode_flag" ]] && matugen_args+=(--mode "$mode_flag") && generate_colors_material_args+=(--mode "$mode_flag") - - pre_process "$mode_flag" # Check if app and shell theming is enabled in config @@ -298,8 +302,6 @@ switch() { source "$(eval echo $ILLOGICAL_IMPULSE_VIRTUAL_ENV)/bin/activate" python3 "$SCRIPT_DIR/generate_colors_material.py" "${generate_colors_material_args[@]}" \ > "$STATE_DIR"/user/generated/material_colors.scss - python3 "$SCRIPT_DIR/generate_colors_material.py" "${generate_colors_material_dark_args[@]}" \ - > "$STATE_DIR"/user/generated/material_colors_dark.scss "$SCRIPT_DIR"/applycolor.sh deactivate