aboutsummaryrefslogtreecommitdiffstats
path: root/zsh/themes/prompt_kyrias_setup
blob: 68dbfd82acb46969d33af84e09d3b87f91a12940 (plain)
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
prompt_kyrias_help() {
	cat <<EOF
kyrias' prompt.
EOF
}

prompt_user_color() {
	if (( ! UID )); then
		print "red"
	else
		print "black"
	fi
}

venv_prompt() {
	if [[ -n "$VIRTUAL_ENV" ]]; then
		print -P '%{$bg[blue]$fg[white] ${VIRTUAL_ENV##*/} %f%k%}'
	fi
}

prompt_kyrias_precmd() {
	print -Pn "\e];%n %~\a"
}

prompt_kyrias_setup() {
	setopt prompt_subst
	autoload -U colors && colors

	PROMPT='%{$bg[$(prompt_user_color)]$fg[white] %m %k%f$bg[white]$fg[$(prompt_user_color)] %~ %f%k$(venv_prompt)
$bg[blue]%} λ %k %}'
}

prompt_kyrias_preview() {
	prompt_preview_theme kyrias "$@"
}

prompt_kyrias_setup "$@"

# vim: ft=zsh