From 8866dc5beca8c7a65864e93f79aa7abb84c5dea1 Mon Sep 17 00:00:00 2001 From: Bryan Joshua Pedini Date: Thu, 3 Jun 2021 17:39:45 +0200 Subject: [PATCH] quality of life, terminal server version - cleanup is now opt-in instead of opt-out - added server parameter to deploy with a different terminal scheme --- bashrc_overrides/terminal_fancyfying_server | 13 +++++++++++++ deploy.sh | 18 +++++++++++++----- 2 files changed, 26 insertions(+), 5 deletions(-) create mode 100644 bashrc_overrides/terminal_fancyfying_server diff --git a/bashrc_overrides/terminal_fancyfying_server b/bashrc_overrides/terminal_fancyfying_server new file mode 100644 index 0000000..9f202da --- /dev/null +++ b/bashrc_overrides/terminal_fancyfying_server @@ -0,0 +1,13 @@ +GIT_FUNCTIONS=true + +# Spaced +#PS1="${LIGHTBLUE}[ ${LIGHTRED}\u ${LIGHTBLUE}@ ${LIGHTBROWN}$(hostname --fqdn) ${LIGHTBLUE}] ${LIGHTPURPLE}( ${GREEN}\w ${LIGHTPURPLE}) " +# Not spaced +PS1="${LIGHTBLUE}[${LIGHTRED}\u${LIGHTBLUE}@${LIGHTBROWN}$(hostname --fqdn)${LIGHTBLUE}]${LIGHTPURPLE}(${GREEN}\w${LIGHTPURPLE})" + +if [ $GIT_FUNCTIONS ]; then + #PS1="$PS1${LIGHTPURPLE}[${LIGHTCYAN}$(__git_prompt)${LIGHTPURPLE}]" + PS1="$PS1${LIGHTBROWN}(${LIGHTCYAN}\$(__git_prompt)${LIGHTBROWN}) " +fi + +PS1="$PS1${RED}#${FORMAT_RESET}" diff --git a/deploy.sh b/deploy.sh index 065557b..01a3690 100755 --- a/deploy.sh +++ b/deploy.sh @@ -1,12 +1,15 @@ #!/usr/bin/env bash THIS="$(dirname "$(readlink -fm "$0")")" -CLEANUP=true +SERVER=FALSE +CLEANUP=false _arguments() { for PARM in "$@"; do - if [ "${PARM}" = "--no-cleanup" ]; then - CLEANUP=false + if [ "${PARM}" = "--server" ]; then + SERVER=TRUE + elif [ "${PARM}" = "--cleanup" ]; then + CLEANUP=TRUE elif [ "${PARM}" = "-h" ] || [ "${PARM}" = "--help" ]; then _help exit 0 @@ -15,11 +18,12 @@ _arguments() { } _help() { - echo "Usage: $(readlink -fm "$0") [-h | --help] [--no-cleanup]" + echo "Usage: $(readlink -fm "$0") [-h | --help] [--cleanup]" echo echo "Options:" echo " -h | --help : Prints this help message and quits" - echo " --no-cleanup: Does not clean the source folder after adding the bash overrides" + echo " --server: Customizes the terminal feel for a server installation" + echo " --cleanup: Removes the source folder after installation" echo } @@ -48,6 +52,10 @@ _main() { echo fi + if [ "${SERVER}" = true ]; then + sed -i 's/terminal_fancyfying/terminal_fancyfying_server/' ~/.bashrc_overrides/_all + fi + if [ "${CLEANUP}" = true ]; then echo "cleaning up..." _cleanup