update zsh config
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# Detect logo capability
|
||||
# Detect logo capability.
|
||||
|
||||
if [[ -z "$uy_fetch_logo_type" ]]; then
|
||||
_uy_fetch_probe() {
|
||||
if (( $+commands[kgp-query] )) && kgp-query 2>/dev/null; then
|
||||
uy_fetch_logo_type=kitty
|
||||
elif (( $+commands[sixel-query] )) && sixel-query 2>/dev/null; then
|
||||
@@ -10,8 +10,31 @@ if [[ -z "$uy_fetch_logo_type" ]]; then
|
||||
else
|
||||
uy_fetch_logo_type=auto
|
||||
fi
|
||||
}
|
||||
|
||||
if [[ -z "$uy_fetch_logo_type" ]]; then
|
||||
if [[ -t 0 ]] && (( $+commands[kgp-query] || $+commands[sixel-query] )); then
|
||||
_uy_fetch_cache_dir="${XDG_CACHE_HOME:-$HOME/.cache}/zsh/logo-type"
|
||||
# Terminal identity, sanitised down to a single path component
|
||||
_uy_fetch_cache_file="$_uy_fetch_cache_dir/${${TERM:-none}//[^A-Za-z0-9._-]/_}@${${TERM_PROGRAM:-none}//[^A-Za-z0-9._-]/_}"
|
||||
|
||||
[[ -s "$_uy_fetch_cache_file" ]] && uy_fetch_logo_type="$(<"$_uy_fetch_cache_file")"
|
||||
|
||||
# Covers both a cache miss and a cache file holding anything unexpected
|
||||
if [[ "$uy_fetch_logo_type" != (kitty|sixel|logo|symbols|auto) ]]; then
|
||||
_uy_fetch_probe
|
||||
[[ -d "$_uy_fetch_cache_dir" ]] || mkdir -p "$_uy_fetch_cache_dir"
|
||||
print -r -- "$uy_fetch_logo_type" >| "$_uy_fetch_cache_file"
|
||||
fi
|
||||
|
||||
unset _uy_fetch_cache_dir _uy_fetch_cache_file
|
||||
else
|
||||
_uy_fetch_probe
|
||||
fi
|
||||
fi
|
||||
|
||||
unfunction _uy_fetch_probe
|
||||
|
||||
: ${uy_fetch_color:="38;2;137;180;250"}
|
||||
|
||||
# Build fastfetch args (arrays to handle paths with spaces safely)
|
||||
|
||||
Reference in New Issue
Block a user