-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvehemence.zsh-theme
More file actions
83 lines (73 loc) · 1.73 KB
/
vehemence.zsh-theme
File metadata and controls
83 lines (73 loc) · 1.73 KB
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
# Vehemence by H1N1 and tupzikapi
# This is nice minimalistic two-line theme
# Theme shows:
# Time
# Return status (if not zero)
# Name + Host
# Path
# History (how many commands you executed)
# Indicator for errors (two styles)
# Jobs running
#
# Configuration
indicator=1 # 0 for disable, 1 for check mark and cross, 2 for "OwO" and ">w<"
histk=0 # 0 for disable, 1 for enable history size.
timek=0 # 0 for disable, 1 for show time.
errork=0 # 1 for show error code.
jobsk=0 # 1 for show, how many jobs you have running.
function inde() {
local ret=$?
if [[ $indicator -eq 1 ]]; then
if [[ $ret -ne 0 ]]; then
echo '%F{1}X%f'
fi
if [[ $ret -eq 0 ]]; then
echo '%F{2}V%f'
fi
fi
if [[ $indicator -eq 2 ]]; then
if [[ $ret -ne 0 ]]; then
echo '%F{1}>w<%f'
fi
if [[ $ret -eq 0 ]]; then
echo '%F{2}OwO%f'
fi
fi
}
function err() {
local ret=$?
if [[ $ret -ne 0 ]]; then
if [[ $errork -ne 0 ]]; then
echo '> %F{9}%?%f <'
fi
fi
}
function jobber(){
if [[ $jobsk -ne 0 ]]; then
echo '%(1j.%B(%F{4} J:%j%f )%b.)' # Please.. how to understand it..
fi
}
local rn=$'\r\n'
local lfa="%B(%F{6} %n %m %f%F{2}%l%f )%b " # Left Up 1 (NAME+HOST+TTY)
if [[ $histk -ne 0 ]]; then
local lfb="%B(%F{3} %!%f )%b" # Left Up 2.1 (Commands)
else
local lfb=""
fi
if [[ $indicator -ne 0 ]]; then
local lfbb=' %B( $(inde) )%b' # Left Up 2.2 (Indicator)
else
local lfbb="" # Left Up 2.2 (Indicator OFF)
fi
if [[ $jobsk -ne 0 ]]; then
local lfbb=$lfbb' $(jobber)' # Left Up 2.2 (Indicator)
fi
local lfc="%B%F{13} %~ %f%b%# " # Left Down (Directory)
if [[ $timek -ne 0 ]]; then
local right='$(err) %B(%F{6} %* %f)%b' # Right Up
else
local right='$(err)'
fi
local left="$lfa$lfb$lfbb$rn$lfc"
PROMPT=$left
RPROMPT=$right