-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathproysh.zsh-theme
85 lines (70 loc) · 2.35 KB
/
proysh.zsh-theme
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/bin/zsh
#
DOMAIN=$(hostname -d)
# Based on gnzh theme, 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
if [[ $HOST == "rocinante" || $HOST == "trantor" ]] {
PR_HOST="%F{green}%m%f"
} elif [[ $HOST == "mhysa" || $HOST == "drasha" || $HOST == "pollux" ]] {
PR_HOST="%F{blue}%m%f"
} elif [[ $HOST == *"phone"* || $HOST == *"enchilada"* ]] {
PR_HOST="%F{cyan}%m%f"
} elif [[ $HOST == "roma" || $HOST == "anaproy.nl" || $HOST == "anaproy2" || $HOST == "anaproy" ]] {
if [ "$OSTYPE" = "linux-musl" ]; then
PR_HOST="%F{yellow}%M%f"
else
PR_HOST="%F{red}%M%f"
fi
} elif [[ -f /etc/profile.d/mlp.sh ]] {
HOSTNAME=$HOST
source /etc/profile.d/mlp.sh
PR_HOST="%F{173}${PONY} %m%f"
} else {
PR_HOST="%F{white}%m%f"
}
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)'
local venv_prompt='$(virtualenv_prompt_info)'
local datetime="%F{white}%* - %D{%a %f %b}%f"
local seqnr="%F{white}#%i%f"
local promptsign="%{$fg_bold[yellow]%}\$%{$reset_color%} "
if [[ $HOST != *"phone"* ]]; then
PROMPT="╭ ${user_host} ${current_dir} ${venv_prompt} ${git_branch} ── ${datetime} ── ${seqnr} ${return_code}
╰ $PR_PROMPT${promptsign}"
else
PROMPT="╭ ${user_host} ${current_dir} ${venv_prompt} ${git_branch} ${return_code}
╰ $PR_PROMPT${promptsign}"
fi
#RPROMPT="${return_code}"
ZSH_THEME_GIT_PROMPT_PREFIX="%F{yellow}‹"
ZSH_THEME_GIT_PROMPT_SUFFIX="› %f"
ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[green]%} ∆"
ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[blue]%} ∂"
ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%} ✖"
ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[magenta]%} ◊"
ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[yellow]%} ≠"
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[cyan]%} ≈"
ZSH_THEME_VIRTUALENV_PREFIX="%{$fg_bold[magenta]%}"
ZSH_THEME_VIRTUALENV_SUFFIX="%{$reset_color%}"
typeset -g ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=#7a8478'
}