Feat: Add option to enforce dark mode for the terminal (#1945)

This commit is contained in:
end-4 2025-09-08 22:35:14 +02:00 committed by GitHub
commit e3f25e3bc4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 30 additions and 3 deletions

View file

@ -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 {

View file

@ -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"

View file

@ -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")

View file

@ -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"
}
}

View file

@ -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": "界面语言"
}
}