-
Notifications
You must be signed in to change notification settings - Fork 0
/
yanis.zsh-theme
78 lines (65 loc) · 1.79 KB
/
yanis.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
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}" # "%{$reset_color%}%{$fg[green]%}["
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}*%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_CLEAN=""
#
# Custom helpers.
#
current_branch() {
if [ -d .git ]; then
git rev-parse --abbrev-ref HEAD
fi;
}
work_in_progress() {
if $(git log -n 1 2>/dev/null | grep -q -c "\-\-wip\-\-"); then
echo "WIP!!"
fi
}
git_custom_status() {
local cb=$(current_branch)
if [ -n "$cb" ]; then
echo "$(parse_git_dirty)%{$fg_bold[yellow]%}$(work_in_progress)%{$reset_color%}$ZSH_THEME_GIT_PROMPT_PREFIX$(current_branch)$ZSH_THEME_GIT_PROMPT_SUFFIX"
fi
}
rbenv_version() {
echo "%{$fg[red]%}[$(rbenv version | sed -e 's/ (set.*$//')]%{$reset_color%}"
}
node_version() {
echo "%{$fg[yellow]%}[$(node --version)]%{$reset_color%}"
}
time_in_clt() {
echo "%{$fg[yellow]%}c$(TZ=US/Eastern date +"%H:%M")%{$reset_color%}"
}
# time_in_smr() {
# echo "%{$fg[yellow]%}s$(TZ=Europe/Samara date +"%H:%M")%{$reset_color%}"
# }
itunes_playing() {
artist=`osascript -e '
tell application "iTunes"
try
if it is running then
artist of current track as string
end if
end try
end tell'`
name=`osascript -e '
tell application "iTunes"
try
if it is running then
name of current track as string
end if
end try
end tell'`
test -z $artist \
&& echo "" \
|| echo "%{$fg[green]%}♫$artist - $name♫%{$reset_color%}"
}
#
# Formatting
#
# RVM component of prompt
ZSH_THEME_RVM_PROMPT_PREFIX="%{$fg[red]%}["
ZSH_THEME_RVM_PROMPT_SUFFIX="]%{$reset_color%}"
# Combine it all into a final right-side prompt
RPS1='$(git_custom_status) $(rbenv_version) $(node_version)$EPS1'
PROMPT="%{$fg[cyan]%}[%~% ]%(?.%{$fg[green]%}.%{$fg[red]%})%B$%b "