colors simplification; ps1 refactor
This commit is contained in:
parent
619f2392ec
commit
b5d6cbe004
12
env/env.zsh
vendored
12
env/env.zsh
vendored
@ -1,22 +1,30 @@
|
||||
#####################################################################
|
||||
### Path References #################################################
|
||||
#####################################################################
|
||||
|
||||
DOTWRYN="$HOME/.wryn"
|
||||
SFX_PATH="$HOME/Media/sfx"
|
||||
WALLPAPER_PATH="$HOME/Pictures/bg"
|
||||
|
||||
#####################################################################
|
||||
### Applications / Application Settings #############################
|
||||
### Application Settings ############################################
|
||||
#####################################################################
|
||||
|
||||
|
||||
# ordered from least-preferred to most-preferred
|
||||
PREFERRED_EDITOR=(vi vim)
|
||||
|
||||
# should play an audio file argument
|
||||
MEDIA_ENGINE='canberra-gtk-play -f'
|
||||
|
||||
WEBBROWSER='google-chrome-stable'
|
||||
RIPGREP_CONFIG_PATH="$HOME/.config/ripgrep/config"
|
||||
TMUX_DEFAULT_SESSION_NAME='wryn'
|
||||
WEBBROWSER='google-chrome-stable'
|
||||
|
||||
PS1_INDICATOR_SYMBOL='☕'
|
||||
PS1_USER='%n'
|
||||
PS1_SEPARATOR='::'
|
||||
|
||||
|
||||
#####################################################################
|
||||
### External Plugins / Settings #####################################
|
||||
|
36
zsh/colors
36
zsh/colors
@ -1,34 +1,30 @@
|
||||
#!/bin/zsh
|
||||
#####################################################################
|
||||
|
||||
# ls colors
|
||||
alias ls='ls --color=auto';
|
||||
|
||||
#####################################################################
|
||||
|
||||
# zsh prompt
|
||||
COFFEE="☕";
|
||||
PREVIOUS_COMMAND_CONDITION="%B%(?.%F{yellow}.%F{red}) $COFFEE";
|
||||
GENERATE_PS1() {
|
||||
local INDICATOR_SYMBOL="$1"
|
||||
local PROMPT_USER="$2"
|
||||
local SEPARATOR="$3"
|
||||
|
||||
USER='%B%F{green}%n';
|
||||
local _INDICATOR="%B%(?.%F{green}.%F{red}) $INDICATOR_SYMBOL"
|
||||
local _USER="%B%F{magenta}$PROMPT_USER"
|
||||
local _SEPARATOR="%b%F{red}$SEPARATOR"
|
||||
local _DIRECTORY='%B%F{yellow}%6~'
|
||||
local _GIT_BRANCH='%B%F{cyan}$(git branch --no-color 2>/dev/null | sed "/^[^*]/d; s/* \(.*\)/ \1/")'
|
||||
|
||||
SEPARATOR='%b%F{red}::';
|
||||
local _PROMPT=$'\n'' %B%F{blue}%# %b%f'
|
||||
|
||||
DIRECTORY='%B%F{yellow}%6~';
|
||||
|
||||
function parse_git_branch(){
|
||||
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ \[\1\]/'
|
||||
echo "$_INDICATOR $_USER $_SEPARATOR $_DIRECTORY $_GIT_BRANCH $_PROMPT"
|
||||
}
|
||||
GIT_BRANCH='%B%F{cyan}$(parse_git_branch)';
|
||||
|
||||
PROMPT_LINE=$'\n'' %B%F{128}%# %b%f'
|
||||
|
||||
setopt PROMPT_SUBST
|
||||
PS1="$PREVIOUS_COMMAND_CONDITION $USER $SEPARATOR $DIRECTORY $GIT_BRANCH $PROMPT_LINE"
|
||||
export PS1="$(GENERATE_PS1 "$PS1_INDICATOR_SYMBOL" "$PS1_USER" "$PS1_SEPARATOR")"
|
||||
|
||||
[ -f "$HOME/.config/wryn/ps1" ] && source "$HOME/.config/wryn/ps1"
|
||||
|
||||
|
||||
|
||||
######################################################################################
|
||||
#####################################################################
|
||||
|
||||
source "$DOTWRYN/config/colorschemes/linux-console"
|
||||
|
||||
@ -56,6 +52,8 @@ _TTY_CHANGE_THEME() {
|
||||
}
|
||||
compdef _TTY_CHANGE_THEME TTY_CHANGE_THEME;
|
||||
|
||||
#####################################################################
|
||||
|
||||
alias kitty-change-theme='KITTY_CHANGE_THEME default'
|
||||
alias kitty-change-theme-alternate='KITTY_CHANGE_THEME alternate'
|
||||
function KITTY_CHANGE_THEME () {
|
||||
|
Loading…
Reference in New Issue
Block a user