blob: b43905d18d7692cb9679ba7f7a0465684f0291e2 (
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
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
|
if [[ "$TERM" == "xterm-kitty" ]]; then
source "$(dirname "${BASH_SOURCE[0]}")/git-prompt.sh"
function prompt.bubble {
printf '\[\e[49m\e[38;5;237m\]◖\[\e[48;5;237m\e[39m\]%s\[\e[0m\e[49m\e[38;5;237m\]◗\[\e[0m\]' "$@";
}
function prompt.git {
GIT_PS1_STATESEPARATOR=';'
GIT_PS1_SHOWDIRTYSTATE=1
GIT_PS1_SHOWUNTRACKEDFILES=
GIT_PS1_SHOWUPSTREAM=
GIT_PS1_HIDE_IF_PWD_IGNORED=1
local git_ps1="$(__git_ps1)"
git_ps1="${git_ps1##' ('}"
git_ps1="${git_ps1%')'}"
IFS=';' read -r branch state _ <<< "$git_ps1"
if [[ -n "$branch" ]]; then
printf ' '
if [[ "$state" == '*' ]]; then
prompt.bubble "$(printf '\[\e[4;32m\]%s' "$branch")"
else
prompt.bubble "$(printf '\[\e[32m\]%s' "$branch")"
fi
fi
}
function prompt.prepare {
local err=$?
PS1='\n'
local subshell=''
if [[ -n "$IN_NIX_SHELL" ]]; then
subshell="\\[\e[33m\\]nix"
fi
if [[ $SHLVL != 1 && ! ($SHLVL == 2 && -n "$IN_NIX_SHELL") ]]; then
if [[ -n "$subshell" ]]; then subshell+="\\[\e[39m\\] "; fi
subshell+="\\[\e[2;37m\\]$SHLVL"
fi
if [[ -n "$subshell" ]]; then
PS1+="$(prompt.bubble "$subshell") "
fi
if [[ $EUID == 0 ]]; then
PS1+="$(prompt.bubble "\\[\e[4m\\]\u@\H")"
else
PS1+="$(prompt.bubble "\u@\H")"
fi
PS1+=" $(prompt.bubble "\\[\e[34m\\]\w")"
PS1+="$(prompt.git)"
if [[ $err != 0 ]]; then
PS1+=" $(prompt.bubble "\\[\e[31m\\]$err")"
fi
PS1+=" $(prompt.bubble "❯") "
if [[ $err != 0 ]]; then
(exit "$err")
fi
}
PROMPT_COMMAND='prompt.prepare'
fi
function baller {
printf '🮲🮳⚽︎ \n'
}
|