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" diff --git a/.config/quickshell/ii/scripts/colors/switchwall.sh b/.config/quickshell/ii/scripts/colors/switchwall.sh index 229d89957..8b6514f39 100755 --- a/.config/quickshell/ii/scripts/colors/switchwall.sh +++ b/.config/quickshell/ii/scripts/colors/switchwall.sh @@ -264,7 +264,15 @@ switch() { fi fi - [[ -n "$mode_flag" ]] && matugen_args+=(--mode "$mode_flag") && generate_colors_material_args+=(--mode "$mode_flag") + # 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") 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 +} 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 +}