dotwryn/zsh/colors
2020-09-30 11:21:59 -06:00

44 lines
1.1 KiB
Bash

#!/bin/zsh
# ls colors
alias ls='ls --color=auto';
# zsh prompt
COFFEE="☕";
PREVIOUS_COMMAND_CONDITION="%B%(?.%F{yellow}.%F{red}) $COFFEE";
USER='%B%F{green}%n';
SEPARATOR='%b%F{red}::';
DIRECTORY='%B%F{yellow}%6~';
function parse_git_branch(){
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ \[\1\]/'
}
GIT_BRANCH='%B%F{cyan}$(parse_git_branch)';
PROMPT=$'\n'' %B%F{128}%# %b%f'
setopt PROMPT_SUBST
PS1="$PREVIOUS_COMMAND_CONDITION $USER $SEPARATOR $DIRECTORY $GIT_BRANCH $PROMPT"
#RPROMPT="$(\e[1A) $GIT_BRANCH";
######################################################################################
function KITTY_CHANGE_THEME () {
[ ! $1 ] && echo no filename given :c && return 1;
[ ! -f "$DOTWRYN/config/colorschemes/kitty/$1" ] \
&& echo colorscheme not supported && return 2;
rm $DOTWRYN/config/kitty/theme.conf
ln -s "$DOTWRYN/config/colorschemes/kitty/$1" "$DOTWRYN/config/kitty/theme.conf"\
&& echo 'theme changed successfully! (effective on new terminal session)'
}
_KITTY_CHANGE_THEME () {
compadd $(ls $DOTWRYN/config/colorschemes/kitty)
}
compdef _KITTY_CHANGE_THEME KITTY_CHANGE_THEME;