diff options
author | Aditya <bluenerd@protonmail.com> | 2023-02-27 20:04:56 +0530 |
---|---|---|
committer | Aditya <bluenerd@protonmail.com> | 2023-02-27 20:04:56 +0530 |
commit | edc449275b6c04445f58b108ca0937a87c1e8430 (patch) | |
tree | 9fd484d58145b616f29a78857cc0b1c8b1c18f05 /oh-my-zsh/themes/gnzh.zsh-theme | |
parent | 6f5424ca96c4221ef433f545642669e9c104d0ed (diff) |
add zsh
Diffstat (limited to 'oh-my-zsh/themes/gnzh.zsh-theme')
-rw-r--r-- | oh-my-zsh/themes/gnzh.zsh-theme | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/oh-my-zsh/themes/gnzh.zsh-theme b/oh-my-zsh/themes/gnzh.zsh-theme new file mode 100644 index 0000000..1e6c4e9 --- /dev/null +++ b/oh-my-zsh/themes/gnzh.zsh-theme @@ -0,0 +1,43 @@ +# Based on bira theme + +setopt prompt_subst + +() { + +local PR_USER PR_USER_OP PR_PROMPT PR_HOST + +# Check the UID +if [[ $UID -ne 0 ]]; then # normal user + PR_USER='%F{green}%n%f' + PR_USER_OP='%F{green}%#%f' + PR_PROMPT='%f➤ %f' +else # root + PR_USER='%F{red}%n%f' + PR_USER_OP='%F{red}%#%f' + PR_PROMPT='%F{red}➤ %f' +fi + +# Check if we are on SSH or not +if [[ -n "$SSH_CLIENT" || -n "$SSH2_CLIENT" ]]; then + PR_HOST='%F{red}%M%f' # SSH +else + PR_HOST='%F{green}%M%f' # no SSH +fi + + +local return_code="%(?..%F{red}%? ↵%f)" + +local user_host="${PR_USER}%F{cyan}@${PR_HOST}" +local current_dir="%B%F{blue}%~%f%b" +local git_branch='$(git_prompt_info)' + +PROMPT="╭─${user_host} ${current_dir} \$(ruby_prompt_info) ${git_branch} +╰─$PR_PROMPT " +RPROMPT="${return_code}" + +ZSH_THEME_GIT_PROMPT_PREFIX="%F{yellow}‹" +ZSH_THEME_GIT_PROMPT_SUFFIX="› %f" +ZSH_THEME_RUBY_PROMPT_PREFIX="%F{red}‹" +ZSH_THEME_RUBY_PROMPT_SUFFIX="›%f" + +} |