-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathfish_prompt.fish
54 lines (42 loc) · 1.96 KB
/
fish_prompt.fish
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
#!/usr/bin/env fish
#======================================================================#
# _ _ _ _ _ _____ _ #
# /_\ _ __| |_ _ _ ___ __| (_) |_ ___ |_ _| |_ ___ _ __ ___ #
# / _ \| '_ \ ' \| '_/ _ \/ _` | | _/ -_) | | | ' \/ -_) ' \/ -_) #
# /_/ \_\ .__/_||_|_| \___/\__,_|_|\__\___| |_| |_||_\___|_|_|_\___| #
# |_| #
# #
# Aphrodite Terminal Theme #
# by Sergei Kolesnikov a.k.a. win0err #
# #
# https://kolesnikov.se #
# #
#======================================================================#
function fish_prompt --description Aphrodite
set -l retc red
test $status = 0; and set retc normal
set -g VIRTUAL_ENV_DISABLE_PROMPT true
set -q VIRTUAL_ENV; and echo -n (set_color white)'['(basename "$VIRTUAL_ENV")'] '
echo -n (set_color cyan)$USER
echo -n (set_color brblack)'@'
echo -n (set_color brblue)(prompt_hostname)
echo -n (set_color brblack)':'
echo -n (set_color normal)(prompt_pwd -D 64)
echo -n ' '
set -l git_branch (git --no-optional-locks rev-parse --abbrev-ref HEAD 2> /dev/null)
if test -n "$git_branch"
set -l git_status (git --no-optional-locks status --porcelain 2> /dev/null | tail -n 1)
set -l git_branch_color brgreen
test -n "$git_status"; and set git_branch_color bryellow
echo -n "$(set_color $git_branch_color)‹"$git_branch"›"
end
set -q APHRODITE_THEME_SHOW_TIME; and echo -n "$(set_color brblack) [$(date +%H:%M:%S)]"
echo # new line
set_color $retc
if functions -q fish_is_root_user; and fish_is_root_user
echo -n '# '
else
echo -n '$ '
end
set_color normal
end