home-profile: zsh change colors detect

This commit is contained in:
Mateusz Słodkowicz 2024-03-30 21:10:34 +01:00
parent b91142f643
commit 8691fcd211
Signed by: materus
SSH Key Fingerprint: SHA256:rzVduzTiiszuYfLPYD0SDZV+g8lxhpcRgpbOZA1X0Uo
1 changed files with 6 additions and 1 deletions

View File

@ -70,6 +70,11 @@ in
envExtra = ''
if zmodload zsh/terminfo && (( "$terminfo[colors]" >= "256" )); then
__MATERUS_HM_ZSH_256COLORS="''${__MATERUS_HM_ZSH_256COLORS:-1}"; else
__MATERUS_HM_ZSH_256COLORS="''${__MATERUS_HM_ZSH_256COLORS:-0}";
fi
${makeEnv "__MATERUS_HM_ZSH" "1"}
${makeEnv "__MATERUS_HM_ZSH_PROMPT" cfg.prompt}
${makeEnv "__MATERUS_HM_ZSH_PRIVATE" "0"}
@ -131,7 +136,7 @@ in
'' +
makeIfVar "__MATERUS_HM_ZSH_PROMPT" "p10k" ''
if zmodload zsh/terminfo && (( terminfo[colors] >= 256 )); then
if [[ "$__MATERUS_HM_ZSH_256COLORS" = "1" ]] ; then
[[ ! -f ${p10kcfg}/fullcolor.zsh ]] || source ${p10kcfg}/fullcolor.zsh
else
[[ ! -f ${p10kcfg}/compatibility.zsh ]] || source ${p10kcfg}/compatibility.zsh