Skip to content

Commit

Permalink
feat: Themes support +2 new themes blue and gold.
Browse files Browse the repository at this point in the history
  • Loading branch information
psprint committed Dec 24, 2022
1 parent 515688b commit 6dbc35e
Show file tree
Hide file tree
Showing 5 changed files with 135 additions and 44 deletions.
41 changes: 41 additions & 0 deletions share/themes/blue.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@

# -*- mode: sh; sh-indentation: 4; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# Copyright (c) 2016-2020 Sebastian Gniazdowski and contributors.

ZINIT+=(
col-pname $'\e[1;38;5;27m' col-uname $'\e[1;38;5;39m' col-keyword $'\e[27m'
col-note $'\e[38;5;69m' col-error $'\e[1;38;5;9m' col-p $'\e[38;5;81m'
col-info $'\e[38;5;39m' col-info2 $'\e[38;5;227m' col-profile $'\e[38;5;69m'
col-uninst $'\e[38;5;118m' col-info3 $'\e[1m\e[38;5;227m' col-slight $'\e[38;5;230m'
col-failure $'\e[38;5;75m' col-happy $'\e[1m\e[38;5;39m' col-annex $'\e[38;5;33m'
col-id-as $'\e[1;4;38;5;75m' col-version $'\e[3;38;5;69m'
# The more recent, fresh ones:
col-pre $'\e[38;5;27m' col-msg $'\e[0m' col-msg2 $'\e[38;5;174m'
col-obj $'\e[38;5;208m' col-obj2 $'\e[38;5;69m' col-file $'\e[3;38;5;41m'
col-dir $'\e[3;38;5;75m' col-func $'\e[38;5;208m'
col-url $'\e[38;5;75m' col-meta $'\e[38;5;69m' col-meta2 $'\e[38;5;39m'
col-data $'\e[38;5;33m' col-data2 $'\e[38;5;117m' col-hi $'\e[1m\e[38;5;208m'
col-var $'\e[38;5;81m' col-glob $'\e[1;38;5;118m' col-ehi $'\e[1m\e[38;5;208m'
col-cmd $'\e[38;5;39m' col-ice $'\e[38;5;39m' col-nl $'\n'
col-txt $'\e[38;5;254m' col-num $'\e[3;38;5;155m' col-term $'\e[38;5;185m'
col-warn $'\e[38;5;208m' col-ok $'\e[38;5;220m' col-time $'\e[38;5;220m'
col-apo $'\e[1;38;5;45m' col-aps $'\e[38;5;117m'
col-quo $'\e[1;38;5;33m' col-quos $'\e[1;38;5;204m'
col-bapo $'\e[1;38;5;208m' col-baps $'\e[1;38;5;39m'
col-faint $'\e[38;5;238m' col-opt $'\e[1;38;5;75m' col-lhi $'\e[38;5;117m'
col-flag $'\e[1;3;38;5;69m' col-pkg $'\e[1;3;38;5;27m'
col-tab $' \t ' col-msg3 $'\e[38;5;238m' col-b-lhi $'\e[1m\e[38;5;75m'
col-bar $'\e[38;5;39m' col-th-bar $'\e[38;5;39m'
col-… "${${${(M)LANG:#*UTF-8*}:+…}:-...}" col-ndsh "${${${(M)LANG:#*UTF-8*}:+–}:-}"
col-mdsh $'\e[1;38;5;220m'"${${${(M)LANG:#*UTF-8*}:+–}:--}"$'\e[0m'
col-mmdsh $'\e[1;38;5;220m'"${${${(M)LANG:#*UTF-8*}:+――}:--}"$'\e[0m'
col--… "${${${(M)LANG:#*UTF-8*}:+⋯⋯}:-···}" col-lr "${${${(M)LANG:#*UTF-8*}:+↔}:-"«-»"}"
col-↔ ${${${(M)LANG:#*UTF-8*}:+$'\e[38;5;39m↔\e[0m'}:-$'\e[38;5;39m«-»\e[0m'}
col-rst $'\e[0m' col-b $'\e[1m' col-nb $'\e[22m'
col-u $'\e[4m' col-it $'\e[3m' col-st $'\e[9m'
col-nu $'\e[24m' col-nit $'\e[23m' col-nst $'\e[29m'
col-bspc $'\b' col-b-warn $'\e[1;38;5;214m' col-u-warn $'\e[4;38;5;214m'
col-bcmd $'\e[38;5;220m'
)

# vim: ft=zsh sw=4 ts=4 et foldmarker=[[[,]]] foldmethod=marker
46 changes: 46 additions & 0 deletions share/themes/default.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# -*- mode: sh; sh-indentation: 4; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# Copyright (c) 2016-2020 Sebastian Gniazdowski and contributors.

ZINIT+=(
# Old colors: 31m
col-pname $'\e[1;4m\e[32m' col-uname $'\e[1;4m\e[35m' col-keyword $'\e[32m'
col-note $'\e[38;5;148m' col-error $'\e[1;38;5;9m' col-p $'\e[38;5;81m'
col-info $'\e[38;5;82m' col-info2 $'\e[38;5;227m' col-profile $'\e[38;5;148m'
col-uninst $'\e[38;5;118m' col-info3 $'\e[1m\e[38;5;227m' col-slight $'\e[38;5;230m'
col-failure $'\e[38;5;204m' col-happy $'\e[1m\e[38;5;82m' col-annex $'\e[38;5;153m'
col-id-as $'\e[4;38;5;220m' col-version $'\e[3;38;5;87m'
# The more recent, fresh ones:
col-pre $'\e[38;5;135m' col-msg $'\e[0m' col-msg2 $'\e[38;5;172m'
col-obj $'\e[38;5;218m' col-obj2 $'\e[38;5;118m' col-file $'\e[3;38;5;117m'
col-dir $'\e[3;38;5;153m' col-func $'\e[38;5;219m'
col-url $'\e[38;5;75m' col-meta $'\e[38;5;57m' col-meta2 $'\e[38;5;147m'
col-data $'\e[38;5;82m' col-data2 $'\e[38;5;117m' col-hi $'\e[1m\e[38;5;183m'
col-var $'\e[38;5;81m' col-glob $'\e[38;5;227m' col-ehi $'\e[1m\e[38;5;210m'
col-cmd $'\e[38;5;82m' col-ice $'\e[38;5;39m' col-nl $'\n'
col-txt $'\e[38;5;254m' col-num $'\e[3;38;5;155m' col-term $'\e[38;5;185m'
col-warn $'\e[38;5;208m' col-ok $'\e[38;5;220m' col-time $'\e[38;5;220m'
col-apo $'\e[1;38;5;45m' col-aps $'\e[38;5;117m'
col-quo $'\e[1;38;5;33m' col-quos $'\e[1;38;5;160m'
col-bapo $'\e[1;38;5;220m' col-baps $'\e[1;38;5;82m'
col-faint $'\e[38;5;238m' col-opt $'\e[38;5;219m' col-lhi $'\e[38;5;81m'
col-flag $'\e[1;3;38;5;79m' col-pkg $'\e[1;3;38;5;27m'
col-tab $' \t ' col-msg3 $'\e[38;5;238m' col-b-lhi $'\e[1m\e[38;5;75m'
col-bar $'\e[38;5;82m' col-th-bar $'\e[38;5;82m'
col-… "${${${(M)LANG:#*UTF-8*}:+…}:-...}" col-ndsh "${${${(M)LANG:#*UTF-8*}:+–}:-}"
col-mdsh $'\e[1;38;5;220m'"${${${(M)LANG:#*UTF-8*}:+–}:--}"$'\e[0m'
col-mmdsh $'\e[1;38;5;220m'"${${${(M)LANG:#*UTF-8*}:+――}:--}"$'\e[0m'
col--… "${${${(M)LANG:#*UTF-8*}:+⋯⋯}:-···}" col-lr "${${${(M)LANG:#*UTF-8*}:+↔}:-"«-»"}"
col-↔ ${${${(M)LANG:#*UTF-8*}:+$'\e[38;5;82m↔\e[0m'}:-$'\e[38;5;82m«-»\e[0m'}
col-rst $'\e[0m' col-b $'\e[1m' col-nb $'\e[22m'
col-u $'\e[4m' col-it $'\e[3m' col-st $'\e[9m'
col-nu $'\e[24m' col-nit $'\e[23m' col-nst $'\e[29m'
col-bspc $'\b' col-b-warn $'\e[1;38;5;214m' col-u-warn $'\e[4;38;5;214m'
col-bcmd $'\e[38;5;220m'
)
if [[ ( ${+terminfo} -eq 1 && ${terminfo[colors]} -ge 256 ) || \
( ${+termcap} -eq 1 && ${termcap[Co]} -ge 256 )
]] {
ZINIT+=( col-pname $'\e[1;4m\e[38;5;39m' col-uname $'\e[1;4m\e[38;5;207m' )
}

# vim: ft=zsh sw=4 ts=4 et foldmarker=[[[,]]] foldmethod=marker
41 changes: 41 additions & 0 deletions share/themes/gold.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# -*- mode: sh; sh-indentation: 4; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# Copyright (c) 2016-2020 Sebastian Gniazdowski and contributors.

# Different shades of gold/yellow (220):
ZINIT+=(
col-pname $'\e[1;38;5;220m' col-uname $'\e[1;38;5;178m' col-keyword $'\e[137m'
col-note $'\e[38;5;220m' col-error $'\e[1m\e[38;5;9m' col-p $'\e[38;5;81m'
col-info $'\e[38;5;178m' col-info2 $'\e[38;5;227m' col-profile $'\e[38;5;220m'
col-uninst $'\e[38;5;118m' col-info3 $'\e[1m\e[38;5;227m' col-slight $'\e[38;5;230m'
col-failure $'\e[38;5;204m' col-happy $'\e[1m\e[38;5;178m' col-annex $'\e[38;5;33m'
col-id-as $'\e[1;4;38;5;130m' col-version $'\e[3;38;5;220m'
# The more recent, fresh ones:
col-pre $'\e[38;5;41m' col-msg $'\e[0m' col-msg2 $'\e[38;5;174m'
col-obj $'\e[38;5;178m' col-obj2 $'\e[38;5;220m' col-file $'\e[3;38;5;41m'
col-dir $'\e[3;38;5;204m' col-func $'\e[38;5;208m'
col-url $'\e[38;5;130m' col-meta $'\e[38;5;220m' col-meta2 $'\e[38;5;178m'
col-data $'\e[38;5;33m' col-data2 $'\e[38;5;117m' col-hi $'\e[1m\e[38;5;208m'
col-var $'\e[38;5;81m' col-glob $'\e[1;38;5;118m' col-ehi $'\e[1m\e[38;5;208m'
col-cmd $'\e[38;5;178m' col-ice $'\e[38;5;178m' col-nl $'\n'
col-txt $'\e[38;5;254m' col-num $'\e[3;38;5;155m' col-term $'\e[38;5;185m'
col-warn $'\e[38;5;204m' col-ok $'\e[38;5;220m' col-time $'\e[38;5;220m'
col-apo $'\e[1;38;5;130m' col-aps $'\e[38;5;117m'
col-quo $'\e[1;38;5;33m' col-quos $'\e[1;38;5;204m'
col-bapo $'\e[1;38;5;208m' col-baps $'\e[1;38;5;178m'
col-faint $'\e[38;5;238m' col-opt $'\e[1;38;5;130m' col-lhi $'\e[38;5;117m'
col-flag $'\e[1;3;38;5;220m' col-pkg $'\e[1;3;38;5;137m'
col-tab $' \t ' col-msg3 $'\e[38;5;238m' col-b-lhi $'\e[1m\e[38;5;75m'
col-bar $'\e[38;5;178m' col-th-bar $'\e[38;5;178m'
col-… "${${${(M)LANG:#*UTF-8*}:+…}:-...}" col-ndsh "${${${(M)LANG:#*UTF-8*}:+–}:-}"
col-mdsh $'\e[1;38;5;220m'"${${${(M)LANG:#*UTF-8*}:+–}:--}"$'\e[0m'
col-mmdsh $'\e[1;38;5;220m'"${${${(M)LANG:#*UTF-8*}:+――}:--}"$'\e[0m'
col--… "${${${(M)LANG:#*UTF-8*}:+⋯⋯}:-···}" col-lr "${${${(M)LANG:#*UTF-8*}:+↔}:-"«-»"}"
col-↔ ${${${(M)LANG:#*UTF-8*}:+$'\e[38;5;178m↔\e[0m'}:-$'\e[38;5;178m«-»\e[0m'}
col-rst $'\e[0m' col-b $'\e[1m' col-nb $'\e[22m'
col-u $'\e[4m' col-it $'\e[3m' col-st $'\e[9m'
col-nu $'\e[24m' col-nit $'\e[23m' col-nst $'\e[29m'
col-bspc $'\b' col-b-warn $'\e[1;38;5;214m' col-u-warn $'\e[4;38;5;214m'
col-bcmd $'\e[38;5;220m'
)

# vim: ft=zsh sw=4 ts=4 et foldmarker=[[[,]]] foldmethod=marker
4 changes: 2 additions & 2 deletions zinit-install.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -1731,7 +1731,7 @@ ziextract() {
.zinit-extract-wrapper() {
local file="$1" fun="$2" retval
(( !OPTS[opt_-q,--quiet] )) && \
+zinit-message "{info}[{pre}ziextract{info}]{rst} Unpacking the files from: \`{obj}$file{msg}'{…}{rst}"
+zinit-message "{info}[{pre}ziextract{info}]{rst} Unpacking the files from: \`{file}$file{msg}'{…}"
$fun; retval=$?
if (( retval == 0 )) {
local -a files
Expand Down Expand Up @@ -1880,7 +1880,7 @@ ziextract() {
command chmod a+x "${execs[@]}"
if (( !OPTS[opt_-q,--quiet] )) {
if (( ${#execs} == 1 )); then
+zinit-message "{info}[{pre}ziextract{info}]{rst} Successfully extracted and assigned +x chmod to the file: {obj}${execs[1]}{rst}."
+zinit-message "{info}[{pre}ziextract{info}]{rst} Successfully extracted and assigned +x chmod to the file: {file}${execs[1]}{rst}."
else
local sep="$ZINIT[col-rst],$ZINIT[col-obj] "
if (( ${#execs} > 7 )) {
Expand Down
47 changes: 5 additions & 42 deletions zinit.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ unset ZPLGM
ZINIT[ZERO]="${ZERO:-${${0:#$ZSH_ARGZERO}:-${(%):-%N}}}"
[[ ! -o functionargzero || ${options[posixargzero]} = on || ${ZINIT[ZERO]} != */* ]] && ZINIT[ZERO]="${(%):-%N}"

: ${ZINIT[BIN_DIR]:="${ZINIT[ZERO]:h}"}
: ${ZINIT[BIN_DIR]:=${ZINIT[ZERO]:h}}
[[ ${ZINIT[BIN_DIR]} = \~* ]] && ZINIT[BIN_DIR]=${~ZINIT[BIN_DIR]}

# Make ZINIT[BIN_DIR] path absolute.
Expand Down Expand Up @@ -136,6 +136,8 @@ typeset -g ZPFX
: ${ZPFX:=${ZINIT[HOME_DIR]}/polaris}
: ${ZINIT[ALIASES_OPT]::=${${options[aliases]:#off}:+1}}
: ${ZINIT[MAN_DIR]:=${ZPFX}/man}
: ${ZINIT[THEME_DIR]:=$ZINIT[BIN_DIR]/share/themes}
: ${ZITHEME:=default}

ZINIT[PLUGINS_DIR]=${~ZINIT[PLUGINS_DIR]} ZINIT[COMPLETIONS_DIR]=${~ZINIT[COMPLETIONS_DIR]}
ZINIT[SNIPPETS_DIR]=${~ZINIT[SNIPPETS_DIR]} ZINIT[SERVICES_DIR]=${~ZINIT[SERVICES_DIR]}
Expand Down Expand Up @@ -192,47 +194,8 @@ zmodload zsh/termcap 2>/dev/null
if [[ -z $SOURCED && ( ${+terminfo} -eq 1 && -n ${terminfo[colors]} ) || \
( ${+termcap} -eq 1 && -n ${termcap[Co]} )
]] {
ZINIT+=(
# Old colors: 31m
col-pname $'\e[1;4m\e[32m' col-uname $'\e[1;4m\e[35m' col-keyword $'\e[32m'
col-note $'\e[38;5;148m' col-error $'\e[1m\e[38;5;204m' col-p $'\e[38;5;81m'
col-info $'\e[38;5;82m' col-info2 $'\e[38;5;227m' col-profile $'\e[38;5;148m'
col-uninst $'\e[38;5;118m' col-info3 $'\e[1m\e[38;5;227m' col-slight $'\e[38;5;230m'
col-failure $'\e[38;5;204m' col-happy $'\e[1m\e[38;5;82m' col-annex $'\e[38;5;153m'
col-id-as $'\e[4;38;5;220m' col-version $'\e[3;38;5;87m'
# The more recent, fresh ones:
col-pre $'\e[38;5;135m' col-msg $'\e[0m' col-msg2 $'\e[38;5;172m'
col-obj $'\e[38;5;218m' col-obj2 $'\e[38;5;118m' col-file $'\e[3;38;5;117m'
col-dir $'\e[3;38;5;153m' col-func $'\e[38;5;219m'
col-url $'\e[38;5;75m' col-meta $'\e[38;5;57m' col-meta2 $'\e[38;5;147m'
col-data $'\e[38;5;82m' col-data2 $'\e[38;5;117m' col-hi $'\e[1m\e[38;5;183m'
col-var $'\e[38;5;81m' col-glob $'\e[38;5;227m' col-ehi $'\e[1m\e[38;5;210m'
col-cmd $'\e[38;5;82m' col-ice $'\e[38;5;39m' col-nl $'\n'
col-txt $'\e[38;5;254m' col-num $'\e[3;38;5;155m' col-term $'\e[38;5;185m'
col-warn $'\e[38;5;214m' col-ok $'\e[38;5;220m' col-time $'\e[38;5;220m'
col-apo $'\e[1;38;5;45m' col-aps $'\e[38;5;117m'
col-quo $'\e[1;38;5;33m' col-quos $'\e[1;38;5;160m'
col-bapo $'\e[1;38;5;220m' col-baps $'\e[1;38;5;82m'
col-faint $'\e[38;5;238m' col-opt $'\e[38;5;219m' col-lhi $'\e[38;5;81m'
col-flag $'\e[1;3;38;5;79m' col-pkg $'\e[1;3;38;5;27m'
col-tab $' \t ' col-msg3 $'\e[38;5;238m' col-b-lhi $'\e[1m\e[38;5;75m'
col-bar $'\e[38;5;82m' col-th-bar $'\e[38;5;82m'
col-… "${${${(M)LANG:#*UTF-8*}:+…}:-...}" col-ndsh "${${${(M)LANG:#*UTF-8*}:+–}:-}"
col-mdsh $'\e[1;38;5;220m'"${${${(M)LANG:#*UTF-8*}:+–}:--}"$'\e[0m'
col-mmdsh $'\e[1;38;5;220m'"${${${(M)LANG:#*UTF-8*}:+――}:--}"$'\e[0m'
col--… "${${${(M)LANG:#*UTF-8*}:+⋯⋯}:-···}" col-lr "${${${(M)LANG:#*UTF-8*}:+↔}:-"«-»"}"
col-↔ ${${${(M)LANG:#*UTF-8*}:+$'\e[38;5;82m↔\e[0m'}:-$'\e[38;5;82m«-»\e[0m'}
col-rst $'\e[0m' col-b $'\e[1m' col-nb $'\e[22m'
col-u $'\e[4m' col-it $'\e[3m' col-st $'\e[9m'
col-nu $'\e[24m' col-nit $'\e[23m' col-nst $'\e[29m'
col-bspc $'\b' col-b-warn $'\e[1;38;5;214m' col-u-warn $'\e[4;38;5;214m'
col-bcmd $'\e[38;5;220m'
)
if [[ ( ${+terminfo} -eq 1 && ${terminfo[colors]} -ge 256 ) || \
( ${+termcap} -eq 1 && ${termcap[Co]} -ge 256 )
]] {
ZINIT+=( col-pname $'\e[1;4m\e[38;5;39m' col-uname $'\e[1;4m\e[38;5;207m' )
}
[[ -f $ZINIT[THEME_DIR]/$ZITHEME.zsh ]] && \
source $ZINIT[THEME_DIR]/$ZITHEME.zsh
}

# Hooks
Expand Down

0 comments on commit 6dbc35e

Please sign in to comment.