-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.prompt
67 lines (53 loc) · 2 KB
/
.prompt
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
# @gf3’s Sexy Bash Prompt, inspired by “Extravagant Zsh Prompt”
# Shamelessly copied from https://github.com/gf3/dotfiles
default_username='will-never-match'
if [[ $COLORTERM = gnome-* && $TERM = xterm ]] && infocmp gnome-256color >/dev/null 2>&1; then
export TERM=gnome-256color
elif infocmp xterm-256color >/dev/null 2>&1; then
export TERM=xterm-256color
fi
BLACK=$(tput setaf 0)
RED=$(tput setaf 1)
YELLOW=$(tput setaf 3)
PINK=$(tput setaf 5)
LIME_YELLOW=$(tput setaf 190)
POWDER_BLUE=$(tput setaf 153)
BLUE=$(tput setaf 4)
CYAN=$(tput setaf 6)
MAGENTA=$(tput setaf 9)
ORANGE=$(tput setaf 172)
GREEN=$(tput setaf 190)
PURPLE=$(tput setaf 141)
WHITE=$(tput setaf 256)
LIGHTGREY="$(tput setaf 8)"
GREY="$(tput setaf 7)"
GREYBG="$(tput setab 7)"
LIGHTGREYBG="$(tput setab 8)"
BRIGHT=$(tput bold)
BLINK=$(tput blink)
REVERSE=$(tput smso)
UNDERLINE=$(tput smul)
BOLD=$(tput bold)
RESET=$(tput sgr0)
function git_info() {
# check if we're in a git repo
git rev-parse --is-inside-work-tree &>/dev/null || return
# quickest check for what branch we're on
branch=$(git symbolic-ref -q HEAD | sed -e 's|^refs/heads/||')
# check if it's dirty (via github.com/sindresorhus/pure)
dirty=$(git diff --quiet --ignore-submodules HEAD &>/dev/null; [ $? -eq 1 ]&& echo -e "*")
echo $WHITE" on "$PURPLE$UNDERLINE$branch$RESET $BRIGHT$CYAN$dirty$RESET
}
# Only show username/host if not default
function usernamehost() {
if [ $USER != $default_username ]; then echo "${MAGENTA}$USER ${WHITE}👊 ${ORANGE}$HOSTNAME $WHITEin "; fi
}
function vpnstatus() {
# checkDevEnv
if [ $? -ne 1 ]; then echo -e "${LIME_YELLOW}${LIGHTGREYBG}\xe2\x98\x85 ${RESET} "; else echo -e "${GREY}\xe2\x98\x85 ${RESET} " ; fi
}
# This is honestly a bit strange to me, because I am getting this in the console: ⚡️
# just from this little guy: ⚡
# It works 👍
ZAP="⚡"
PS1="\n\[$YELLOW\]⚡️\[$RESET\] \[\e]2;$PWD\[\a\]\[\e]1;\]$(basename "$(dirname "$PWD")")/\W\[\a\]${BOLD}\$(usernamehost)\[$GREEN\]\w\$(git_info)\[$YELLOW\]\n$ZAP \[$RESET\]"