aboutsummaryrefslogtreecommitdiffstats
path: root/hyperterm/hyperterm.sh
diff options
context:
space:
mode:
authorJesús <heckyel@hyperbola.info>2021-02-10 13:52:52 -0500
committerJesús <heckyel@hyperbola.info>2021-02-10 13:52:52 -0500
commit7e95c3b667a1b353f8275db886203f272bfcce34 (patch)
treeaefe3b7db69ac78b83b79a70cf43401679812d20 /hyperterm/hyperterm.sh
downloadhyperterm-7e95c3b667a1b353f8275db886203f272bfcce34.tar.lz
hyperterm-7e95c3b667a1b353f8275db886203f272bfcce34.tar.xz
hyperterm-7e95c3b667a1b353f8275db886203f272bfcce34.zip
first commit
Diffstat (limited to 'hyperterm/hyperterm.sh')
-rw-r--r--hyperterm/hyperterm.sh75
1 files changed, 75 insertions, 0 deletions
diff --git a/hyperterm/hyperterm.sh b/hyperterm/hyperterm.sh
new file mode 100644
index 0000000..e549048
--- /dev/null
+++ b/hyperterm/hyperterm.sh
@@ -0,0 +1,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