You've already forked personal-linux-config
Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
c8758fe259 | |||
597354356b | |||
f5fb8e5dc3 | |||
82f2d7a989 | |||
7d8f7312f1 | |||
9851de3007 | |||
8866dc5bec |
@@ -1,4 +1,12 @@
|
||||
for source in colored_commands convenience_aliases git_functions histcontrol ls_aliases safety_aliases terminal_colors terminal_fancyfying; do
|
||||
for source in colored_commands \
|
||||
convenience_aliases \
|
||||
git_functions \
|
||||
histcontrol \
|
||||
home_bin_folder \
|
||||
ls_aliases \
|
||||
safety_aliases \
|
||||
terminal_colors \
|
||||
terminal_fancyfying; do
|
||||
if [ -f ~/.bashrc_overrides/$source ]; then
|
||||
. ~/.bashrc_overrides/$source
|
||||
fi
|
||||
|
@@ -1,3 +1,4 @@
|
||||
alias pubkey='cat ~/.ssh/id_rsa.pub'
|
||||
alias hosts='sudo nano /etc/hosts'
|
||||
alias historygrep='history | grep'
|
||||
alias newrepo='bash <(curl -s https://get.bjphoster.com/new-git-repo.sh)'
|
||||
|
4
bashrc_overrides/home_bin_folder
Normal file
4
bashrc_overrides/home_bin_folder
Normal file
@@ -0,0 +1,4 @@
|
||||
# set PATH so it includes user's private bin if it exists
|
||||
if [ -d "$HOME/bin" ] ; then
|
||||
PATH="$HOME/bin:$PATH"
|
||||
fi
|
13
bashrc_overrides/terminal_fancyfying_server
Normal file
13
bashrc_overrides/terminal_fancyfying_server
Normal file
@@ -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}"
|
23
deploy.sh
23
deploy.sh
@@ -1,12 +1,18 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
THIS="$(dirname "$(readlink -fm "$0")")"
|
||||
CLEANUP=true
|
||||
SERVER=false
|
||||
FORCE=false
|
||||
CLEANUP=false
|
||||
|
||||
_arguments() {
|
||||
for PARM in "$@"; do
|
||||
if [ "${PARM}" = "--no-cleanup" ]; then
|
||||
CLEANUP=false
|
||||
if [ "${PARM}" = "--server" ]; then
|
||||
SERVER=true
|
||||
elif [ "${PARM}" = "--force" ]; then
|
||||
FORCE=true
|
||||
elif [ "${PARM}" = "--cleanup" ]; then
|
||||
CLEANUP=true
|
||||
elif [ "${PARM}" = "-h" ] || [ "${PARM}" = "--help" ]; then
|
||||
_help
|
||||
exit 0
|
||||
@@ -15,11 +21,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
|
||||
}
|
||||
|
||||
@@ -38,7 +45,7 @@ _cleanup() {
|
||||
_main() {
|
||||
_arguments "$@"
|
||||
|
||||
if [ ! -z "$(grep "#REF:bashrc_overrides:REF" ~/.bashrc)" ]; then
|
||||
if [ ! -z "$(grep "#REF:bashrc_overrides:REF" ~/.bashrc)" ] && [ "${FORCE}" = false ]; then
|
||||
echo "bash overrides already in place"
|
||||
echo "skipping..."
|
||||
echo
|
||||
@@ -48,6 +55,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
|
||||
|
Reference in New Issue
Block a user