blob: e5490481c8fc2fc7231b5aabb033e60c8255ed4f (
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
73
74
75
|
#!/bin/bash
#
# Custom Prompt Shell
#
# $HOME/.bashrc
#
# License: GNU GPLv3 or later
# See archive AUTHORS
#
# shellcheck disable=SC1090
xhost +local:root > /dev/null 2>&1
#---------------
# Check bash
#---------------
if [[ ! -f /bin/bash ]]; then
if [[ $(command -v bash) != /bin/bash ]]; then
printf '%s\n' "/bin/bash not found. Please run 'sudo ln -s $(command -v bash) /bin/bash'"
fi
fi
#---------------
# Emacs support
#---------------
[ "$TERM" = "dumb" ] && export PAGER=/bin/cat
#----------------
# bash_aliases
#----------------
if [[ -f $HOME/.hyperterm/tools/aliases.sh ]]; then source "$HOME/.hyperterm/tools/aliases.sh"; else true; fi
#----------------
# bash_functions
#----------------
# [ core ]
if [[ -f $HOME/.hyperterm/core/autocomplete.sh ]]; then source "$HOME/.hyperterm/core/autocomplete.sh"; else true; fi
if [[ -f $HOME/.hyperterm/core/colors.sh ]]; then source "$HOME/.hyperterm/core/colors.sh"; else true; fi
if [[ -f $HOME/.hyperterm/core/git.sh ]]; then source "$HOME/.hyperterm/core/git.sh"; else true; fi
if [[ -f $HOME/.hyperterm/core/languages.sh ]]; then source "$HOME/.hyperterm/core/languages.sh"; else true; fi
if [[ -f $HOME/.hyperterm/core/status.sh ]]; then source "$HOME/.hyperterm/core/status.sh"; else true; fi
if [[ -f $HOME/.hyperterm/core/update.sh ]]; then source "$HOME/.hyperterm/core/update.sh"; else true; fi
#-------------
# Theme
#-------------
if [[ -f $HOME/.hyperterm/themes/default.sh ]]; then source "$HOME/.hyperterm/themes/default.sh"; else true; fi
#--------------
# bashrc_custom
#--------------
if [[ -f $HOME/.hyperterm/_custom.sh ]]; then source "$HOME/.hyperterm/_custom.sh"; else true; fi
#---------------
# Shell prompt
#---------------
if [[ -d $HOME/.hyperterm && -f $HOME/.hyperterm/_custom.sh && -s $HOME/.hyperterm/_custom.sh ]]; then
PS1="${prompt:=$prompt}"
elif [[ -d $HOME/.hyperterm ]]; then
PS1="${prompt:=$default}"
else
PS1='[\u@\h \W]\$ '
fi
#Interactive Prompt
PS2="${_psi:=$_psi}"
# global unsets
unset SYMBOL prompt _psi
# clean up themes
unset default light_theme minterm pure special
# clean up colors
unset BLUE CYAN GREEN GREY LEMON ORANGE PURPLE \
RED WHITE YELLOW BOLD RESET
|